Skip to content

Instantly share code, notes, and snippets.

@mnapoli
Last active August 29, 2015 14:23
Show Gist options
  • Save mnapoli/799a66ddccfaac3c5e09 to your computer and use it in GitHub Desktop.
Save mnapoli/799a66ddccfaac3c5e09 to your computer and use it in GitHub Desktop.
Boot2docker on OS X

Boot2docker on OS X

Problems:

  • permissions
  • slow I/O because of vboxfs

Solution: mount the disk using NFS.

On OS X

These instructions need to be run only once to set up NFS.

Add in /etc/exports (create it if it doesn't exist):

/Users -mapall=matthieu:staff 192.168.1.95

Replace with your user name (run whoami) and the IP address of the vagrant VM created by Boot2docker (run boot2docker ip).

Add in /etc/nfs.conf (create it if it doesn't exist):

nfs.server.mount.require_resv_port = 0

Restart the NFS deamon by running:

sudo nfsd restart

In the Boot2docker VM

I believe these instructions should be run every time the boot2docker VM is restarted (e.g. when you restart your computer).

Run the following commands:

sudo umount /Users
sudo /usr/local/etc/init.d/nfs-client restart
sleep 10
sudo mount 192.168.0.107:/Users /Users -o rw,async,noatime,rsize=32768,wsize=32768,proto=tcp,nfsvers=3

The IP address should be the OS X address. You can get it by running this command on OS X (not inside Boot2docker): ifconfig en0 | grep --word-regexp inet | awk '{print $2}'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment