On my Ubuntu system, I have this line in /etc/fstab:
myserver:/home/me /mnt/me nfs rsize=8192,wsize=8192,timeo=14,intr
When I do
sudo mount -a
I get:
mount.nfs: access denied by server while mounting myserver:/home/me
How can I diagnose this problem? The nfs server is also Ubuntu.
Additional details: I am able to mount this nfs share from other Ubuntu clients on the same network with no problem. However, the problematic client is different in that it is running inside VirtualBox on a Windows system. I can ping "myserver" fine from the problematic client.
EDIT: /etc/exports on "myserver":
/home/me *(rw,all_squash,async,no_subtree_check,anonuid=1000,anongid=1000)
/etc/hosts.allow and /etc/hosts.deny on "myserver" are both all comments. And keep in mind, that I can connect fine from other clients on the same network.
Found it!
One of the logs had the line:
I googled and found that since the port is over 1024 I needed to add the "insecure" option to the relevant line in /etc/exports on the server. Once I did that (and ran exportfs -r), the mount -a on the client worked.
This question is related on how the network is set for your vm.
By default with VirtualBox, you have NAT network. Which result in port translation.
Step by step this gives :
As mentioned by @JoelFan, one fix would be to set the
insecure
option to the server. This is a quick fix but ... insecure ;)What fixed the case for me (in a secured manner) was to change from NAT to Bridge network for this vm. This way, my vm has it's own IP address and no port translation is done.
Guess what... for me, the source of exactly the same error was a version mismatch between my NFS client and the server.
The logs were silent as if nothing happened, and only nfswatch running on the server side helped me clarify the situation.
The problem was resolved by adding the nfsver mount option on the client side:
Have you verified that the name resolution is correct on the server for the client that is trying to connect (and is listed in the exports file)?
check the files
hosts.allow
andhosts.deny
and whether the client is entered correctly. when this does not help, please post your export file.In case this helps other people, I have a Synology NAS and the NFS point actually added another item to the path.
I was trying to mount "xxx.xxx.xxx.xxx/folder" as this is what I do in Windows. But for Ubuntu with NFS I had to use "xxx.xxx.xxx.xxx/volume1/folder".