Hide Forgot
Description of problem: Set up f20 guest Set up Filesystem in virt-manager as per various: http://www.linux-kvm.org/page/9p_virtio http://www.linux-kvm.org/page/VirtFS https://troglobit.github.io/blog/2013/07/05/file-system-pass-through-in-kvm-slash-qemu-slash-libvirt/ http://docs.slackware.com/howtos:general_admin:kvm_libvirt#shared_folders_using_virtfs Version-Release number of selected component (if applicable): qemu-2.3.1-12.fc22.x86_64 How reproducible: Always Steps to Reproduce: 1. Follow various instructions as above 2. Fails 3. Actual results: $ sudo mount -t 9p -o trans=virtio,version=9p2000.L,rw /home/readlegal/Home /home/readlegal/Home [readlegal@localhost ~]$ ls Desktop Downloads Home [readlegal@localhost ~]$ ls ./Home ls: cannot open directory ./Home: Permission denied [readlegal@localhost ~]$ sudo ls ./Home ls: cannot open directory ./Home: Permission denied [readlegal@localhost ~]$ su - Password: Last login: Mon Mar 14 14:38:04 GMT 2016 on pts/0 [root@localhost ~]# ls /home/readlegal/Home ls: cannot open directory /home/readlegal/Home: Permission denied [root@localhost ~]# Expected results: Able to use host file system, no permission denials Additional info:
Works for me with F23 host and F22 guest. Please provide the qemu commandline or libvirt XML you are using. Here's my filesystem libvirt XML: <filesystem type='mount' accessmode='mapped'> <source dir='/mnt/data/devel/images'/> <target dir='colepath'/> </filesystem> Then inside the VM I do: # mount -t 9p colepath /mnt # ls /mnt ... And it all seems to work
Thanks Cole Here's what I had - I'll now start changing things to look more like yours. libvert XML from /etc/libvirt/qemu/fedora20.xml <filesystem type='mount' accessmode='mapped'> <driver type='path'/> <source dir='/home/readlegal'/> <target dir='/home/readlegal/Home'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/> </filesystem> Inside fedora20 I've been doing, and done:- $ sudo mount -t 9p -o trans=virtio,version=9p2000.L,rw /home/readlegal/Home /home/readlegal/Home Via Nautilus: The ~/Home directory icon shows as a mounted drive and under ‘Devices’ it is listed as a drive with a ‘unmount/ eject’ icon beside it, but when access the drive via Nautilus I get an error- This location could not be displayed. You do not have the permissions necessary to view the contents of “Home”. Via gnome-terminal: [root@localhost ~]# cd /home/readlegal/Home [root@localhost Home]# ls ls: cannot open directory .: Permission denied [root@localhost Home]# logout [readlegal@localhost ~]$ cd /home/readlegal/Home [readlegal@localhost Home]$ ls ls: cannot open directory .: Permission denied [readlegal@localhost Home]$ Then, trying to unmount via Nautilus ‘unmount/ eject’ icon: I get an error- Unable to unmount Home umount: /home/readlegal/Home: umount failed: Operation not permitted Via gnome-terminal: [readlegal@localhost ~]$ umount /home/readlegal/Home umount: /home/readlegal/Home: umount failed: Operation not permitted [readlegal@localhost ~]$ su - Password: Last login: Sat Mar 26 08:11:57 GMT 2016 on pts/0 [root@localhost ~]# umount /home/readlegal/Home [root@localhost ~]# ls /home/readlegal/Home TestFolder [root@localhost ~]# Unmounting via a root terminal seems to have succeeded with the the drive icon disappearing from the list under Devices but the directory in Nautilus not returning to a standard directory (folder) icon mount -t 9p colepath /mnt Following the above scheme with: [root@localhost ~]# mount -t 9p /home/readlegal/Home /home/readlegal/Home I get exactly the same results I'll try playing with the XML
OK, now libvert XML from /etc/libvirt/qemu/fedora20.xml says: <filesystem type='mount' accessmode='mapped'> <source dir='/home/readlegal'/> <target dir='/home/readlegal/Home'/> </filesystem> Hmm, interestingley, when I edit fedora20.xml as above, it gets set back to: <filesystem type='mount' accessmode='mapped'> <source dir='/home/readlegal'/> <target dir='/home/readlegal/Home'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </filesystem> By the time I view it with: # less fedora20.xm And, the following the above changes, I get: [root@localhost ~]# ls /home/readlegal/Home TestFolder [root@localhost ~]# mount -t 9p /home/readlegal/Home /home/readlegal/Home [root@localhost ~]# ls /home/readlegal/Home ls: cannot open directory /home/readlegal/Home: Permission denied [root@localhost ~]# umount /home/readlegal/Home [root@localhost ~]# mount -t 9p -o trans=virtio,version=9p2000.L,rw /home/readlegal/Home /home/readlegal/Home [root@localhost ~]# ls /home/readlegal/Home ls: cannot open directory /home/readlegal/Home: Permission denied [root@localhost ~]# umount /home/readlegal/Home [root@localhost ~]# ls /home/readlegal/Home TestFolder [root@localhost ~]# So, there doesn't seem to be any change - and VirtFS seems broken for me. I'm not sure what would be different between my set up and yours. I've only instaled f22 since the New Year
You aren't supposed to edit XML directly in /etc/libvirt, use 'virsh edit' instead: http://wiki.libvirt.org/page/FAQ#Where_are_VM_config_files_stored.3F_How_do_I_edit_a_VM.27s_XML_config.3F Make sure you stop and start the VM inbetween Are you getting any selinux errors on the host machine? Maybe see if there's any error messages in /var/log/libvirt/qemu/$vmname.log Also the use for F20 guest means it could be a guest issue, I tested with F22 guest. And the 'mount' command I used was different from yours
No response, so closing as DEFERRED. If you are still having issues, please provide the info requested in Comment 4