Notes on UTM
Posted on
UTM seems to be the best and easiest way to run virtual machines on MacOS (and iOS...?), and while it works great for my simple use-cases I had some trouble getting there.
- 
In order for the VM to receive a IPv4 address from UTMs internal DHCP server I had to change the network setting from
Shared NetworktoEmulated VLAN.- This option doesn't exist when using Apple Virtualization.
 - The VM does receive a IPv6 address, but no default route. Not sure if there's any internal NAT64 magic going on, but if the rest of the network isn't IPv6 capable it's just easier to change the network mode.
 
 - 
There's no option for port forwarding when using Apple Virtualization.
 - 
When creating a port forward the order of the fields are guest address, guest port, host address, host port.
- To create a local forward for SSH the guest address can be left empty, guest port is 22, host address set to 127.0.0.1 and host port to 2222. SSH to 127.0.0.1:2222 and you're connected to the VM.
 
 - 
When sharing a host folder with the VM it can be mounted using
mount -t 9p -o trans=virtio share /mnt/.- 
Or in 
/etc/fstab:share /opt/dev 9p trans=virtio 0 0
 shareis a mount tag defined by UTM.
 - 
Or in