Skip to content

Latest commit

 

History

History
59 lines (45 loc) · 1.93 KB

working-with-arm-ubuntu-cloudimg.md

File metadata and controls

59 lines (45 loc) · 1.93 KB

Docs

Cloudimg base

http://cloud-images.ubuntu.com/focal/current/

Installing cloud utils (for booting cloud disk image)

sudo apt-get install cloud-utils

Creating a cloud config file

Creating a cloud.txt file with the following content,

#cloud-config
users:
  - name: ubuntu
    ssh-authorized-keys:
      - ssh-rsa AAABBBCCCASDWOIQUOUOIUDOSA... <- this key will be used for ssh-ing
    sudo: ['ALL=(ALL) NOPASSWD:ALL']
    groups: sudo
    shell: /bin/bash

Bringing up QEMU

sudo apt-get install qemu-system-arm qemu-efi
dd if=/dev/zero of=flash0.img bs=1M count=64
dd if=/usr/share/qemu-efi/QEMU_EFI.fd of=flash0.img conv=notrunc
dd if=/dev/zero of=flash1.img bs=1M count=64
wget http://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-arm64.img
qemu-img convert focal-server-cloudimg-arm64.img -O raw ./aarch64-ubuntu.raw
qemu-system-aarch64 -m 4096 -smp 2 -cpu cortex-a57 -M virt -nographic -pflash flash0.img -pflash flash1.img \
                    -drive if=none,file=aarch64-ubuntu.img,id=hd0 -device virtio-blk-device,drive=hd0 \
                    -drive if=none,id=cloud,file=cloud.img,format=raw -device virtio-blk-device,drive=cloud \
                    -netdev user,id=user0 -device virtio-net-device,netdev=eth0 \
                    -netdev user,id=eth0,hostfwd=tcp::5556-:22

Modifying the disk image

Login to guest,

ssh -p 5556 ubuntu@localhost

On guest,

sudo touch /etc/cloud/cloud-init.disabled