
I was surprised that with so many software developers using MacBooks everyday, nobody has created a guide on how to use libvirt and QEMU with macOS. Today I will be showing the opposite, virtualizing Linux on macOS using the same tools.

If you want to create multiple VMs, create an XML file for each machine with a unique UUID, VM name, and VNC port. port 443 from the VM to port 8443 locally, run the following: ssh -p 2222 -L8443:localhost:443 VMs To force shutdown, run virsh destroy ubuntu. Once it restarts you can connect to the VM from your terminal by running ssh -p 2222 send a shutdown signal to your VM, run virsh shutdown ubuntu. Install Ubuntu Server normally, making sure to enable the SSH server. Select Boot Manager, then boot the install image. If you don't see the installation screen, or possibly reinstalling, click the Ctrl+Alt+Del button to reboot the machine, and quickly press Esc to get into the OVMF menu.

Start RealVNC Viewer and connect to localhost. Qemu-img create -f qcow2 ubuntu.qcow2 50gĭownload the ARM Ubuntu Server 20.04 Install Image and my ARM libvirt XML template and place the. Change 50g to the size of your prefered disk: mkdir ~/vms & cd ~/vms The rest of this guide uses VNC.Ĭreate a vms folder in your home directory, and generate a disk image.

The VNC client is responsive and quick to install, but if you have multiple VMs you need to manually manage the different ports. There are two ways to access the virtual display of the VM, either using a VNC client or the virt-viewer program.
