make KVM share directory with host using 9p

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

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

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

fill the source path and target path boxes, eg.

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

Then click apply to finish.

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

Note:

  • 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

转载于:https://my.oschina.net/u/2475751/blog/812845

你可能感兴趣的:(make KVM share directory with host using 9p)