[Lxc-users] problem in start lxc container
Binknight
zheng_huabin at 163.com
Fri Sep 21 13:05:19 UTC 2012
hi Fajar,
thank you for your advise and wiki, that provides a lot of useful informations.
My test environment is FC16 and product environment is centos 6.3. So I have to set up lxc in FC or centos. I tested in centos and found that lxc-0.7.5 will work(I previously use the 0.8.0rc). Now I can ping the host from my container and vice versa, but I can not access to other networks(eg. ping www.google.com will fail). My network configure is,
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = virbr0
lxc.network.name = eth0
lxc.network.mtu = 1500
lxc.network.ipv4 = 192.168.122.2/24
the bridge "virbr0" is create automatically by install libvirt.
At 2012-09-20 11:24:15,"Fajar A. Nugraha" <list at fajar.net> wrote:
>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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20120921/a3739022/attachment.html>
More information about the lxc-users
mailing list