Is it possible to mount nested ZFS datasets from within a container?

stgraber@dakara:~$ incus launch images:ubuntu/24.04 u1
Launching u1
stgraber@dakara:~$ incus storage volume create default u1-extra size=10GiB zfs.delegate=true
Storage volume u1-extra created
stgraber@dakara:~$ incus config device add u1 extra disk pool=default source=u1-extra path=/mnt
Device extra added to u1

stgraber@dakara:~$ incus exec u1 bash
root@u1:~# apt install zfsutils-linux
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libbrotli1 libcurl4t64 libldap-common libldap2 libnghttp2-14 libnvpair3linux libpsl5t64 librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libssh-4
  libuutil3linux libzfs4linux libzpool5linux publicsuffix zfs-zed
Suggested packages:
  libsasl2-modules-gssapi-mit | libsasl2-modules-gssapi-heimdal libsasl2-modules-ldap libsasl2-modules-otp libsasl2-modules-sql nfs-kernel-server
  samba-common-bin zfs-initramfs | zfs-dracut
The following NEW packages will be installed:
  libbrotli1 libcurl4t64 libldap-common libldap2 libnghttp2-14 libnvpair3linux libpsl5t64 librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libssh-4
  libuutil3linux libzfs4linux libzpool5linux publicsuffix zfs-zed zfsutils-linux
0 upgraded, 18 newly installed, 0 to remove and 0 not upgraded.
Need to get 3900 kB of archives.
After this operation, 11.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://archive.ubuntu.com/ubuntu noble/main amd64 libnvpair3linux amd64 2.2.2-0ubuntu9 [61.5 kB]
Get:2 http://archive.ubuntu.com/ubuntu noble/main amd64 libuutil3linux amd64 2.2.2-0ubuntu9 [52.6 kB]
Get:3 http://archive.ubuntu.com/ubuntu noble/main amd64 libzfs4linux amd64 2.2.2-0ubuntu9 [225 kB]
Get:4 http://archive.ubuntu.com/ubuntu noble/main amd64 libzpool5linux amd64 2.2.2-0ubuntu9 [1397 kB]
Get:5 http://archive.ubuntu.com/ubuntu noble/main amd64 zfsutils-linux amd64 2.2.2-0ubuntu9 [551 kB]
Get:6 http://archive.ubuntu.com/ubuntu noble/main amd64 zfs-zed amd64 2.2.2-0ubuntu9 [67.9 kB]
Get:7 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libnghttp2-14 amd64 1.59.0-1ubuntu0.1 [74.3 kB]
Get:8 http://archive.ubuntu.com/ubuntu noble/main amd64 libpsl5t64 amd64 0.21.2-1.1build1 [57.1 kB]
Get:9 http://archive.ubuntu.com/ubuntu noble/main amd64 publicsuffix all 20231001.0357-0.1 [129 kB]
Get:10 http://archive.ubuntu.com/ubuntu noble/main amd64 libbrotli1 amd64 1.1.0-2build2 [331 kB]
Get:11 http://archive.ubuntu.com/ubuntu noble/main amd64 libsasl2-modules-db amd64 2.1.28+dfsg1-5ubuntu3 [20.3 kB]
Get:12 http://archive.ubuntu.com/ubuntu noble/main amd64 libsasl2-2 amd64 2.1.28+dfsg1-5ubuntu3 [53.2 kB]
Get:13 http://archive.ubuntu.com/ubuntu noble/main amd64 libldap2 amd64 2.6.7+dfsg-1~exp1ubuntu8 [195 kB]
Get:14 http://archive.ubuntu.com/ubuntu noble/main amd64 librtmp1 amd64 2.4+20151223.gitfa8646d.1-2build7 [56.3 kB]
Get:15 http://archive.ubuntu.com/ubuntu noble/main amd64 libssh-4 amd64 0.10.6-2build2 [188 kB]
Get:16 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libcurl4t64 amd64 8.5.0-2ubuntu10.1 [341 kB]
Get:17 http://archive.ubuntu.com/ubuntu noble/main amd64 libldap-common all 2.6.7+dfsg-1~exp1ubuntu8 [31.4 kB]
Get:18 http://archive.ubuntu.com/ubuntu noble/main amd64 libsasl2-modules amd64 2.1.28+dfsg1-5ubuntu3 [69.7 kB]
Fetched 3900 kB in 1s (4713 kB/s)       
Selecting previously unselected package libnvpair3linux.
(Reading database ... 16107 files and directories currently installed.)
Preparing to unpack .../00-libnvpair3linux_2.2.2-0ubuntu9_amd64.deb ...
Unpacking libnvpair3linux (2.2.2-0ubuntu9) ...
Selecting previously unselected package libuutil3linux.
Preparing to unpack .../01-libuutil3linux_2.2.2-0ubuntu9_amd64.deb ...
Unpacking libuutil3linux (2.2.2-0ubuntu9) ...
Selecting previously unselected package libzfs4linux.
Preparing to unpack .../02-libzfs4linux_2.2.2-0ubuntu9_amd64.deb ...
Unpacking libzfs4linux (2.2.2-0ubuntu9) ...
Selecting previously unselected package libzpool5linux.
Preparing to unpack .../03-libzpool5linux_2.2.2-0ubuntu9_amd64.deb ...
Unpacking libzpool5linux (2.2.2-0ubuntu9) ...
Selecting previously unselected package zfsutils-linux.
Preparing to unpack .../04-zfsutils-linux_2.2.2-0ubuntu9_amd64.deb ...
Unpacking zfsutils-linux (2.2.2-0ubuntu9) ...
Selecting previously unselected package zfs-zed.
Preparing to unpack .../05-zfs-zed_2.2.2-0ubuntu9_amd64.deb ...
Unpacking zfs-zed (2.2.2-0ubuntu9) ...
Selecting previously unselected package libnghttp2-14:amd64.
Preparing to unpack .../06-libnghttp2-14_1.59.0-1ubuntu0.1_amd64.deb ...
Unpacking libnghttp2-14:amd64 (1.59.0-1ubuntu0.1) ...
Selecting previously unselected package libpsl5t64:amd64.
Preparing to unpack .../07-libpsl5t64_0.21.2-1.1build1_amd64.deb ...
Unpacking libpsl5t64:amd64 (0.21.2-1.1build1) ...
Selecting previously unselected package publicsuffix.
Preparing to unpack .../08-publicsuffix_20231001.0357-0.1_all.deb ...
Unpacking publicsuffix (20231001.0357-0.1) ...
Selecting previously unselected package libbrotli1:amd64.
Preparing to unpack .../09-libbrotli1_1.1.0-2build2_amd64.deb ...
Unpacking libbrotli1:amd64 (1.1.0-2build2) ...
Selecting previously unselected package libsasl2-modules-db:amd64.
Preparing to unpack .../10-libsasl2-modules-db_2.1.28+dfsg1-5ubuntu3_amd64.deb ...
Unpacking libsasl2-modules-db:amd64 (2.1.28+dfsg1-5ubuntu3) ...
Selecting previously unselected package libsasl2-2:amd64.
Preparing to unpack .../11-libsasl2-2_2.1.28+dfsg1-5ubuntu3_amd64.deb ...
Unpacking libsasl2-2:amd64 (2.1.28+dfsg1-5ubuntu3) ...
Selecting previously unselected package libldap2:amd64.
Preparing to unpack .../12-libldap2_2.6.7+dfsg-1~exp1ubuntu8_amd64.deb ...
Unpacking libldap2:amd64 (2.6.7+dfsg-1~exp1ubuntu8) ...
Selecting previously unselected package librtmp1:amd64.
Preparing to unpack .../13-librtmp1_2.4+20151223.gitfa8646d.1-2build7_amd64.deb ...
Unpacking librtmp1:amd64 (2.4+20151223.gitfa8646d.1-2build7) ...
Selecting previously unselected package libssh-4:amd64.
Preparing to unpack .../14-libssh-4_0.10.6-2build2_amd64.deb ...
Unpacking libssh-4:amd64 (0.10.6-2build2) ...
Selecting previously unselected package libcurl4t64:amd64.
Preparing to unpack .../15-libcurl4t64_8.5.0-2ubuntu10.1_amd64.deb ...
Unpacking libcurl4t64:amd64 (8.5.0-2ubuntu10.1) ...
Selecting previously unselected package libldap-common.
Preparing to unpack .../16-libldap-common_2.6.7+dfsg-1~exp1ubuntu8_all.deb ...
Unpacking libldap-common (2.6.7+dfsg-1~exp1ubuntu8) ...
Selecting previously unselected package libsasl2-modules:amd64.
Preparing to unpack .../17-libsasl2-modules_2.1.28+dfsg1-5ubuntu3_amd64.deb ...
Unpacking libsasl2-modules:amd64 (2.1.28+dfsg1-5ubuntu3) ...
Setting up libnvpair3linux (2.2.2-0ubuntu9) ...
Setting up libbrotli1:amd64 (1.1.0-2build2) ...
Setting up libsasl2-modules:amd64 (2.1.28+dfsg1-5ubuntu3) ...
Setting up libpsl5t64:amd64 (0.21.2-1.1build1) ...
Setting up libnghttp2-14:amd64 (1.59.0-1ubuntu0.1) ...
Setting up libldap-common (2.6.7+dfsg-1~exp1ubuntu8) ...
Setting up libsasl2-modules-db:amd64 (2.1.28+dfsg1-5ubuntu3) ...
Setting up librtmp1:amd64 (2.4+20151223.gitfa8646d.1-2build7) ...
Setting up libsasl2-2:amd64 (2.1.28+dfsg1-5ubuntu3) ...
Setting up libssh-4:amd64 (0.10.6-2build2) ...
Setting up libuutil3linux (2.2.2-0ubuntu9) ...
Setting up publicsuffix (20231001.0357-0.1) ...
Setting up libldap2:amd64 (2.6.7+dfsg-1~exp1ubuntu8) ...
Setting up libzpool5linux (2.2.2-0ubuntu9) ...
Setting up libcurl4t64:amd64 (8.5.0-2ubuntu10.1) ...
Setting up libzfs4linux (2.2.2-0ubuntu9) ...
Setting up zfsutils-linux (2.2.2-0ubuntu9) ...
modprobe: FATAL: Module zfs not found in directory /lib/modules/6.9.12-zabbly+
Created symlink /etc/systemd/system/zfs-import.target.wants/zfs-import-cache.service → /usr/lib/systemd/system/zfs-import-cache.service.
Created symlink /etc/systemd/system/zfs.target.wants/zfs-import.target → /usr/lib/systemd/system/zfs-import.target.
Created symlink /etc/systemd/system/zfs-mount.service.wants/zfs-load-module.service → /usr/lib/systemd/system/zfs-load-module.service.
Created symlink /etc/systemd/system/zfs.target.wants/zfs-load-module.service → /usr/lib/systemd/system/zfs-load-module.service.
Created symlink /etc/systemd/system/zfs.target.wants/zfs-mount.service → /usr/lib/systemd/system/zfs-mount.service.
Created symlink /etc/systemd/system/zfs.target.wants/zfs-share.service → /usr/lib/systemd/system/zfs-share.service.
Created symlink /etc/systemd/system/zfs-volumes.target.wants/zfs-volume-wait.service → /usr/lib/systemd/system/zfs-volume-wait.service.
Created symlink /etc/systemd/system/zfs.target.wants/zfs-volumes.target → /usr/lib/systemd/system/zfs-volumes.target.
Created symlink /etc/systemd/system/multi-user.target.wants/zfs.target → /usr/lib/systemd/system/zfs.target.
zfs-import-scan.service is a disabled or a static unit, not starting it.
Setting up zfs-zed (2.2.2-0ubuntu9) ...
Created symlink /etc/systemd/system/zed.service → /usr/lib/systemd/system/zfs-zed.service.
Created symlink /etc/systemd/system/zfs.target.wants/zfs-zed.service → /usr/lib/systemd/system/zfs-zed.service.
Processing triggers for libc-bin (2.39-0ubuntu8.2) ...

