Ubuntu: Automouting NFS share inside NAT'd LXC container fails



Question:

I have 2x Ubuntu 14.04 LXC setups

One is on bare metal hardware and containers are assigned IP adresses directly from the network

The other one is on an ESXi virtual machine and using NAT via the host interface.

My problem is that automount doesn't work on the containers on the VM but works in containers on the bare-metal non-NAT'ed LXC containers

Automount simply just hangs when changing to a mounted directory etc.

But mounting the NFS share manual like this works:

sudo mount -t nfs nfs01.my.host:/storage/home /home   

The configuration of the LXC and containers are equal, so please note that this configuration is known to work.

Apparmor profile:

These rules has been added to /etc/apparmor.d/lxc/lxc-default:

mount fstype=nfs4,  mount fstype=rpc_pipefs,  mount fstype=autofs,  mount options=(rw, bind),  

/etc/auto.master:

/net /etc/auto.net  /home /etc/auto.home  +auto.master  

/etc/auto.home:

* nfs01.my.host:/storage/home/&  

automount map file permissions:

-rw-r--r-- 1 root root   40 Feb  1 13:53 /etc/auto.home  -rw-r--r-- 1 root root  766 Feb  3 19:37 /etc/auto.master  -rw-r--r-- 1 root root  524 Jul  8  2015 /etc/auto.misc  -rw-r--r-- 1 root root 1397 Jul  8  2015 /etc/auto.net  -rw-r--r-- 1 root root  687 Jul  8  2015 /etc/auto.smb  

When starting automount manually like this:

sudo service autofs stop  sudo strace automount -f -v  

This is the only line i see: when cd /home/<username>:

handle_packet_missing_indirect: token 47, name <username>, request pid 2543  

The only differences is bare-metal/non-nat'ed vs VM/NAT


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »