Skip to content

Instantly share code, notes, and snippets.

@stuaxo
Last active August 10, 2023 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuaxo/756f20dd28d135e64fc8a1a17a9a8257 to your computer and use it in GitHub Desktop.
Save stuaxo/756f20dd28d135e64fc8a1a17a9a8257 to your computer and use it in GitHub Desktop.
Ubuntu VM in a Mac Host [QEmu with UTM frontend]

Ubuntu in QEmu via UTM on a Mac

UTM is available from the app store for £9, or here: mac.getutm.app

Look up the instructions for installing Ubuntu, install it using Qemu. I used this 22.04 image (As of 3-Aug-2023 I was NOT successful in installing, or upgrading to 23.04) https://cdimage.ubuntu.com/jammy/daily-live/current/jammy-desktop-arm64.iso

UTM settings:

Graphics:

Settings/Display: [x] Angle with Metal

Qemu VM settings:

Graphics:

CPU:

CPU: Forced SMP, set 4 cores RAM: 8gm

Inside the VM:

Guest tools in qemu more info https://docs.getutm.app/guest-support/linux/

Qemu guest agent (time sync, etc):

$ sudo apt install qemu-guest-agent

Spice agent (dynamic display, clipboard):

$ sudo apt install spice-vdagent

File Sharing: In UTM/QEmu: Choose VirtFS.

In the guest: Create a mount point, e.g. /media/share

$ sudo mount -t 9p -o trans=virtio share /media/share -oversion=9p2000.L

How to mount the shared filesystem on boot:

Add an entry to /etc/fstab:

share /media/share 9p trans=virtio,version=9p2000.L,rw,_netdev,nofail 0 0

Enable the 9p module on boot by creating a file: /etc/modules-load.d/9pnet_virtio.conf With this content: 9pnet_virtio

Networking and the VPN:

Network Mode: Emulated VLAN enables the host VPN to work from the guest.

Mouse Wheel:

If the "natural scrolling" setting doesn't match the Mac the wheel will scroll in opposite vertical direction, find the setting here:

Settings/Mouse & Touch Pad [x] Natural Scrolling

Firefox: Doesn't work initially, works once the snap is updated.

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