root@u1:~# zfs list -t all
NAME                                   USED  AVAIL  REFER  MOUNTPOINT
dakara                                 273G   533G    98K  none
dakara/incus                           119G   533G   105K  legacy
dakara/incus/custom                   7.83G   533G   105K  legacy
dakara/incus/custom/default_u1-extra    98K  10.0G    98K  legacy
root@u1:~# zfs create dakara/incus/custom/default_u1-extra/foo
root@u1:~# zfs list -t all
NAME                                       USED  AVAIL  REFER  MOUNTPOINT
dakara                                     273G   533G    98K  none
dakara/incus                               119G   533G   105K  legacy
dakara/incus/custom                       7.83G   533G   105K  legacy
dakara/incus/custom/default_u1-extra       196K  10.0G    98K  legacy
dakara/incus/custom/default_u1-extra/foo    98K  10.0G    98K  legacy
root@u1:~# mount -t zfs dakara/incus/custom/default_u1-extra/foo /srv/
root@u1:~# df -h
Filesystem                                Size  Used Avail Use% Mounted on
dakara/incus/containers/u1                 21G  334M   20G   2% /
none                                      492K  4.0K  488K   1% /dev
efivarfs                                  128K   36K   88K  29% /sys/firmware/efi/efivars
tmpfs                                     100K     0  100K   0% /dev/incus
tmpfs                                     100K     0  100K   0% /dev/.incus-mounts
tmpfs                                      32G     0   32G   0% /dev/shm
tmpfs                                      13G  124K   13G   1% /run
tmpfs                                     5.0M     0  5.0M   0% /run/lock
dakara/incus/custom/default_u1-extra       10G  128K   10G   1% /mnt
dakara/incus/custom/default_u1-extra/foo   10G  128K   10G   1% /srv
root@u1:~#