For QEMU/KVM, how to share data between host and guest

General question for developers to access data between VM and VMM.

As I know, paravirtualization solution is a good way to share data for VM and VMM since it has better performance.

Please use Virtio 9p solution for QEMU/KVM. Note that you need to load 9p related modules for guest kernel.

Add following in your virsh start xml file.

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

After start guest OS, run following command

# mount testlabel /mnt/ -t 9p -o trans=virtio


Leave a Reply

Your email address will not be published. Required fields are marked *