You are not logged in.
Pages: 1
I'm attempting to use a loopback device inside a container, to mount some image file:
> sudo losetup /dev/loop0 test.img
losetup: /dev/loop0: failed to set up loop device: No such file or directory
/dev/loop0 indeed doesn't exist inside the container, and
> sudo mknod /dev/loop0 b 7 0
mknod: ‘/dev/loop0’: Operation not permitted
How can I make this work? Does the container need some cgroup permission that it might not have?
Addition: I found out that I need more privileges, so I added
--capability=all
to the systemd-nspawn invocation. And executing
echo b 7:0 rwm > /sys/fs/cgroup/devices/machine.slice/machine-NAME.scope/devices.allow
on the host allows me to mknod. But then I get a
losetup: /dev/loop0: failed to set up loop device: Inappropriate ioctl for device
and I would suspect that it has to do with /dev being a tmpfs rather than a tmpfs in the container; but I'm guessing. So far, progress, but no cigar, in other words.
Last edited by jernst (2015-06-24 21:19:07)
Offline
This is backtracking to the basics, but have you made sure the loop kernel module is loaded?
Offline
p0x8: Yes. It works fine on the host, and the modules loaded from the host also show up in the container.
Offline
Pages: 1