Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save boywijnmaalen/3b1ce1db83766e3c49e9 to your computer and use it in GitHub Desktop.
Save boywijnmaalen/3b1ce1db83766e3c49e9 to your computer and use it in GitHub Desktop.
Mount a NFS share from a local hosted VM via CLI
## 1. add these ports to the nat forwarder in VirtualBox (You can look them up in "/etc/sysconfig/iptables")
udp 2049
tcp 2049
udp 111
tcp 111
udp 32803
tcp 32803
# port '32803' must manually be set in /etc/default/nfs-kernel-server
# (don't forget to restart the service)
# Optionally for Virtualbox:
udp 892
tcp 892
udp 875
tcp 875
udp 662
tcp 662
## 2. connect to the local hosted share via CLI
$ sudo mkdir -p /Volumes/localhost && sudo mount_nfs -o resvport 127.0.0.1:/var/www/sites /Volumes/localhost/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment