Vagrant框上的共享NFS文件夹为空

时间:2016-08-07 04:33:12

标签: vagrant virtualbox

我正在处理一个项目并尝试设置环境。在Vagrantfile中有:

config.vm.synced_folder "./", "/vagrant", type: 'nfs'
config.vm.network "private_network", ip: "192.168.33.10"

我ssh到box / guest,但无法看到共享中的任何文件。我的/ etc / exports看起来没问题:

# VAGRANT-BEGIN: 1000 14948e9b-4304-4359-9e8e-674f4ae10415
/home/{my_username}/open 192.168.33.10(rw,no_subtree_check,all_squash,anonuid=1000,anongid=1000,fsid=743045029)
# VAGRANT-END: 1000 14948e9b-4304-4359-9e8e-674f4ae10415

当我使用ssh时,我在盒子/来宾上的UID是500,但主机上是1000.我尝试将以下行添加到我的Vagrantfile中以使其匹配:

  config.nfs.map_uid = Process.uid   
  config.nfs.map_gid = Process.gid 

但是,仍然没有运气。主机是Ubuntu 14.04 LTS,盒子是bento / Centos-6.7。流浪者期间没有错误消息。但是,它没有列出正在同步的文件夹:

[default] Mounting NFS shared folders...
{There should be some msg about the folders here right?}
[default] VM already provisioned. Run `vagrant provision` or use `--provision` to force it

编辑:以下是debug的相关信息:

INFO synced_folders: Synced Folder Implementation: nfs
INFO synced_folders:   - /vagrant: ./ => /vagrant
INFO synced_folders: Invoking synced folder prepare for: nfs
INFO warden: Calling IN action: #<VagrantPlugins::ProviderVirtualBox::Action::PrepareNFSSettings:0x00000001b38818>

但是,后来没有提到文件夹:

INFO interface: info: Mounting NFS shared folders...
DEBUG ssh: Checking whether SSH is ready...
DEBUG ssh: Re-using SSH connection.
INFO ssh: SSH is ready!
INFO guest: Execute capability: mount_nfs_folder (redhat)
DEBUG guest: Searching for cap: mount_nfs_folder

我应该寻找什么特别的东西?

另外,我确实检查了nfs是否正在运行:

service nfs-kernel-server status

并得到:nsfd running

showmount -e给了我:

/home/{My username}/open 192.168.33.10

所以...如果客人运行ls -l /vagrant我可以看到共享文件!那么,我该如何访问它们呢?

0 个答案:

没有答案