What I have:
A Gentoo host and an Ubuntu container.
What I want:
/home from the host to the container and use it there as normal.
What I'm doing:
Start the container with
-U --bind=/home flags.
What I get:
In the container I have my
/home directory but it has been mounted with nobody:nogroup owner:
scratch:5:0:/home/vkirsano> ll /home total 24 drwxr-xr-x 3 nobody nogroup 4096 Sep 19 17:39 krokoziabla drwx------ 2 nobody nogroup 16384 Oct 20 2016 lost+found drwxr-xr-x 56 nobody nogroup 4096 Sep 20 22:15 vkirsano
So effectively I only have read-only access to the contents of the
/home directory which is not what I want. Say, I've created user
vkirsano in the container with the same UID:GID as in the host so I would like systemd-nspawn to just keep the original info about files' ownership while binding the directory.
What I'm asking
What is the usual practice (if there is one) of mounting folders like
/home with keeping the ability to work normally with them in the container?