[lxc-users] lxd access from host to container rootfs

Fajar A. Nugraha list at fajar.net
Mon Dec 10 04:16:22 UTC 2018


On Wed, Dec 5, 2018 at 9:03 PM Ingo Baab <ib at baab.de> wrote:

> Hello All,
> how can I access the LXD/LXC containers rootfs from the host system?
> (if I am using ubuntu18.04 with snap lxc --version 3.7 on loopback-ZFS)
>
> On other (real ZFS-based and U16.04) server I can access:
>
>      "/var/lib/lxd/containers/{$containername}/rootfs/"
>
> Any hints?
> Ingo
>
>

I believe newer versions of lxd:
- keeps the zfs datasets unmounted by default
- only mounts it on the host when container is starting
- unmount it again from the host, so it's only mounted on the container

You should be able to do this on the host:
- zfs list
- zfs mount ...

for example, in my case the dataset name is something
like data/lxd/containers/c1, and it can be mounted (with 'zfs mount')
on /var/snap/lxd/common/lxd/storage-pools/default/containers/c1.

-- 
Fajar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20181210/7490d82f/attachment.html>


More information about the lxc-users mailing list