Rate This Document
Findability
Accuracy
Completeness
Readability

Starting/Uninstalling a Cloud Phone Instance

Ensure that the kbox_config.cfg file exists in the startup path of the cloud phone instance. The container uses the configuration in this file. Therefore, ensure that the configuration in the kbox_config.cfg file is correct. If the configuration file does not exist in the startup path, the cloud phone cannot be started.

You can change map configurations (see Table 1) of a channel to select the GPU, CPU, and path to the data volume used by the container of this channel. In this way, you can flexibly configure resources used by cloud phones to achieve optimal performance.

Table 1 Parameters for configuring the GPU, CPU, and path to the data volume in kbox_config.cfg

Parameter

Parameter Description

Configuration Description

  • KBOX_GPU_MAP (configuration scheme 1)
  • KBOX_VA_GPU_MAP (configuration scheme 2/3)

Selects the GPU used by a container.

  • The first entry in the KBOX_GPU_MAP list indicates the Kbox cloud phone whose index is 1. The allocated GPU node is /dev/dri/renderD128. According to Configuration Scheme 1, the renderD128 node belongs to NUMA0. Therefore, the CPU core range configured in KBOX_CPUSET_MAP for NUMA0 of the Kunpeng 920 7260 processor should be 0 to 31.
  • The first entry in the KBOX_VA_GPU_MAP list indicates the Kbox cloud phone whose index is 1. The allocated GPU node is /dev/dri/renderD128. According to Configuration Scheme 2/3, nodes renderD128 to renderD135 belong to NUMA0. Therefore, the CPU core range configured in KBOX_CPUSET_MAP for NUMA0 of the Kunpeng 920 7260 processor should be 0 to 31, and that for NUMA0 of the Kunpeng 920 7280Z processor should be 0 to 79.

KBOX_CPUSET_MAP

Selects the CPU used by a container.

KBOX_MOUNT_MAP

Selects the path to the data volume used by a container.

None

To ensure the stable running and optimal performance of the Kbox cloud phone, ensure that the physical CPU cores and GPU rendering nodes bound to a container belong to the same CPU socket.

The Kbox cloud phone container supports the graphics acceleration layer. You can enable this feature by setting ENABLE_RENDER_LAYER in the kbox_config.cfg file to 1. You can also configure the graphics acceleration layer in the kbox_render_accelerating_configuration.xml file in the ~/dependency/deploy_scripts directory. For details about the configuration items, see section "Configuration Items of the Graphics Acceleration Layer" in the Video Stream Engine Feature Guide (Android 15). If you need to modify the configuration of the graphics acceleration layer after starting the cloud phone container for the first time, modify the application-specific settings in the configuration file, manually copy the file to the /data/local/tmp directory of the cloud phone container, and restart the application for the modification to take effect.

  1. Decompress Kbox-AOSP15.zip and upload the deploy_scripts directory in the Kbox-AOSP15 folder to the ~/dependency directory on the server.
  2. (Optional) To start a video stream cloud phone instance with the C2 decoder enabled (applicable to configuration scheme 1), set ENABLE_AMD_C2_DECODE to 1 in the kbox_config.cfg file in the deploy_scripts directory. 0 (default) and any other values indicate disabled. The C2 decoder needs to be enabled or disabled during the initial container startup; dynamic switching is not supported. Built-in cloud phone applications will automatically select the appropriate decoder based on their specific requirements.
    ENABLE_AMD_C2_DECODE=0
  3. Run the android_kbox_aosp15.sh script to start a container.
    1
    2
    3
    cd ~/dependency/deploy_scripts
    chmod +x android_kbox_aosp15.sh
    ./android_kbox_aosp15.sh start {image_name:tag} ${index1}
    

    Table 2 lists the default configurations of a Kbox basic cloud phone.

    Table 2 Default configurations

    Item

    Kbox Basic Cloud Phone

    Scenario

    Mobile office/hosting

    vCPU

    2

    CPU core binding policy

    2 containers, 2 cores

    Memory

    6 GB

    System storage

    16 GB

    Resolution

    720 x 1280

    Example: Start an instance whose ID is 1.
    1
    ./android_kbox_aosp15.sh start kbox:origin  1
    
    • During the container startup, errors such as "writing syncT "procError"" and "exec /system/bin/chmod: no such file" may occur. These errors do not affect the functions and can be ignored.
    • When a container is started, the specified ${index1} corresponds to ports bound to the container. For example, index1=10 indicates that the container uses ports 8010 and 8510. Ensure that the corresponding ports are not occupied.
    • You can run the following command to query the Kbox kernel dynamic switch status:
      1
      cat /sys/kernel/kbox/kbox_enable
      

      If 1 is displayed, the switch is enabled. If 0 is displayed, the switch is disabled.

      You can run the following command to manually enable the switch:
      1
      echo 1 > /sys/kernel/kbox/kbox_enable
      
  4. Run the following command to check whether a Kbox container is started successfully. ${index} indicates the ID of the instance.
    1
    docker exec -it kbox_${index} getprop | grep boot_completed
    

    In the output, if the value of sys.boot_completed is 1, the startup is successful.

  5. Optional: Stop and delete a Kbox container.

    In the Kbox solution, data volumes are mounted by default. The default docker stop and docker rm commands cannot completely clear container data. Run the following script to completely clear files on the host.

    Run the android_kbox_aosp15.sh script to stop and delete a running Kbox container.

    Stop and delete a container whose ID is ${index}.
    1
    ./android_kbox_aosp15.sh delete ${index}
    
  6. Optional: Restart Kbox containers.

    In the Kbox solution, data volumes are mounted by default. The default docker restart command cannot restart a container. Instead, run the following script to restart a container.

    Run the android_kbox_aosp15.sh script to restart a Kbox container.

    Restart a container whose ID is ${index}.
    1
    ./android_kbox_aosp15.sh restart ${index}