Do you need to set up a shared folder between your host OS and guests running in virt-manager? I will show you how to do it on your Fedora system which involves a SELinux policy change.
First of all, if you don’t have it already, install virt-manager and create a virtualized guest which should be pretty straightforward. Afterwards create a future share folder on your host and set up the permissions (for the purpose of this article I will grand all permissions):
Afterwards shut down the guest if it’s running and attach the new filesystem in virt-manager:
- Switch the view to detail hardware view: View > Details
- Go to Attach hardware > Filesystem
- Fill in the name of the source path (/share in our case) and virtual target path (anything you like, I will go with /sharepoint)
- Switch mode to Mapped if you need to have write access from the guest
- Confirm and start the VM again
Now you can mount your shared folder from the VM:
Or permanently add it to /etc/fstab file:
If you don’t have SELinux enabled everything should work now. If you do (which I recommend), you will need to add a policy for files under your /share folder on your host. SELinux won’t allow you to share this folder until it’s labeled svirt_image_t. Here is how to add this policy on your host using semanage:
That should be it. If not, check the logs :).
Hi. Great Info, that’ what I wass looking for, however while mounting the external share my Centos guest claims: “Unknown filesystem type 9p”. What do you suggest?
Thanks :)