How to set folder permissions for a kvm 9p filesystem share?
Asked Answered
B

0

7

I have a virtual machine setup through virt-manager, and I am trying to give the vm access to a folder on the host system.

I added a Filesystem, and I can read from the host directly but I cannot write to it.

<filesystem type='mount' accessmode='passthrough'>
 <source dir='/opt/test'/>
 <target dir='testlabel'/>
</filesystem>

It is mounted on boot from fstab using,

testlabel /opt/test            9p             trans=virtio    0       0

The folder on the host system is owned by my user on the host system, and I cannot change ownership to the user in the guest system because that user doesn't exist on the host.

tl;dr Aside from setting the folder permission to 777, how can I setup the folder permissions to allow read/write access for the guest vm user?

Badoglio answered 9/4, 2016 at 0:50 Comment(2)
This isn't really an answer to your question, but after scouring the internet for clues, I decided I'm going to go with a sshfs to the vm host. It's not nice, but it seems better than running a chown/chmod on cron.Loge
See these serverfault questions, it doesn't look like there is a direct solution to this problem: serverfault.com/questions/394645/… / serverfault.com/questions/342801/… / serverfault.com/questions/559726/…Bazemore

© 2022 - 2024 — McMap. All rights reserved.