Rate This Document
Findability
Accuracy
Completeness
Readability

Starting and Uninstalling a Cloud Phone

  • You can use the kbox_config.cfg file to flexibly configure the resources used by cloud phones to achieve optimal performance.
  • The kbox_config.cfg file contains configuration items such as KBOX_GPU_MAP, KBOX_MOUNT_MAP, and KBOX_CPUSET_MAP. You can change the value of the corresponding channel in the maps to select the GPU, CPU, and data volume storage path used by a container.
  • The kbox_config.cfg file exists in the startup path. 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.
  1. Decompress Kbox-AOSP11.zip and upload the deploy_scripts directory in the Kbox-AOSP11 folder to the ~/dependency directory on the server.
  2. Run the android11_kbox.sh script to start the container.
    1
    2
    3
    # cd ~/dependency/deploy_scripts
    # sudo chmod +x android11_kbox.sh
    # sudo ./android11_kbox.sh start {image_name:tag}  ${index1}  ${index2}
    

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

    Table 1 Default configurations

    Configuration 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

    The following are examples of using the startup script:

    • Start instance 1.
      1
      # sudo ./android11_kbox.sh start kbox:latest  1
      
    • Start instances 1 to 5.
      1
      # sudo ./android11_kbox.sh start kbox:latest  1 5
      
  3. Run the following commands to check whether the Kbox container is started successfully. ${index} indicates the ID of the instance.
    1
    2
    # sudo docker exec -it kbox_${index} sh
    # getprop | grep boot
    

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

  4. Stop and delete Kbox containers.

    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 android11_kbox.sh script to stop and delete a running Kbox container.

    • Stop and delete the container whose ID is ${index}.
      1
      # sudo ./android11_kbox.sh delete ${index}
      
    • Stop and delete all the containers numbered from ${index1} to ${index2}.
      1
      # sudo ./android11_kbox.sh delete ${index1} ${index2}
      
  5. 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 android11_kbox.sh script to restart Kbox containers.

    • Restart the container numbered ${index}.
      1
      # sudo ./android11_kbox.sh restart ${index}
      
    • Restart all the containers numbered from ${index1} to ${index2}.
      1
      # sudo ./android11_kbox.sh restart ${index1} ${index2}