- lxd: 2.18-0ubuntu6
- lxc --version: 2.18
- host distro: Ubuntu 17.10 (Artful) with Kernel 4.13.0-19-generic
- container distro: Ubuntu 16.04.3
- Gain privilege and allow
mount
in the apparmor policy namespace:
lxc config set guest-container1 security.privileged true
lxc config set guest-container1 raw.apparmor "mount,"
- Check currently used loop devices on host:
ls -ln /dev/loop*
# eg.:
brw-rw---- 1 0 6 7, 4 Dec 13 11:21 /dev/loop4
brw-rw---- 1 0 6 7, 5 Dec 13 11:21 /dev/loop5
brw-rw---- 1 0 6 7, 6 Dec 13 11:21 /dev/loop6
brw-rw---- 1 0 6 7, 7 Dec 13 11:21 /dev/loop7
brw-rw---- 1 0 6 7, 8 Dec 19 09:48 /dev/loop8
brw-rw---- 1 0 6 7, 9 Dec 19 09:47 /dev/loop9
crw-rw---- 1 0 6 10, 237 Dec 13 11:21 /dev/loop-control
- Added loop controller and device for container
lxc config device add guest-container1 loop-control unix-char path=/dev/loop-control
(now add the loop{N+1} device for the guest accroding to step 2)
lxc config device add guest-container1 loop10 unix-block path=/dev/loop10
- Restart and verify the changes:
lxc stop guest-container1
lxc start guest-container1
lxc exec guest-container1 bash
(then, inside guest-container1 :)
mount the-image-file /the-mount-poiont
Now continue to what you need to get done :)
lxc restart security.privileged
is throwing an error?!?!
Shouldn't it be
lxc restart guest-container1