NFS主机配置
yum -y install net-tools
yum -y install vim
yum -y install nfs-utils
mkdir /opt/kvmshare
echo "/opt/kvmshare 192.168.35.10(rw,sync,no_root_squash)" >>/etc/exports
echo "/opt/kvmshare 192.168.35.20(rw,sync,no_root_squash)" >>/etc/exports
systemctl start rpcbind
systemctl enable rpcbind
systemctl start nfs
systemctl enable nfs
netstat -anpu | grep rpcbind
systemctl stop firewalld
systemctl disable firewalld
virt-Manager做验证(是否可以访问共享文件夹)
showmount -e 192.168.35.30
KVM做验证(是否可以访问共享文件夹)
showmount -e 192.168.35.30
在KVM上修改共享文件夹的权限
chown nobody:nobody /var/lib/libvirt/images/kvmshare/ -R
在virt-Manager上修改共享文件夹的权限
chown nobody:nobody /var/lib/libvirt/images/kvmshare/ -R
在KVM上复制VM1磁盘文件到共享文件夹
cd /var/lib/libvirt/images/
cp vm1.qcow2 kvmshare/
注意:此处的所有主机地址为NFS使用者,需自定义修改
标签:systemctl,nobody,kvm,192.168,文件夹,NFS,kvmshare From: https://www.cnblogs.com/tang-learning/p/16795784.html