无法在具有linux来宾的Windows主机上使用Vagrant创建SMB共享文件夹

无法在具有linux来宾的Windows主机上使用Vagrant创建SMB共享文件夹,vagrant,virtualbox,samba,smb,Vagrant,Virtualbox,Samba,Smb,我正在使用Vagrant在我的Windows 7 SP 1 PC上创建一个Ubuntu14.04 guest。这一直运行正常,但当访问从主机同步的文件时,guest的性能很差。在阅读了一些内容之后,我试图将同步文件夹设置为SMB共享,但是当我运行“vagrant up”时,这失败了 请注意,我已升级到powershell 3.0,如中所述。我还确保我的来宾安装了cifs util,如中所述。我使用的是Vagrant 1.7.4和VirtualBox 4.3.28 我的文件如下所示: # -*-

我正在使用Vagrant在我的Windows 7 SP 1 PC上创建一个Ubuntu14.04 guest。这一直运行正常,但当访问从主机同步的文件时,guest的性能很差。在阅读了一些内容之后,我试图将同步文件夹设置为SMB共享,但是当我运行“vagrant up”时,这失败了

请注意,我已升级到powershell 3.0,如中所述。我还确保我的来宾安装了cifs util,如中所述。我使用的是Vagrant 1.7.4和VirtualBox 4.3.28

我的文件如下所示:

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

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  config.vm.box = "npt"

  config.vm.provider "virtualbox" do |v|
    v.customize ["modifyvm", :id, "--cpuexecutioncap", "90"]
    v.customize ["modifyvm", :id, "--memory", "4096"]
    v.customize ["modifyvm", :id, "--cpus", 2]
  end

  config.vm.synced_folder "\\", "/npt_root", type: "smb"

  config.vm.provision :shell do |shell|
    shell.inline = "puppet module install puppetlabs/vcsrepo --force"
  end

  config.vm.provision "puppet" do |puppet|
    puppet.manifests_path = "puppet"
    puppet.manifest_file  = "basic_build_reqs.pp"
  end

  config.ssh.username = 'root'
  config.ssh.password = 'vagrant'
  config.ssh.insert_key = 'true'

end
我看到的结果是:

Z:\npt\vagrant>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'npt'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: vagrant_default_1442502969737_66801
==> default: Preparing SMB shared folders...
    default: You will be asked for the username and password to use for the SMB
    default: folders shortly. Please use the proper username/password of your
    default: Windows account.
    default:
    default: Username: tdj@DCL
    default: Password (will be hidden):
Exporting an SMB share failed! Details about the failure are shown
below. Please inspect the error message and correct any problems.

Host path: Z:/

Stderr: System error 123 has occurred.

The filename, directory name, or volume label syntax is incorrect.

Error:


Stdout:
看起来Vagrant已经解释了我给出的相对路径“\”,并给出了带有unix风格斜杠的“Z:/”,Windows随后无法解析该斜杠

请注意,我已尝试将相对路径替换为绝对路径“Z:\”,但我仍然在“主机路径”行上看到相同的输出,我怀疑“\\”是以下行中的问题:

config.vm.synced_文件夹“\\”,“/npt_根目录”,类型:“smb”

您是否可以尝试输入一个具体的foldername,以便与您的VM共享,并测试它是否有效