[Lxc-users] lxc configuration bug

Serge Hallyn serge.hallyn at ubuntu.com
Fri Feb 22 14:22:32 UTC 2013


Quoting Papp Tamas (tompos at martos.bme.hu):
> On 02/20/2013 12:06 AM, Papp Tamas wrote:
> >On 02/19/2013 11:53 PM, Serge Hallyn wrote:
> >>
> >>
> >>At this point, there will be a /var/lib/lxc/ltest/config which will
> >>list lxc.rootfs = /var/lib/lxc/ltest/rootfs.  So these steps are not
> >>quite what you want.
> >>
> >>Perhaps you just want to
> >>
> >>    sudo lxc-create -n ltest -t ubuntu
> >>    sudo mkdir -p /data/lxc/ltest
> >>    sudo mv /var/lib/lxc/ltest/rootfs /data/lxc/ltest/
> >>    sudo sed -i 's/@/var/lib/lxc@/data/lxc@' /var/lib/lxc/ltest/config
> >>    sudo lxc-start -n ltest
> >>    [ check mac address ]
> >>    sudo lxc-stop -n ltest
> >>    [ change mac address in config ]
> >>    sudo lxc-start -n ltest
> >>    [ check mac address ]
> >
> >
> >You're right. Certainly I missed sed from steps.
> 
> hi Serge and Others,
> 
> 
> Do you have any idea about this?

About what?  What I described above should work.

Note also that the staging branch now supports '-P|--lxcpath' for all
commands, so you could simply

	sudo lxc-create -t ubuntu -n r1 -P /data/lxc
	sudo lxc-start -n r1 -P /data/lxc

or for that matter
	cat >> /etc/lxc/lxc.conf << EOF
	lxcpath=/data/lxc
	EOF
	sudo lxc-create -t ubuntu -n r1
	sudo lxc-start -n r1

The only thing not yet merged is support in the cgroup code for being
able to run containers named r1, at the same time, from multiple
lxcpaths.

-serge




More information about the lxc-users mailing list