Search code examples
ubuntunetwork-programmingvmwarenfs

Can I use nfs on 2 VMs connected on a host-only network


I have a windows 10 host running VMWare Workstation 12. I have an Ubuntu Server guest and an Xubuntu Desktop guest.

The Ubuntu Server has nfs server setup on it. On the Xubuntu Desktop I have setup my fstab to mount a few folders from the server.

I usually have the Windows host connected to my network over ethernet, and use Bridged networking. Then have my router assign IPs to the VMs.

This setup works well, but this week I am travelling so I need to switch the VMs over to a host only network. When I do this they can see each other and I can ssh from the Xubuntu Desktop to the Ubuntu Server. But the nfs wont mount.

$ sudo mount -a
mount.nfs: access denied by server while mounting 192.168.186.128:/vol/

I ran this to search the log files on both VMs

grep -rl "nfs" /var/log

and don't see anything relevant, so now I'm not sure what to do next.

edit:

This is the relevant line in /etc/fstab on the desktop vm

192.168.186.128:/vol/   /vol/  nfs  rsize=8192,wsize=8192,timeo=14,intr  0 0

and this is the relevant line from /etc/exports on the server vm

/vol/   192.168.0.0/24(rw,nohide,insecure,no_subtree_check,async)

I'm not sure if this is relevant, but the ssh connection takes a lot longer to open than it did with the bridged network.


Solution

  • probably OT here.

    but 192.168.0.0/24 does not include 192.168.186.128 either change the exports to be 192.168.186.0/24 or 192.168.0.0/16 as both of those will include 192.168.186.128

    the reason ssh it taking longer is probably due to the host lookup ssh is performing timing out due to lack of DNS resolution. You can try adding server's ip to /etc/hosts on the desktop and vice versa, might help a bit.