在Android系统的容器上安装Ubuntu

安装Ubuntu

注意: Ubuntu on container 默认已安装在 Edge 2 / Edge 2 Kit 的 Android 系统中。 如果您从 SDK 编译 Android 系统并且您的系统不包含容器上的 Ubuntu,您可以按照以下步骤手动安装 Ubuntu 和容器。

下面介绍在 Edge 2 / Edge 2 Kit 上安装 Ubuntu 的分步方法。

步骤 1: 准备环境

  • Download the Ubuntu Image here.
  • The user may need to set up a computer that runs Ubuntu or any other alternate Linux system.
  • If required, you may alter the system’s DNS by editing the /etc/resolv.conf file.
  • The Ubuntu image used in Android is the official version and it only contains SSH tools.

Optional: If you want additional tools, you must manually install them. The following is an example of vim installation:

sudo apt update
sudo apt install vim -y

步骤 2: 登录到安卓系统

  • Use the following command to install the adb tool on your computer:

    sudo apt install android-tools-adb
    
  • Power on the Edge 2 board via DC port input, and connect the USB-C port of the board to USB-A port of the computer via USB cable.

  • Log in to the Android system on your computer using the following command:

    adb shell
    

步骤 3: 在安卓上安装Ubuntu镜像

  • Execute the following command on your computer to copy the Ubuntu image to the Android system:

    adb push arm64v8-ubuntu-ssh.zip /sdcard
    

    Note: You need to input the correct path of the Ubuntu image where it is placed.

  • Execute the following command in Android system (via adb tool) to install the Ubuntu image to the Android system folder:

    cd /sdcard
    su
    naos_cli install arm64v8-ubuntu-ssh.zip
    
  • Boot the installed Ubuntu system by executing the following command in Android system (via adb tools):

    naos_cli start com.hubware.ubuntu
    naos_cli list
    

    If you can see the information in the screenshot below, the Ubuntu system in Android is running successfully.

run_successfully

步骤 4: 测试SSH登录到Ubuntu系统

  • Check the IP address of Edge 2 board by executing the following command in Android system (via adb tool):

    ifconfig eth0
    
  • Log in to Ubuntu running on Android Using SSH on your computer

    ssh root@x.x.x.x
    

    Note: x.x.x.x represents the IP address of the Edge 2 board, and the login password is root.

    If the SSH login is fail, you have to restart the container and try the SSH login again.