Skip to content

Instantly share code, notes, and snippets.

@yen3
Last active March 10, 2023 08:05
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save yen3/884bf14ec8286df35de67953a561eee8 to your computer and use it in GitHub Desktop.
Save yen3/884bf14ec8286df35de67953a561eee8 to your computer and use it in GitHub Desktop.
aarch64 virt-install commands
#!/bin/bash
rm -rf /home/yen3/ubuntu.qcow2
qemu-img create -f qcow2 /home/yen3/ubuntu.qcow2 10G
virsh undefine ubuntu1604arm64 --nvram
install_from_localtion() {
virt-install -n ubuntu1604arm64 --memory 1024 --arch aarch64 --vcpus 1 \
--disk /home/yen3/ubuntu.qcow2,device=disk,bus=virtio \
--os-type=linux \
--nographic \
--boot uefi \
--location 'http://ports.ubuntu.com/dists/xenial/main/installer-arm64/'
}
install_from_iso_vga_fedora() {
virt-install -n ubuntu1604arm64 --memory 2048 --arch aarch64 --vcpus 4 \
--disk /home/yen3/ubuntu.qcow2,device=disk,bus=virtio \
--os-type=generic \
--boot uefi \
--video vga \
--graphics vnc,port=5999 \
--noautoconsole \
--noreboot \
--network bridge=docker0 \
--cdrom /home/yen3/Downloads/Fedora-Server-dvd-aarch64-27-1.6.iso
#--cdrom /home/yen3/Downloads/mini_arm64.iso
}
install_from_iso_vga_debian() {
# Fail, install through console
virt-install -n ubuntu1604arm64 --memory 2048 --arch aarch64 --vcpus 4 \
--disk /home/yen3/ubuntu.qcow2,device=disk,bus=virtio \
--os-type=generic \
--graphics vnc,port=5999 \
--noreboot \
--cdrom /home/yen3/Downloads/debian-testing-arm64-xfce-CD-1.iso
}
install_from_iso_vga_centos() {
# Fail, install through console
virt-install -n ubuntu1604arm64 --memory 2048 --arch aarch64 --vcpus 4 \
--disk /home/yen3/ubuntu.qcow2,device=disk,bus=virtio \
--os-type=generic \
--boot uefi \
--graphics vnc,port=5999 \
--noreboot \
--cdrom /home/yen3/Downloads/CentOS-7-aarch64-Everything.iso
#--cdrom /home/yen3/Downloads/CentOS-7-aarch64-NetInstall.iso
}
#install_from_localtion
#install_from_iso_vga_debian
#install_from_iso_vga_centos
install_from_iso_vga_fedora
virsh undefine centos-aarch64 --nvram || true
virt-install -n centos-aarch64 --memory 2048 --arch aarch64 --vcpus 4 \
--disk /share/Public/import_test/centos.qcow2,device=disk,bus=virtio \
--os-type=generic \
--video vga \
--boot uefi \
--graphics vnc,port=5999 \
--noautoconsole \
--noreboot \
--network bridge=br0 \
--import \
--boot loader=/usr/share/AAVMF/QEMU_EFI-pflash.raw,loader_ro=yes,loader_type=pflash,nvram=/share/Public/import_test/centos_VARS.fd
# ubuntu 18.04
sudo apt install -y qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils virt-manager
sudo apt install -y qemu-system-common qemu-efi-aarch64 qemu-system-arm
qemu-system-common qemu-efi-aarch64 libosinfo-bin -y
@Rtoax
Copy link

Rtoax commented Jun 24, 2022

Hi, i got a problem.
How to disable Secure Boot for aarch64, install VM with virt-install.

@yen3
Copy link
Author

yen3 commented Jun 24, 2022

Sorry I have no idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment