我正尝试使用virsh和domain xml从ubuntu 16.04 LTS主机启动Centos 7 guest。 我在域xml中使用的“文件系统”节点如下所示:
<filesystem type='mount' accessmode='passthrough'> <driver type='path' wrpolicy='immediate'/> <source dir='/opt/test'/> <target dir='testlabel'/> </filesystem>
通过上面的configuration,“testlabel”在guest虚拟机中是不可见的,因此我无法安装它。 有什么我失踪?
我试图在客户中使用9p模块,但他们似乎并没有随时可用于centos 7。 需要内核重新编译[现在尝试]。 我了解到,virtio-vsock将来将可用。 所以,现在不是一个select。
我不想使用基于networking的文件共享,如SSHFS,NFS或glusterfs。
有没有其他的文件系统驱动程序,可以使用libvirt的domain xml的“filesystem”选项?
根据libvirt的文档 ,你可能只需要调整你的target 。
文档提供了以下示例:
<filesystem type='mount' accessmode='passthrough'> <driver type='path' wrpolicy='immediate'/> <source dir='/export/to/guest'/> <target dir='/import/from/host'/> <readonly/> </filesystem> <filesystem type='file' accessmode='passthrough'> <driver name='loop' type='raw'/> <driver type='path' wrpolicy='immediate'/> <source file='/export/to/guest.img'/> <target dir='/import/from/host'/> <readonly/> </filesystem>
这似乎工作,而不需要9P。
但是,对于centos来说,实际上有一个随时可用的9p帮手:
Available Packages Name : nfs-ganesha-mount-9P Arch : x86_64 Version : 2.3.2 Release : 1.el7 Size : 11 k Repo : epel/x86_64 Summary : a 9p mount helper URL : https://github.com/nfs-ganesha/nfs-ganesha/wiki Licence : LGPLv3+ Description : This package contains the mount.9P script that clients can use : to simplify mounting to NFS-GANESHA. This is a 9p mount helper.
此时,9p是libvirt和KVM支持的唯一文件系统共享选项。 不幸的是,9p支持在CentOS中被禁用,因为它已经在很大程度上没有维护上游多年,包含一些安全漏洞 – 只是在过去的几个月里,一个新的9p维护者开始清理这个工作。 如果你重新编译centos内核,或者自己构build9p模块,应该可以使其工作。
直到带有NFS支持的virtio-vsock出现之前,没有其他非networking的选项可以使用。