[Lxc-users] problem in start lxc container

Fajar A. Nugraha list at fajar.net
Thu Sep 20 03:24:15 UTC 2012


On Thu, Sep 20, 2012 at 10:02 AM, Binknight <zheng_huabin at 163.com> wrote:
> hi all,
>
>     After searching for a while, I found there are many different
> introductions to install lxc container, but do not find a step by step
> tutorial that works for general purpose.

At this moment using Ubuntu 12.04 would probably be easier. It just works.

https://help.ubuntu.com/12.04/serverguide/lxc.html

... or see simplified instructions on my wiki:
http://wiki.1tux.org/wiki/Lxc/Installation

>
>     I have a host running fedora 16, and I want to install a lxc container
> that I can run some apps in it. The reason i need such a container is that
> 1) I will limit the resource usage of these apps, and 2) the apps' running
> environment is different
>  with the host's.
>

Those are good reasons to use lxc. However AFAIK you can't (yet?) have
a container which uses systemd, so even when you can use F16 as host,
you can't use it as guest container.

>     I tried the following steps: 1) install libcgroup, 2) install lxc, both
> the two are downloaded from sf.net.
>
>     By run the lxc-fedora under the lxc's templates
> directory(/usr/local/lib/lxc/templates), it seems that the container is
> installed successfully. It says:
>     "container is configured for lxc.network.type=veth and
> lxc.network.link=virbr0 (which is default if you have libvirt runnig)   "
>
>     then i checked the libvirt by : service --status-all
>
>     libvirtd.service - LSB: daemon for libvirt virtualization API
>           Loaded: loaded (/etc/rc.d/init.d/libvirtd)
>           Active: active (running) since Thu, 20 Sep 2012 10:18:20 +0800;
> 23min ago
>     but when i try to start my container by lxc-start -n test1 -f
> test1/conf,it logout my host. After i login again, all is the same as before
> start container. So i am confused about how i can start my container or is
> there something i have skipped in the install process?

I'm not sure about F16. I'm guessing the problem is that your
container accesses the same tty as the host.

Again, I recommend to use ubuntu for host. You can then have fedora
(up to f14), rhel/centos, ubuntu, and other
sysvinit-or-upstart-based-OS as guest,

-- 
Fajar




More information about the lxc-users mailing list