Booting Ubuntu 16.04 Cloud images on Arm64__ubuntu

Source: Internet
Author: User
For testing Kvm/qemu, prebaked images cloud images nice. However, there is a few steps to get started. We need a recent Qemu (2.5 is good enough). An EFI firmware are needed, and cloud-utils, for customizing our VM.
sudo apt install-y qemu qemu-utils cloud-utils
wget https://releases.linaro.org/components/kernel/uefi-linaro/ 15.12/RELEASE/QEMU64/QEMU_EFI.FD
wget https://cloud-images.ubuntu.com/xenial/current/ Xenial-server-cloudimg-arm64-uefi1.img
Cloud images are Plain-there is no user setup, no default USER/PW combo, so to log in to the image, we need to customize The image on the A-boot. The defacto tool is cloud-init. The simplest method for using Cloud-init is passing a blocks media with a settings file-of course to real Cloud Deployme NT, would use one of the fancy network based initialization protocols cloud-init. Enter the following to a file, say Cloud.txt:
#cloud-config

Users:
  -name:you
    ssh-authorized-keys:
      -Ssh-rsa aaaab3nz ....
    sudo: [' all= (All) Nopasswd:all ']
    groups:sudo
    Shell:/bin/bash
This minimal config would just set you a user with SSH key. A more complex setup can install packages, write files and run arbitrary commands on the In professional setups, your would most likely end-using cloud-init only to start ansible or another configuration Gement tool.
Cloud-localds cloud.img cloud.txt
qemu-system-aarch64-smp 2-m 1024-m virt-bios qemu_efi.fd-nographic \
       -devic e virtio-blk-device,drive=image \
       -drive if=none,id=image,file=xenial-server-cloudimg-arm64-uefi1.img \
       -device virtio-blk-device,drive=cloud \
       -drive if=none,id=cloud,file=cloud.img \
       -netdev User,id=user0- Device Virtio-net-device,netdev=user0-redir tcp:2222::22 \
       -ENABLE-KVM-CPU Host 
If you are are on a X86 host and want to use QEMU to run a aarch64 image, replace the last line with "-cpu cortex-a57". Now, since the "example uses user networking with TCP port redirect," can ssh into the VM:
Ssh-p 2222 you@localhost
Welcome to Ubuntu 16.04 LTS (gnu/linux 4.4.0-22-generic) ...
.
Http://suihkulokki.blogspot.com/2016/05/booting-ubuntu-1604-cloud-images-on.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.