Some issues with Vagrant/VirtualBox/Windows

Issue 1: Long path in your VM

Virtual Box defaults to a limit of ~260 characters for paths that are inside their shared folders.

https://www.virtualbox.org/ticket/11976

So these are folders that exist on your host machine and are shared with the VM. This is a core component of Vagrant as this is the 'vagrant' folder that holds your source code or whatever.

The fix:

The fix is to basically remove and re-add the shared folder with a \\?\ prefix. Fortunately there is a gist here that has the full code needed for your vagrantfile.

https://gist.githubusercontent.com/Jakobud/0768ff6b6051e79eef60/raw/537450f706469bfdc79e3fa2b9c6282d83faa0ce/Vagrantfile

Symlinks don't work in a folder shared from windows to a nix VM. This would not normally be a big deal but npm uses them a fair bit.

https://www.virtualbox.org/ticket/10085
https://github.com/npm/npm/issues/2380

The fix:

You can tell npm not to use symlinks by passing the --no-bin-links option. Handily you can also tell it to always use this option by editing the npm config.

Add this to your inline shell script or bootstrap.sh or whatever you are using to provision Vagrant.

npm config set bin-links false -g  

Issue 3: node vs nodejs

For whatever reason on Ubuntu node is nodejs. I mean it should be nodej but everywhere else it's just node. This means that some packages that try to do post-installation tasks with node don't work.

http://stackoverflow.com/questions/18130164/nodejs-vs-node-on-ubuntu-12-04

The fix:

We can use a symlink here because it is not in the shared folder. Add this to your inline shell script or bootstrap.sh or whatever you are using to provision Vagrant.

ln -s `which nodejs` /usr/bin/node