0
votes

I'm using Vagrant to create an Ubuntu 14.04 guest on my Windows 7 SP 1 PC. This has been working ok, but the performance of the guest is poor when accessing files that have been synchronized from the host. After doing some reading, I'm trying to make the synchronized folder an SMB share, however this is failing when I run 'vagrant up'

Note that I've upgraded to powershell 3.0, as documented in https://docs.vagrantup.com/v2/synced-folders/smb.html. I've also ensured that my guest has cifs-util installed as pointed out in https://github.com/mitchellh/vagrant/issues/4642. I'm using Vagrant 1.7.4 and VirtualBox 4.3.28

My Vagrantfile looks like this:

# -*- 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

And the output I am seeing is:

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:

It looks like Vagrant has interpreted the relative path "\" I've given it and is coming up with "Z:/", with unix style slashes, which Windows is then failing to parse.

Note that I've tried replacing the relative path with the absolute path "Z:\", but I still see the same output on the "Host path" line

1

1 Answers

0
votes

I suspect "\\" is the problem in the following line:

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

Could you try to put in a concrete foldername that you would like to share with your VM and test if it works?