[lxc-users] Creating a Linux container that is just a sandbox of my actual installation

james harvey jamespharvey20 at gmail.com
Sat May 30 23:58:02 UTC 2015


I want to create a container that starts out being identical to my
top-level no-container installation.  I want any changes performed
within the container to be kept in the container.  I want anything
added to my top-level no-container installation to automatically show
up in already made containers.

It looks like I want to use an overlayfs.  I'm not having success.

$ sudo dnf install lxc
$ sudo lxc-create -n test -t none
lxc-create: lxc_create.c: main: 274 Error creating container test
$ sudo lxc-create -n test -t none -B overlayfs:/:/var/lib/lxc/test
lxc-create: lxc_create.c: main: 274 Error creating container test
$ echo "lxc.rootfs = overlayfs:/:/var/lib/lxc/test" > test.lxc.config
$ sudo lxc-create -n test -t none -f test.lxc.config
lxc-create: lxc_create.c: main: 274 Error creating container test
$ sudo mkdir /var/lib/lxc/test
$ sudo lxc-create -n test -t none -f test.lxc.config
lxc-create: lxc_create.c: main: 274 Error creating container test
$ sudo lxc-create -n test -t none -f test.lxc.config
lxc-create: lxc_create.c: main: 274 Error creating container test
$ sudo dnf install lxc-templates
$ sudo lxc-create -n cent -t centos
(properly runs, after I make /usr/bin/yum a symlink to /usr/bin/yum-deprecated)

I think I need -t none though, since I don't want new packages to be
installed inside my container.

If I create a container and I "touch hello.message", I basically want
the entire container to be taking up only a few bytes for the extra
filehandle -- plus whatever "overhead" lxc has -- but without
basically duplicating a full install.


More information about the lxc-users mailing list