Skip to content

Instantly share code, notes, and snippets.

@nastra
Created August 28, 2015 06:49
Show Gist options
  • Save nastra/1c68470ac532803cd6c2 to your computer and use it in GitHub Desktop.
Save nastra/1c68470ac532803cd6c2 to your computer and use it in GitHub Desktop.
Boot2Docker with NFS instead of vboxfs on OSX

Get boot2docker working with nfs instead of vboxsf.

Tested on:

Client:
 Version:      1.8.1
 API version:  1.20
 Go version:   go1.4.2
 Git commit:   d12ea79
 Built:        Thu Aug 13 19:47:52 UTC 2015
 OS/Arch:      darwin/amd64

Server:
 Version:      1.8.1
 API version:  1.20
 Go version:   go1.4.2
 Git commit:   d12ea79
 Built:        Thu Aug 13 02:49:29 UTC 2015
 OS/Arch:      linux/amd64

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

nfs.server.mount.require_resv_port = 0

2) Open /etc/exports and add this line:

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

3) Restart NFSD:

sudo nfsd restart

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

$ boot2docker ssh
$ 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment