Virtualbox 与 debian 主机/来宾因 NFS 失败

Virtualbox 与 debian 主机/来宾因 NFS 失败

我有以下流浪脚本:

Vagrant.configure(2) do |config|
    config.vm.box = "puppetlabs/debian-8.2-64-puppet"

    config.vm.network "private_network", type: "dhcp"

  config.vm.provider "virtualbox" do |v|
    v.memory = 4096
    v.cpus = 1
  end

  config.vm.provision "shell", inline: <<-SHELL
    apt-get update && install nfs-common portmap
    apt-get install -y puppet 

    puppet module install puppetlabs/stdlib
  SHELL

  config.vm.provision "puppet" do |puppet|
    puppet.manifest_file = "default.pp"    
    puppet.manifests_path = ".vagrant/puppet"
    puppet.module_path = ".vagrant/puppet/modules"
  end

  config.vm.synced_folder "./", "/var/www", :nfs => true
end

当我启用 NFS(我需要它,因为默认共享文件夹会导致另一个程序出现问题)时,我收到以下错误:

==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
● nfs-kernel-server.service - LSB: Kernel NFS server support
   Loaded: loaded (/etc/init.d/nfs-kernel-server)
   Active: active (exited) since Mon 2016-07-25 14:13:11 CDT; 17h ago
==> default: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

set -e
mkdir -p /var/www
mount -o vers=3,udp 172.28.128.1:/home/alex/Projects/chrome /var/www
if command -v /sbin/init && /sbin/init --version | grep upstart; then
  /sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/var/www
fi


Stdout from the command:



Stderr from the command:

stdin: is not a tty
mount.nfs: requested NFS version or transport protocol is not supported

我以我自己和具有提升权限的“sudo”用户身份通过​​ IDE 和 CLI 运行了此脚本 - 仍然是相同的结果。

有任何想法吗?

答案1

nfs-utils我在 Arch Linux 上使用 VirtualBox 作为提供程序并安装和启用时遇到了完全相同的问题。

我花了一些时间让它发挥作用,但无法真正说出到底是什么让它最终发挥作用。下面我链接到我阅读和尝试的两个主要资源。

  1. 确保vagrant允许运行命令须藤。看 这个链接。 (但实际上我的系统上没有用户vagrant,所以这可能是多余的。)
  2. 检查是否net-tools已安装。(但这可能是 Arch 的问题,请参阅这个链接.)

相关内容