[libvirt-users] read-only rootfs for lxc containers

And speaking of running out of a shared read-only root, I get the following error when I attempt it: error: Failed to start domain hw error: internal error guest failed to start: PATH=/bin:/sbin TERM=linux LIBVIRT_LXC_UUID=38320e75-1ba0-d85a-6138-532a3a66f13d LIBVIRT_LXC_NAME=hw /bin/bash 2011-12-08 15:31:41.945: 1: info : libvirt version: 0.9.7 2011-12-08 15:31:41.945: 1: error : lxcContainerPivotRoot:345 : Failed to create /mnt/vmroot/.oldroot: Read-only file system 2011-12-08 15:31:41.945: 2666: info : libvirt version: 0.9.7 2011-12-08 15:31:41.945: 2666: error : lxcControllerRun:1210 : error receiving signal from container: Input/output error XML: http://pastebin.com/Q0p5irBH Cheers, -C-

On Thu, Dec 08, 2011 at 07:34:13AM -0800, Chris Haumesser wrote:
And speaking of running out of a shared read-only root, I get the following error when I attempt it:
error: Failed to start domain hw error: internal error guest failed to start: PATH=/bin:/sbin TERM=linux LIBVIRT_LXC_UUID=38320e75-1ba0-d85a-6138-532a3a66f13d LIBVIRT_LXC_NAME=hw /bin/bash 2011-12-08 15:31:41.945: 1: info : libvirt version: 0.9.7 2011-12-08 15:31:41.945: 1: error : lxcContainerPivotRoot:345 : Failed to create /mnt/vmroot/.oldroot: Read-only file system 2011-12-08 15:31:41.945: 2666: info : libvirt version: 0.9.7 2011-12-08 15:31:41.945: 2666: error : lxcControllerRun:1210 : error receiving signal from container: Input/output error
Hmm, so your actual filesystem on the host side is read only ? I'd not considered that possibilty. When I've done read-only roots for containers, the host side was always writable, and then I used '<readonly/>' in the <filesystem> tag to make the container see it readoly. I'll have to think about how to make it work when the host FS itself is readonly. Probably have to define some location that is guarenteed to exist, instead of trying to create a '/.oldroot' location ourselves. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

Daniel P. Berrange wrote:
Hmm, so your actual filesystem on the host side is read only ?
Yup, mounting a squashfs in RAM.
I'll have to think about how to make it work when the host FS itself is readonly. Probably have to define some location that is guarenteed to exist, instead of trying to create a '/.oldroot' location ourselves.
I suppose so, yes. What is the purpose of .oldroot? When I switch to a rw filesystem, I see that .oldroot gets created, but it is just an empty directory. Cheers, -C-

On Thu, Dec 08, 2011 at 07:47:28AM -0800, Chris Haumesser wrote:
Daniel P. Berrange wrote:
Hmm, so your actual filesystem on the host side is read only ?
Yup, mounting a squashfs in RAM.
I'll have to think about how to make it work when the host FS itself is readonly. Probably have to define some location that is guarenteed to exist, instead of trying to create a '/.oldroot' location ourselves.
I suppose so, yes. What is the purpose of .oldroot? When I switch to a rw filesystem, I see that .oldroot gets created, but it is just an empty directory.
It is used as an intermediate temporary location when we pivot from one root filesystem to another, so you shouldn't expect to see anything there. We just need a directory somewhere to pivot on, and chose to use /.oldroot Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (2)
-
Chris Haumesser
-
Daniel P. Berrange