View .zfs/snapshot inside container

Can you browse and restore individual files from snapshots without rolling back the entire container? Through .zfs/snapshot or another way?

I’ve been using samba+vfs_shadow_copy2 (to integrate with VSC on Windows) without LXD. Now I’m trying to move this inside a container, but can’t find any way of getting the .zfs/snapshot directories.

I’m on LXC 3.14. Thanks for any help you can provide!

In theory you could try to expose the magic directory using a disk device, setting the source to the host path for it. But it’s worth remembering that this is a weird magic path, so you may have some pretty odd behavior accessing it.

Also, keep in mind that the uid/gid of files in snapshots may be completely wrong as containers can change maps at times. LXD handles that fine on restores or copies as it knows what the uid/gid map of a given snapshot is and can translate the uid/gid information, but that’s not something you can do on the fly by passing the magic directory through.