[SOLVED] automount NFS share to CT

merc

New Member
Aug 3, 2021
8
0
1
56
Trying to automount an NFS share to a CT that's being shared from another VM, both on the same pve host. The share isn't mounted to the pve host because it's only available when the other VM sharing it is running and I don't need it on the host regardless.

So, I got an ubuntu 20.04 CT, privileged, with NFS enabled (tried with nesting enabled as well).

Installed nfs-common to the CT. It can directly mount the nfs share just fine, no problems there.

Then tried adding the mount to the CT's fstab. Won't work. Reading up on it, it turns out fstab on lxc won't do, autofs suggested.

And autofs just won't work. Without nesting it refused to even start.
With nesting it's starting, creating the directories where it's supposed to mount stuff, but nothing is actually mounted and no error messages given.

All the above on proxmox 7, fully updated with template ubuntu 20.04.1 CT, also fully updated.

Is this a known thing? Any workarounds?
 
Answering my own question, as I just found a workaround.

Simply added a typical mount nfs share line to the CT's fstab and then created a root cron job @reboot mount -a

This gets the job done, but I'd still like to know what's the deal with autofs.
 
And one more update for posterity, as it turns out, the reason fstab failed to mount nfs all along, was because it was waiting for ipv6 to timeout, since I had ipv6 set to dhcp in the CT network settings.

That caused a lot of problems with systemctl not starting enabled services on reboot either that required networking.

Simply turning ipv6 to static with no ip entered fixed every problem.