This post records the steps that in “utm“ how to make a Linux guest running on a Mac host be able to access the shared directory.
Host setup
First we need to enable the shared directory feature on host. Open the “utm” app, select the target guest VM and open the “Edit selected VM” dialog(the “upper-right” button). In the “Sharing” section, select the “SPICE WebDAV” item in the “Directory Share Mode” field, and the shared directory in the “Path” field, then “Save”.
Guest setup
1. Install the required packages first
1 | # When installing "davfs2", it asked whether you want to mount by non-root user, |
2. Create the target directory
1 | mkdir /home/auser/exchange |
Update the “/etc/fstab” file by adding the following content.
1 | http://127.0.0.1:9843 /home/auser/exchange davfs rw,user,uid=auser,noauto 0 0 |
3. Mount
1 | # Restart service to reload "/etc/fstab". |
After that, everytime the system is started, you can run “mount /home/auser/exchange” to mount the shared directory.