Monday, April 3, 2023

How to create a Arm64 Ubuntu virtual machine using Virt-Manager

I wanted to run Ubuntu on an Arm64/Aarch64 virtual machine on a host Intel Linux computer for the longest time for compiling binaries for Raspberry Pis and other SBC boards. I finally figured out how to do it with virt-manager, and it is quite simple as clicking and selecting options on the virt-manager graphical user interface. The instructions below show how it is done.

Download and install prerequisites

  1. In Ubuntu, open up a Terminal and enter the following commands to install the prerequisite software.

    $ sudo apt install qemu-kvm \
    libvirt-daemon-system \
    libvirt-clients \
    bridge-utils \
    virt-manager \
    qemu-system-arm \
    qemu-efi-aarch64 \
    qemu-utils
    

  2. Open up an Internet browser. Download an Ubuntu Arm64 image to install. For example: https://cdimage.ubuntu.com/releases/22.04/release/ubuntu-22.04.2-live-server-arm64.iso

 Create the virtual machine

  1. In Ubuntu, click the Virtual Machine Manager icon.

    The Virtual Machine Manager application appears.


  2. Select File | Create New Virtual Machine.

    The New VM dialog box pops up.


  3. Choose Local install media (ISO image or CDROM).

  4. In the Architecture options, choose aarch64 architecture. Click Forward.

    Step 2 of 5 pages appears.

  5. In the Choose ISO or CDROM install media field, choose the iso image downloaded previously.



  6. Click Forward. If necessary, change the memory size and the number of CPUs.

    Step 3 of 5 pages appear.


  7. Click Forward. If necessary, change the disk image size to a suitable size.

    Step 4 of 5 appears.


  8. Click Forward.

    Step 5 of 5 appears.


  9. Optional. In the Name field, type in a desired name.

  10. Toggle On the Customize configuration before install field.




  11. Click Finish.

    The 'vm name' on QEMU/KVM dialog box appears.



  12. In the Hypervisor Details group, change the Firmware to UEFI aarch64.


  13. Click Apply. Then click the Begin Installation button and follow the prompts to complete the installation.

    The installation begins...