How to mount an NFS share in a VM guest?

SomethingBetter asked:

We have a machine with Win7-x64 installed. On this machine, with VirtualBox, we’re running a guest Fedora-x64. We’ve defined an NFS share on this Fedora instance. Here is the entry in /etc/exports:

/dvr 192.168.0.0/192.168.255.255(rw)

The ip address of the windows machine is, 192.168.1.100, the ip address of the Fedora guest is 192.168.1.110. The networking mode of the VM is set to be bridged networking.

Now, from another linux box, when we ping the Fedora guest (192.168.1.110), we get responses just fine. However, when we try to mount the nfs share, we get a “no route to host” error. The command we use is:

mount -t nfs 192.168.1.110:/dvr /mnt/test

Just to make sure there are no iptables issues, on the fedora guest, we did:

service iptables stop

and re-tried to mount, to no avail.

Any ideas what might be wrong in our setup? All these machines are connected to each other through a hub. A linksys router is configured as a DHCP server, from which all the machines grab an ip address.

Thanks.

My answer:


/etc/exports expects an IP address, optionally followed by a CIDR or old-style netmask.

So you need to change it to one of:

/dvr 192.168.0.0/255.255.0.0(rw)

or:

/dvr 192.168.0.0/16(rw)

(Hostnames can also be used, but that’s not relevant here.)


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.