make KVM share directory with host using 9p

  1. use virt-manager to specify which directory you want to share with guest

double click on the guest -> show virtual hardware details -> filesystems:linux

fill the source path and target path boxes, eg.app

source path = /home/user/linux
target path = /mnt/linux

Then click apply to finish.spa

  1. log into the guest and execute the following cmds:
mount -t 9p -o trans=virtio /mnt/linux/ /mnt/linux/

Note:code

  • target path is transparent for end users, that is said, it acts like a block device exported from source path
  • fstab entry
/mnt/linux /mnt/linux 9p trans=virtio 0 0
相關文章
相關標籤/搜索