A BTRFS snapshot as base for a LXC container

Hello,

is there a way to create a Linux container from an existing BTRFS snapshot?

I have a server with BTRFS on which there is a subvolume of rootfs (@rootfs). From this subvolume there are BTRFS snapshots.

I want to do some experiments on the system and try to create a LXC container from the snapshot of the @rootfs subvolume. Is this possible at all?

Any Idea or comment?

I would like to integrate a BTRFS snapshot into an LXC container so that this container can be started.

For example, if I create a new container with lxc-create -n Debian10 -t debian – -r buster, I already have a clean config for a Debian 12 container with a running system. However, I don’t actually want to have the file system (/var/lib/lxc/Debian12/rootfs) of the container.
The first thing I would do now is to take another - writable - snapshot of the host file system. Next, I would try to mount the directory of the new snapshot in the container under / via the config of the container. The mount would run via lxc.mount.entry=/path/in/host/mount_point mount_point_in_container none bind 0 0 in the config.

Is this feasible? Has anyone ever done this?