Mounting images when running in an LXD container does not work

Hi,

I am exploring the image mount functions in an LXD container. The mount button works but the image file listing is empty.

ps -ax shows:
/usr/bin/urbackupsrv mount-vhd -f /srv/urbackup/wintest/170224-0738_Image_C/Image_C_170224-0738.vhdz -m /srv/urbackup/wintest/170224-0738_Image_C/contents -t /srv/urbackup/wintest/170224-0738_Image_C/device -o uid=112,gid=116,allow_root

ls -l /srv/urbackup/wintest/170220-1028_Image_C shows:
d????????? ? ? ? ? ? device

urbackup-fuse.log shows:
2017-02-28 15:25:22: Mounting VHD via fuse…
2017-02-28 15:25:22: Volume offset is 524288 bytes. Configure via --offset

The container is privileged and has FUSE support:
config:
security.privileged: “true”
devices:
fuse:
major: “10”
minor: “229”
path: /dev/fuse
type: unix-char

Other FUSE mounts work fine.

A similar issue with sshfs is fixed by using -o allow_other. This may be a hint of what is going wrong here. Any thoughts on what we can do to make this work?

Could you run urbackup_mount_helper manually and have a look at the output? Like this: Error creating mountpoint [urbackup_mount_helper]

$ urbackup_mount_helper mount wintest 170224-0738_Image_C Image_C_170224-0738.vhdz
guestunmount: failed to unmount /srv/urbackup/wintest/170224-0738_Image_C/contents: fusermount: bad mount point /srv/urbackup/wintest/170224-0738_Image_C/contents: Permission denied
fusermount: bad mount point /srv/urbackup/wintest/170224-0738_Image_C/device: Permission denied
fusermount: bad mount point /srv/urbackup/wintest/170224-0738_Image_C/device: Permission denied
Loading FUSE kernel module…
modprobe: ERROR: …/libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file ‘/lib/modules/4.4.0-63-generic/modules.dep.bin’
modprobe: FATAL: Module fuse not found in directory /lib/modules/4.4.0-63-generic
Starting VHD background process…
Waiting for background process to become available…
Timeout while waiting for background process. Please see logfile (/var/log/urbackup-fuse.log) for error details.
UrBackup mount process returned non-zero return code

Here is the full ls -l output:

root@urbackup:/srv/urbackup/wintest/170224-0738_Image_C# ls -l
ls: cannot access ‘device’: Permission denied
total 889895
drwxr-x— 2 urbackup urbackup 2 Feb 28 16:03 contents
d??? ? ? ? ? ? device
-rwxr-x— 1 urbackup urbackup 909057292 Feb 24 07:56 Image_C_170224-0738.vhdz
-rwxr-x— 1 urbackup urbackup 1293068 Feb 24 07:38 Image_C_170224-0738.vhdz.cbitmap
-rwxr-x— 1 urbackup urbackup 2586080 Feb 24 07:56 Image_C_170224-0738.vhdz.hash
-rwxr-x— 1 urbackup urbackup 563 Feb 24 07:38 Image_C_170224-0738.vhdz.mbr
-rwxr-x— 1 urbackup urbackup 0 Feb 24 07:56 Image_C_170224-0738.vhdz.sync

One thing I noticed is that /dev/fuse is created 660 in LXD instead of the usual 666. Granting urbackup access to this changes the result, but is not a fix:

ls -l
total 889895
drwxr-x— 2 urbackup urbackup 2 Feb 28 16:20 contents
drwxr-xr-x 2 root root 0 Jan 1 1970 device
-rwxr-x— 1 urbackup urbackup 909057292 Feb 24 07:56 Image_C_170224-0738.vhdz
-rwxr-x— 1 urbackup urbackup 1293068 Feb 24 07:38 Image_C_170224-0738.vhdz.cbitmap
-rwxr-x— 1 urbackup urbackup 2586080 Feb 24 07:56 Image_C_170224-0738.vhdz.hash
-rwxr-x— 1 urbackup urbackup 563 Feb 24 07:38 Image_C_170224-0738.vhdz.mbr
-rwxr-x— 1 urbackup urbackup 0 Feb 24 07:56 Image_C_170224-0738.vhdz.sync

contents is still empty, and urbackup_mount_helper shows:
$ urbackup_mount_helper mount wintest 170224-0738_Image_C Image_C_170224-0738.vhdz
fusermount: failed to unmount /srv/urbackup/wintest/170224-0738_Image_C/device: Invalid argument
fusermount: failed to unmount /srv/urbackup/wintest/170224-0738_Image_C/device: Invalid argument
Loading FUSE kernel module…
modprobe: ERROR: …/libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file ‘/lib/modules/4.4.0-63-generic/modules.dep.bin’
modprobe: FATAL: Module fuse not found in directory /lib/modules/4.4.0-63-generic
Starting VHD background process…
Waiting for background process to become available…
Timeout while waiting for background process. Please see logfile (/var/log/urbackup-fuse.log) for error details.
UrBackup mount process returned non-zero return code

No change in /var/log/urbackup-fuse.log