Created
February 1, 2011 17:45
-
-
Save RichardBronosky/806251 to your computer and use it in GitHub Desktop.
setup your VirtualBox guest to export a folder to you host Mac
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [[ $(uname -a) = *Darwin* ]]; then | |
echo "Run this from your Linux guest, not your Mac"; | |
else | |
sudo apt-get install nfs-kernel-server | |
sudo mkdir /export | |
sudo chmod a+rwx /export | |
mkdir /export/devel | |
sudo mount --bind $HOME/devel /export/devel | |
cat <<EOF | sudo tee -a /etc/fstab | |
# added per https://help.ubuntu.com/community/SettingUpNFSHowTo | |
$HOME/devel /export/devel none bind 0 0 | |
EOF | |
cat <<EOF | sudo tee -a /etc/default/nfs-kernel-server | |
# added per https://help.ubuntu.com/community/SettingUpNFSHowTo | |
NEED_SVCGSSD=no # no is default | |
EOF | |
cat <<EOF | sudo tee -a /etc/default/nfs-common | |
# added per https://help.ubuntu.com/community/SettingUpNFSHowTo | |
NEED_IDMAPD=yes | |
NEED_GSSD=no # no is default | |
EOF | |
cat <<EOF | sudo tee -a /etc/exports | |
# added per https://help.ubuntu.com/community/SettingUpNFSHowTo | |
/export 192.168.56.0/24(rw,fsid=0,insecure,no_subtree_check,async) | |
/export/devel 192.168.56.0/24(rw,nohide,insecure,no_subtree_check,async,anonuid=1000,anongid=1000,all_squash) | |
EOF | |
sudo /etc/init.d/nfs-kernel-server restart | |
cat << EOF | |
Now you can mount your devel folder on your Mac in either of the following ways: | |
via Finder: | |
Cmd-K and mount nfs://192.168.56.101/export/devel | |
via CLI: | |
sudo mount -t nfs -o hard,intr -o -P 192.168.56.101:/export/devel /Network | |
EOF | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment