vagrant up fails: sudo mkdir -p /vagrant

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

vagrant up fails: sudo mkdir -p /vagrant

Neil Lalonde
I was able to do vagrant up to create a new box successfully, then I installed all the software I need (postgres, redis, etc.).  These are the instructions I followed, under Building your own Vagrant VM: https://github.com/discourse/discourse/blob/ff3028de07be29f1d92d5807784b0777a4eaf678/docs/DEVELOPER-ADVANCED.md

Since I'm trying to use vmware_fusion as the provider instead of VirtualBox, my Vagrantfile looks like this:
Vagrant.configure("2") do |config|
  config.vm.box = "precise64_vmware_fusion"
  config.vm.box_url = "http://files.vagrantup.com/precise64_vmware_fusion.box"
  config.vm.network :private_network, ip: "192.168.11.200"
  config.ssh.forward_agent = true
  config.vm.network :forwarded_port, guest: 3000, host: 5000
  config.vm.network :forwarded_port, guest: 1080, host: 5080 # Mailcatcher
  config.vm.synced_folder ".", "/vagrant"
  config.vm.provider :vmware_fusion do |p|
    p.vmx['memsize'] = '1024'
  end
end
When I do vagrant halt, and then vagrant up, I get this output:

Bringing machine 'default' up with 'vmware_fusion' provider...
[default] Verifying vmnet devices are healthy...
[default] Preparing network adapters...
[default] Starting the VMware VM...
[default] Waiting for the VM to finish booting...
[default] The machine is booted and ready!
[default] Forwarding ports...
[default] -- 22 => 2222
[default] -- 3000 => 5000
[default] -- 1080 => 5080
[default] Configuring network adapters within the VM...
[default] Enabling and configuring shared folders...
[default] -- vagrant-root: /Users/neil/Code/discourse/vmware/discourse
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
sudo mkdir -p /vagrant

I vagrant ssh into the box, and see something odd:

vagrant@precise64:~$ sudo mkdir -p /vagrant
mkdir: cannot create directory `/vagrant': File exists
vagrant@precise64:~$ cd /vagrant
-bash: cd: /vagrant: No such file or directory

The instructions work with VirtualBox, so I'm not sure what is wrong.  Any ideas?

Thanks,
Neil

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: vagrant up fails: sudo mkdir -p /vagrant

Neil Lalonde
More info:

$ ls -ld /vagrant
lrwxrwxrwx 1 root root 19 Mar 24 16:24 /vagrant -> /mnt/hgfs/!%vagrant

But the shared folder was mounted as /mnt/hgfs/vagrant-root.  No idea how the link got mangled.

sudo rm /vagrant
sudo ln -s /mnt/hgfs/vagrant-root/ /vagrant

Fixed it for a few minutes...

$ ls -ld /vagrant
lrwxrwxrwx 1 root root 23 Mar 24 18:36 /vagrant -> /mnt/hgfs/vagrant-root/

That seems to have fixed it.



--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.