SergeHallyn_libvirt9p

9p fs access in libvirt

Let's say we want to mount /home/ubuntu on the host, in the VM. In the VMs xml, add something like:

   <filesystem type='mount' accessmode='passthrough'>
      <source dir='/home/ubuntu'/>
      <target dir='hostmnt'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
    </filesystem>

To make it readonly, add '<readonly>'

Now in the VM, you can mount it as:

sudo mount -t 9p hostmnt /mnt

and find the contents under /mnt.

SergeHallyn_libvirt9p (last edited 2014-11-13 22:08:31 by serge-hallyn)