You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guest-support/linux.md
+44-12Lines changed: 44 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,37 +95,69 @@ $ sudo pacman -S phodav
95
95
## VirtFS
96
96
VirtFS enables [QEMU directory sharing]({% link settings-qemu/sharing.md %}#virtfs) as an alternative to SPICE WebDAV.
97
97
98
-
After making sure your Linux installation [supports 9pfs](#drivers), you can mount the share with the following command:
98
+
After making sure your Linux installation [supports 9pfs](#drivers), you can automatically mount the share by adding the following entry to your `/etc/fstab`:
Where `[mount point]` is the desired destination path. For example: `/media/share`.
105
+
_Note_: `share` is the name UTM uses for the VirtIO device and you should not change it. You can replace `/mnt/utm` with a different folder if you like.
106
106
107
-
You can also modify `/etc/fstab`and add the following line to automatically mount the share on startup:
107
+
After updating `/etc/fstab`you need to create an empty folder for the mount:
You can apply the changes to `/etc/fstab` with the following commands (this will automatically happen on reboot as well):
114
+
115
+
```sh
116
+
systemctl daemon-reload
117
+
systemctl restart network-fs.target
118
+
systemctl list-units --type=mount
111
119
```
112
120
121
+
A systemd `.mount` unit for `/mnt/utm` should now be displayed in the list, and you can access the contents of your shared folder.
122
+
113
123
### Fixing permission errors
114
-
You may notice that accessing the mount point fails with "access denied" unless you're the root user. This is because by default the directory inherits the UID/GID from macOS/iOS which has a different numbering scheme. You can fix the error with the following command:
124
+
You may notice that accessing the mount point fails with "access denied" unless you're the root user. This is because by default the directory inherits the UID/GID from macOS/iOS which has a different numbering scheme.
125
+
126
+
To fix this we are going to use [`bindfs`](https://bindfs.org/) to create a mount in the user's home directory that we can access normally. You have to first install `bindfs` with your system's package manager.
127
+
128
+
The first step is to get the UID and GID used by the host:
115
129
116
130
```
117
-
$ sudo chown -R $USER [mount point]
131
+
$ ls -na /mnt/utm
132
+
total 8
133
+
drwxr-xr-x 4 502 20 128 Feb 22 15:52 .
134
+
drwxr-xr-x 3 0 0 4096 Feb 22 14:50 ..
135
+
-rw-r--r-- 1 502 20 13 Feb 22 15:52 shared-file.txt
118
136
```
119
137
120
-
This will not change the permissions on your host system but will store the guest ownership in a file attribute.
138
+
In this case the UID for the host is `502` and the GID is `20`. You have to do the same for the guest user (usually UID `1000` and GID `1000`). Additionally, create an empty folder for the `bindfs` mount in the home directory:
121
139
122
-
Alternatively, you can install `bindfs` and use the following `/etc/fstab` instead:
140
+
```sh
141
+
mkdir /home/user/utm
142
+
```
143
+
144
+
_Note_: In this example the username is `user`, you might have to adjust this to match your configuration.
_Note_: This will not change the permissions on your host system, but it will add a custom `user.virtfs` file attributes to every file to store the guest ownership. It is not recommended to do this if you want to share your host's home folder for instance.
160
+
129
161
## **macOS**{: .label .label-green } VirtioFS
130
162
When using Apple Virtualization backend, [directory sharing]({% link settings-apple/sharing.md %}) is enabled through VirtioFS.
0 commit comments