Ubuntu 16.04上的流浪NFS被拒绝访问?

Ubuntu 16.04上的流浪NFS被拒绝访问?,ubuntu,vagrant,nfs,Ubuntu,Vagrant,Nfs,我在Ubuntu 16.04上,一直在尝试让NFS同步文件夹与Vagrant(使用)和VirtualBox一起工作 这是我的流浪汉档案 # -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure("2") do |config| config.vm.box = "scotch/box" config.vm.network "private_network", ip: "192.168.33.10" config

我在Ubuntu 16.04上,一直在尝试让NFS同步文件夹与Vagrant(使用)和VirtualBox一起工作

这是我的流浪汉档案

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

    config.vm.box = "scotch/box"
    config.vm.network "private_network", ip: "192.168.33.10"
    config.vm.hostname = "scotchbox"
    #config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]

    # Optional NFS. Make sure to remove other synced_folder line too
    config.vm.synced_folder ".", "/var/www", :nfs => { :mount_options => ["dmode=777","fmode=666"] }

end
这是我从运行
vagrant up

==> default: Checking if box 'scotch/box' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.
    default: 
    default: Guest Additions Version: 4.3.28
    default: VirtualBox Version: 5.1
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
● nfs-server.service - NFS server and services
   Loaded: loaded (/lib/systemd/system/nfs-server.service; enabled; vendor preset: enabled)
   Active: active (exited) since Mon 2017-02-13 02:35:28 EST; 5h 23min ago
  Process: 1374 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=0/SUCCESS)
  Process: 1370 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
 Main PID: 1374 (code=exited, status=0/SUCCESS)
 CGroup: /system.slice/nfs-server.service

Feb 13 02:35:28 xander-ubuntu systemd[1]: Starting NFS server and services...
Feb 13 02:35:28 xander-ubuntu systemd[1]: Started NFS server and services.
Feb 13 07:43:41 xander-ubuntu systemd[1]: Started NFS server and services.
exportfs: /home/xander/Websites/scotchbox does not support NFS export
==> default: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mount -o vers=3,udp 192.168.33.1:/home/xander/Websites/scotchbox /var/www
result=$?
if test $result -eq 0; then
if test -x /sbin/initctl && command -v /sbin/init && /sbin/init 2>/dev/null --version | grep upstart; then
/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/var/www
fi
else
exit $result
fi


Stdout from the command:



Stderr from the command:

stdin: is not a tty
mount.nfs: access denied by server while mounting 192.168.33.1:/home/xander/Websites/scotchbox
有人知道NFS为什么会失败吗


我在本地计算机上安装了nfs内核服务器,在虚拟机上安装了nfs common,但运气不好。

由于防火墙问题,这种情况经常发生。我不知道如何在你的Ubuntu机器上解决这个问题,但在我的MacOS中,我在防火墙选项中禁用了
隐身模式。我不知道如何在你的Ubuntu机器上解决这个问题,但在我的MacOS中,我禁用了防火墙选项中的
隐身模式。