shared folders vs synced folders
Basically, shared folders are renamed to a synchronized folder from v1 to v2 (docs), under the hood, it still uses vboxsf between the host and the guest (known performance problems with a large number of files / directories).
Vagrantfile directory set as /vagrant in guest
Vagrant sets the current working directory (where the Vagrantfile is located) as /vagrant on the guest system, this is the default behavior.
See docs
NOTE. By default, Vagrant will share your project directory (directory with Vagrantfile) with / vagrant.
You can disable this behavior by adding cfg.vm.synced_folder ".", "/vagrant", disabled: true to your Vagrantfile .
Why the synchronized folder does not work
Based on the output /tmp on the host was NOT set at run time.
Use VAGRANT_INFO=debug vagrant up or VAGRANT_INFO=debug vagrant reload to start the virtual machine for more information on why the synchronized folder is not installed. This may be a resolution issue (the /tmp mode bits on the host must be drwxrwxrwt ).
I checked a quick check using the following and it worked (I used the optional bento raring vagrant base box)
config.vm.synced_folder "/tmp", "/tmp/src"
Exit
$ vagrant reload [default] Attempting graceful shutdown of VM... [default] Setting the name of the VM... [default] Clearing any previously set forwarded ports... [default] Creating shared folders metadata... [default] Clearing any previously set network interfaces... [default] Available bridged network interfaces: 1) eth0 2) vmnet8 3) lxcbr0 4) vmnet1 What interface should the network bridge to? 1 [default] Preparing network interfaces based on configuration... [default] Forwarding ports... [default] -- 22 => 2222 (adapter 1) [default] Running 'pre-boot' VM customizations... [default] Booting VM... [default] Waiting for VM to boot. This can take a few minutes. [default] VM booted and ready for use! [default] Configuring and enabling network interfaces... [default] Mounting shared folders... [default] -- /vagrant [default] -- /tmp/src
Inside the virtual machine, you can see mounting information for /tmp/src on /tmp/src type vboxsf (uid=900,gid=900,rw) .
Terry Wang Aug 30 '13 at 9:38 on 2013-08-30 09:38
source share