Skip to content

Instantly share code, notes, and snippets.

@haggen
Last active September 11, 2018 03:19
Show Gist options
  • Star 21 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save haggen/f84f55e3ed2c9c930335 to your computer and use it in GitHub Desktop.
Save haggen/f84f55e3ed2c9c930335 to your computer and use it in GitHub Desktop.
boot2docker on nfs

Get boot2docker working with nfs instead of vboxsf.

Tested on:

- Boot2Docker-cli version: v1.6.0
  Git commit: 9894ae9
- Boot2Docker-cli version: v1.6.2
  Git commit: cb2c3bc

1) In your Mac, open the file /etc/nfs.conf and add this line:

nfs.server.mount.require_resv_port = 0

2) Then, open /etc/exports and add this line, changing the values to match your case:

/Users/<your username> -mapall=<your username>:staff <mac's ip address>

3) With both files changed time to apply the new settings:

sudo nfsd restart

4) Finally, ssh into your boot2docker machine and run:

sudo umount /Users
sudo mkdir /Users/<your username>
sudo /usr/local/etc/init.d/nfs-client start
sudo mount <mac's ip address>:/Users/<your username> /Users/<your username> -o async,noatime,actimeo=1,nolock,vers=3,udp

You'll notice I'm mounting an especific user's directory instead of the Users directory itself, that's because of permissions, I couldn't share the Users directory on my behalf.

@iansmith
Copy link

Worked out of the box for me. Truly great work. 🏆

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