The template "debian" in LXC on Debain Wheezy currently (early March 2014) doesn't disable services that may cause problems.
The key service causing problems in this case was 'umountroot', fix by running
chroot /path/to/containername/rootfs /usr/sbin/update-rc.d -f umountroot remove
Other services to remove include
There a probably other ways of solving this issue, such as dropping capabilities. Another way to solve it is to change the template, such as suggested by http://cblog.burkionline.net/lxc-linux-container/, but note that it doesn't include umountroot as one of the services disabled and will need tweaks.
Запутанная часть этого состоит в том, что повторное подключение только для чтения происходит после завершения работы гостя и распознается при следующем запуске .
На это поведение также указывают эти сообщения при попытке запустить lxc-start
с файловой системой только для чтения:
lxc-start: failed to pin the container's rootfs
lxc-start: failed to spawn 'containername'
lxc-start: No such file or directory - failed to remove cgroup '/sys/fs/cgroup//lxc/containername'
Также не удаляется хост-часть уже созданных сетевых интерфейсов.
Итак, ifconfig
перечисляет оставшиеся записи, например vethuKwnid
.
Благодаря Ubuntu Serverguide я убедился, что запуска такого контейнера достаточно :
sudo lxc-start -s lxc.cap.drop=sys_admin -n containername