We follow the instruction from UTM’s website here but with more visual.
Here I’m using Ubuntu 22.04 ARM version. I do not have to install or config any extra driver to support 9pfs with the default kernel.
- Before booting the VM, make sure the the Sharing setting of the video is as followed, with Path is the path to the share folder in your Mac.
2. Create a directory to mount the share drive to, you can name it anything. I have mine as $HOME/vm_shared/
3. Mount the shared directory to our guest shared directory
4. When changing directory to your mount point, you should see your shared drive. But if you have issue with “access denied”, you need to add permission to the mount point with:
$ sudo chown -R $USER [mount point]
5. Make the mounting automatic for next reboot otherwise you have to repeat the above steps at every new reboot
sudo nano /etc/fstab
Add a new line to file
share [mount point] 9p trans=virtio,version=9p2000.L,rw,_netdev,nofail 0 0
Ctrl + X to exit then Yes to save file.
And there you have it.