$ sudo apt install nfs-kernel-server
$ sudo vim /etc/exports
假设我们nfs路径设为 /home/sun/nfs
在文末添加一行: /home/sun/nfs *(rw,sync,no_subtree_check)
# /etc/exports: the access control list for filesystems which may be exported
2 # to NFS clients. See exports(5).
3 #
4 # Example for NFSv2 and NFSv3:
5 # /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
6 #
7 # Example for NFSv4:
8 # /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
9 # /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
10 #
11
12 #nfs for qemu-arm
13 /home/sun/nfs *(rw,sync,no_subtree_check)
$ sudo exportfs -ra
$ sudo service nfs-kernel-server restart
参考链接