View container files in snap lxd

I am currently using a snap lxd 3.0 stable channel. I am not able to view the rootfs of the running container. My usecase is to access some custom log files present inside the rootfs.

It currently seems to located in /var/snap/lxd/common/lxd/containers/. The doesn’t seem to be a directory nor a file. This seems to be due to snap lxd intentionally hiding it’s mount space as mentioned in Rootfs mount locations on the host with snap lxd

Is there anything i can do to disable snap lxd intentionally hiding it’s mount space or any alternatives to access the data inside it?

I got you covered, https://blog.simos.info/how-to-view-the-files-of-your-lxd-container-from-the-host/

You would rather not disable anything within LXD. LXD is not hiding, it is just using namespaces as it should. It is up to you to walk through the namespaces and have access to the files.

2 Likes

Cool this worked! Thanks a lot