https://www.packet.com/developers/guides/kvm-and-libvirt/
https://www.collabora.com/news-and-blog/blog/2017/06/20/debian-armhf-vm-on-arm64-server/
https://opennodecloud.com/opennode-os/2013/01/01/howto-kvm-guest-install.html
https://wiki.libvirt.org/page/Virtio
https://cateee.net/lkddb/web-lkddb/ARM_LPAE.html
https://translatedcode.wordpress.com/2016/11/03/installing-debian-on-qemus-32-bit-arm-virt-board/
https://www.cyberciti.biz/faq/linux-kvm-libvirt-dnsmasq-dhcp-static-ip-address-configuration-for-guest-os/



apt update
apt install qemu-efi-aarch64 qemu-efi-arm virt-install qemu-kvm virtinst libguestfs-tools

mkdir -p /scratch/armhf/images/netboot /srv/armhf-vm-boot
cd /scratch/armhf/images/netboot
wget http://ports.ubuntu.com/ubuntu-ports/dists/bionic/main/installer-armhf/current/images/generic-lpae/netboot/initrd.gz
wget http://ports.ubuntu.com/ubuntu-ports/dists/bionic/main/installer-armhf/current/images/generic-lpae/netboot/vmlinuz


virt-install --name builder-ubuntu-arm64v8-1 \
  --virt-type kvm \
  --boot uefi \
  --ram 16384 \
  --disk path=/var/lib/libvirt/images/builder-ubuntu-arm64v8-1.img,size=16 \
  --vcpus 4 \
  --os-type linux \
  --os-variant ubuntu18.04 \
  --graphics none \
  --network network=default \
  --console pty,target_type=serial \
  --extra-args 'console=ttyAMA0,115200n8 serial' \
  --location http://ports.ubuntu.com/ubuntu-ports/dists/bionic/main/installer-arm64/ \
  --dry-run


virsh
list --all
undefine <name>
shutdown <name>
destroy <name>



https://github.com/samueldr/nixpkgs/commits/wip/armv7l-iso

virt-install --name builder-ubuntu-arm32v7-1 \
  --virt-type kvm \
  --arch armv7l \
  --ram 16384 \
  --disk path=/var/lib/libvirt/images/builder-ubuntu-arm32v7-1.img,size=16,bus=virtio \
  --filesystem /srv/armhf-vm-boot,virtio-boot,mode=mapped \
  --vcpus 4 \
  --os-type linux \
  --os-variant ubuntu18.04 \
  --graphics none \
  --network network=default \
  --console pty,target_type=serial \
  --boot=kernel=/scratch/armhf/images/netboot/vmlinuz,initrd=/scratch/armhf/images/netboot/initrd.gz,kernel_args="console=ttyAMA0,115200n8 serial" \
  --dry-run

virsh destroy builder-ubuntu-arm32v7-1
cp /usr/share/AAVMF/AAVMF32_VARS.fd /var/lib/libvirt/qemu/nvram/builder-ubuntu-arm32v7-1_VARS.fd
virsh edit builder-ubuntu-arm32v7-1
  [Under <os> add]
    <loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF32_CODE.fd</loader>
    <nvram>/var/lib/libvirt/qemu/nvram/builder-ubuntu-arm32v7-1_VARS.fd</nvram>

virsh start builder-ubuntu-arm32v7-1 && virsh console builder-ubuntu-arm32v7-1


virsh destroy builder-ubuntu-arm32v7-1
export VM_DISK=/var/lib/libvirt/images/builder-ubuntu-arm32v7-1.img
virt-filesystems -a $VM_DISK
virt-ls -a $VM_DISK /boot/
virt-copy-out -a $VM_DISK /boot/initrd.img-4.15.0-45-generic-lpae /boot/vmlinuz-4.15.0-45-generic-lpae /srv/armhf-vm-boot/

virsh edit builder-ubuntu-arm32v7-1
	[Setup for the following]
    <kernel>/srv/armhf-vm-boot/vmlinuz-4.15.0-45-generic-lpae</kernel>
    <initrd>/srv/armhf-vm-boot/initrd.img-4.15.0-45-generic-lpae</initrd>
    <cmdline>console=ttyAMA0,115200n8 serial root=/dev/vda1</cmdline>

virsh start builder-ubuntu-arm32v7-1
