安装NFS服务
sudo apt-get install nfs-kernel-server
编辑/etc/exports文件
vim /etc/exports /opt/nfs *(rw,sync,no_root_squash)
其中:/opt/nfs
是目录,如果没有需要先创建。
启动nfs服务
sudo /etc/init.d/nfs-kernel-server start
关闭防火墙
ufw disable
需要确保板卡可以ping
通虚拟机。
查看虚拟机IP,在板卡上挂载文件系统
mount -t nfs -o nolock 10.169.0.155:/opt/nfs /mnt/nfs