Note: you will need sudo access. Add the following to /etc/exports
/Users -alldirs -maproot=root:wheel -network 192.168.99.0 -mask 255.255.255.0
Restart NFS:
sudo nfsd restart
Note: you will need sudo access and NFS server (sudo apt-get install -y nfs-kernel-server
on debian). Add the following to /etc/exports
/home 192.168.99.0/24(rw,no_root_squash,no_subtree_check)
Restart NFS
sudo systemctl restart nfs-kernel-server
You will need to remove the existing shared folder at /Users
(only if on OS X). You can do this with (make sure the VM is stopeed):
VBoxManage sharedfolder remove [vm-name] --name Users
Start the VM and ssh into it. Add the following to /var/lib/boot2docker/profile
:
mkdir /Users
sudo mount -t nfs -o vers=3,nolock,udp 192.168.99.1:/Users /Users
mkdir -p /mnt/home
mount -t nfs -o vers=3,nolock,udp 192.168.99.1:/home /mnt/home
for USERDIR in /mnt/home/*
do
USER=`basename $USERDIR`
ln -sf /mnt/home/$USER /home/$USER
done
Reboot the VM. You should now have NFS in b2d and be able to do things like:
docker run -v $(pwd):/dest/in/container ...