• Bare Metal Server

bms
  1. Help Center
  2. Bare Metal Server
  3. Private Image Creation Guide (BMS)
  4. Creating a Linux Image
  5. Installing Cloud-Init
  6. Ubuntu 16.04

Ubuntu 16.04

For the x86 image, perform the first four steps. For the ARM 64 image, run the apt install cloud-init command and skip the step 1 to step 4.

  1. Configure the apt source.

    If the VM needs to access the Internet through a proxy, configure the apt proxy. Otherwise, skip this step.

    Run the following commands:

    cd /etc/apt/

    vim apt.conf

    Modify the file and change the proxy IP address and port.

      Acquire::http::Proxy "http://191.200.5.88:3128";
      ~
      ~
      ~
  2. Run the apt update command.

    If information shown in the preceding figure is displayed, the network connection is unstable. Run the apt update command again until no exceptions occur.

    Run the apt-get install cloud-init command.

  3. If the update fails and information shown in the following figure is displayed, manually download the apt source.

    Download cloud-init_17.1-18-gd4f70470-0ubuntu1_all.deb (the version is only for reference) at https://packages.ubuntu.com/.

    Upload the package to the VM, enter the directory where the package is stored, and run the following command:

    dpkg -i cloud-init_17.1-18-gd4f70470-0ubuntu1_all.deb

    The following command output is displayed.

    If some dependent packages are unavailable as shown in the preceding figure, download and install the following required packages as prompted (version numbers and the number of packages are only for reference):

    python3-blinker_1.3.dfsg2-1build1_all.deb

    python3-cffi-backend_1.5.2-1ubuntu1_amd64.deb

    python3-configobj_5.0.6-2_all.deb

    python3-cryptography_1.2.3-1ubuntu0.1_amd64.deb

    python3-idna_2.0-3_all.deb

    python3-jinja2_2.8-1_all.deb

    python3-jsonpatch_1.19-3_all.deb

    python3-json-pointer_1.9-3_all.deb

    python3-jsonschema_2.5.1-4_all.deb

    python3-jwt_1.3.0-1_all.deb

    python3-markupsafe_0.23-2build2_amd64.deb

    python3-oauthlib_1.0.3-1_all.deb

    python3-pyasn1_0.1.9-1_all.deb

    python3-serial_3.0.1-1_all.deb

    python3-requests_2.9.1-3_all.deb

    python3-urllib3_1.13.1-2_all.deb

    libyaml-0-2_0.1.6-3_amd64.deb

    python3-yaml_3.11-3build1_amd64.deb

    After installing the packages, run the apt-get update command to update the apt source. Then you can download software packages by running the apt-get install command.

  4. Install the python3-six package although no prompt is displayed. Download the following package:

    apt-get install python3-six

  5. Run the cloud-init -v command. If the output is cloud-init 17.1, the installation is complete.
  6. Install the SSH service.

    For the x86 image, run the following commands:

    apt-get install openssh-client

    apt-get install openssh-server

    For the ARM 64 image, run the following commands:

    apt install openssh-client

    apt install openssh-server

  7. Install the dkms tool.

    To prevent any SDI driver exceptions, run the apt-get install dkms command to install the dkms tool online.

    After installation, run the vi /usr/sbin/dkms command. Press Shift+: to enter the CLI, enter 283, and press Enter to go to the 283th row, and change it to the following:

    invoke_command "$mkinitrd -f $initrd_dir/$initrd $1" "$mkinitrd" background