Skip to content

Instantly share code, notes, and snippets.

@YtvwlD
Created June 28, 2019 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YtvwlD/c99d23407e76dd55abaf5549b3fad0be to your computer and use it in GitHub Desktop.
Save YtvwlD/c99d23407e76dd55abaf5549b3fad0be to your computer and use it in GitHub Desktop.
NFS minimal example
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.provider "virtualbox" do |v|
v.memory = 256
end
config.vm.define "server" do |server|
server.vm.hostname = "server"
server.vm.network "private_network", ip: "10.0.0.10"
server.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y avahi-daemon libnss-mdns nfs-kernel-server vsftpd
mkdir /export
echo "/export *(rw,no_root_squash)" >> /etc/exports
exportfs -a -r
echo "10.0.0.11 client" >> /etc/hosts
SHELL
end
config.vm.define "client" do |client|
client.vm.hostname = "client"
client.vm.network "private_network", ip: "10.0.0.11"
client.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y avahi-daemon libnss-mdns nfs-common ftp curlftpfs
mkdir /import
echo "10.0.0.10 server" >> /etc/hosts
SHELL
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment