[Lxc-users] help regarding lxc
Canhua
dreameration at gmail.com
Thu Aug 25 07:56:37 UTC 2011
hi, You may start container just like this:
lxc-start -n vm2
without -f ...
On Thu, Aug 25, 2011 at 3:09 PM, nishant mungse <nishantmungse at gmail.com> wrote:
> hiii
> thnks Canhua.
> But still there is a problem
> Here are thing i did
> 1) lxc-create -n vm2 -f /home/nishant/vm2/lxc-macvlan.conf -t sshd
> Generating public/private rsa key pair.
> Enter passphrase (empty for no passphrase):
> Enter same passphrase again:
> Your identification has been saved in
> /var/lib/lxc/vm2/rootfs/etc/ssh/ssh_host_rsa_key.
> Your public key has been saved in
> /var/lib/lxc/vm2/rootfs/etc/ssh/ssh_host_rsa_key.pub.
> The key fingerprint is:
> 28:b5:ba:f9:ab:48:c2:7f:e0:3e:a2:f8:8f:c8:7b:3e root at ubuntu
> The key's randomart image is:
> +--[ RSA 2048]----+
> | |
> | |
> | . |
> | . o |
> | . o S |
> |. . o |
> |..o o |
> |o=.E + |
> |=+X=Ooo. |
> +-----------------+
> Generating public/private dsa key pair.
> Enter passphrase (empty for no passphrase):
> Enter same passphrase again:
> Your identification has been saved in
> /var/lib/lxc/vm2/rootfs/etc/ssh/ssh_host_dsa_key.
> Your public key has been saved in
> /var/lib/lxc/vm2/rootfs/etc/ssh/ssh_host_dsa_key.pub.
> The key fingerprint is:
> b6:c6:1b:ad:77:ab:4e:6e:f9:cd:c2:6d:af:d7:d4:f8 root at ubuntu
> The key's randomart image is:
> +--[ DSA 1024]----+
> | |
> | |
> | |
> | |
> | S ..|
> | o o . o|
> | = oo . o.|
> | . *+ +oo E|
> | o+++o+++.|
> +-----------------+
> 'sshd' template installed
> 'vm2' created
> 2) When i did
> lxc-start -n vm2 -f /home/nishant/vm2//lxc-macvlan.conf /bin/bash
> After this command the terminal hangs....
> 3)lxc-ls
> vm2
> 4)lxc-info -n vm2
> vm2 is stopped
> am i right in executing command or is there something i m missing in
> executing......
> Plz help me.
> The only change i did is copied conf file to loc /home/nishant/vm2 and
> changed lxc.rootfs=/home/nishant/vm2 and changed the lxc.utsname = vm2.
> Do i need to make some changes in /etc/fstab and creating control groups.
>
>
>
>
> Regards,
> Nishant.
>
> On Thu, Aug 25, 2011 at 5:36 AM, Canhua <dreameration at gmail.com> wrote:
>>
>> You may have missed to lxc-create the container. You shoulld run:
>> lxc-create -n [container-name] -f [/path/to/config-file] -t
>> [template-name]
>> for example lxc-create -n vm0 -f [lxc-veth.conf] -t debian
>>
>> On Wed, Aug 24, 2011 at 10:17 PM, nishant mungse
>> <nishantmungse at gmail.com> wrote:
>> > hello Canhua,
>> > I did apt-get bootstrap and installed it.
>> > And now when i did ::
>> > lxc-start -n vm0 [-f config file] -d
>> > and after that i checked
>> > lxc-info -n vm0
>> > o/p was vm0 is stopped.
>> > I did the same thing which is given in that site you mentioned.
>> > Wrote all the things in config file which are given in that site but
>> > still
>> > it is not working.
>> > These are things i did::
>> > 1) Copied all the contents of config path and only changed ipv4 add and
>> > hwd
>> > address .
>> > Container with network virtualized using the macvlan device driver
>> > lxc.utsname = vm0
>> > lxc.network.type = macvlan
>> > lxc.network.flags = up
>> > lxc.network.link = eth0
>> > lxc.network.hwaddr = **
>> > lxc.network.ipv4 = **
>> > lxc.tty = 4
>> > lxc.pts = 1024
>> > lxc.rootfs = /srv/lxc/vm0/rootfs
>> > lxc.cgroup.devices.deny = a
>> > # /dev/null and zero
>> > lxc.cgroup.devices.allow = c 1:3 rwm
>> > lxc.cgroup.devices.allow = c 1:5 rwm
>> > # consoles
>> > lxc.cgroup.devices.allow = c 5:1 rwm
>> > lxc.cgroup.devices.allow = c 5:0 rwm
>> > lxc.cgroup.devices.allow = c 4:0 rwm
>> > lxc.cgroup.devices.allow = c 4:1 rwm
>> > # /dev/{,u}random
>> > lxc.cgroup.devices.allow = c 1:9 rwm
>> > lxc.cgroup.devices.allow = c 1:8 rwm
>> > lxc.cgroup.devices.allow = c 136:* rwm
>> > lxc.cgroup.devices.allow = c 5:2 rwm
>> > # rtc
>> > lxc.cgroup.devices.allow = c 254:0 rwm
>> >
>> >
>> > 2) wrote cgroup /cgroup cgroup defaults 0 0 in /etc/fstab
>> >
>> > 3) mount cgroup
>> > 4) after that i did::
>> > lxc-start -n vm0 -f /var/lib/lxc/vm0/lxc-macvlan.conf -d
>> > and lxc-info -n vm0 gives "vm0 is stopped"
>> > 4) and lxc-checkconfig gave
>> > Kernel config /proc/config.gz not found, looking in other places...
>> > Found kernel config file /boot/config-2.6.35-22-generic
>> > --- Namespaces ---
>> > Namespaces: enabled
>> > Utsname namespace: enabled
>> > Ipc namespace: enabled
>> > Pid namespace: enabled
>> > User namespace: enabled
>> > Network namespace: enabled
>> > Multiple /dev/pts instances: enabled
>> > --- Control groups ---
>> > Cgroup: enabled
>> > Cgroup namespace: enabled
>> > Cgroup device: enabled
>> > Cgroup sched: enabled
>> > Cgroup cpu account: enabled
>> > Cgroup memory controller: enabled
>> > Cgroup cpuset: enabled
>> > --- Misc ---
>> > Veth pair device: enabled
>> > Macvlan: enabled
>> > Vlan: enabled
>> > Note : Before booting a new kernel, you can check its configuration
>> > usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig
>> > Please help me out ASAP.
>> > Regards,
>> > Nishant.
>> >
>> > On Wed, Aug 24, 2011 at 5:25 PM, Canhua <dreameration at gmail.com> wrote:
>> >>
>> >> It seems you didn't bootstrap any distribution. Please see
>> >> http://blog.foaa.de/2010/05/lxc-on-debian-squeeze/ , note especially
>> >> the use of debootstrap
>> >>
>> >> On Wed, Aug 24, 2011 at 5:30 PM, nishant mungse
>> >> <nishantmungse at gmail.com>
>> >> wrote:
>> >> > Hii all
>> >> > I am using lxc for creating containers.
>> >> > But when i create lxc container using "lxc-create -n abc" it creates
>> >> > a
>> >> > abc
>> >> > container and when i do lxc-info -n abc its show "abc is stopped" and
>> >> > when i
>> >> > perform "lxc-start -n abc [-f conf file ]" the terminal hangs and if
>> >> > do
>> >> > "lxc-execute -n abc [-f conf file ] \bin\bash" terminal hangs.
>> >> > It is not even working for "/usr/bin/lxc-execute -n foo -f
>> >> > /usr/share/doc/lxc/examples/lxc-macvlan.conf /bin/bash".
>> >> > I am using UBUNTU 10.10.
>> >> > Plz help me ASAP.
>> >> > Regards,
>> >> > Nishant.
>> >> >
>> >> >
>> >> > ------------------------------------------------------------------------------
>> >> > EMC VNX: the world's simplest storage, starting under $10K
>> >> > The only unified storage solution that offers unified management
>> >> > Up to 160% more powerful than alternatives and 25% more efficient.
>> >> > Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
>> >> > _______________________________________________
>> >> > Lxc-users mailing list
>> >> > Lxc-users at lists.sourceforge.net
>> >> > https://lists.sourceforge.net/lists/listinfo/lxc-users
>> >> >
>> >> >
>> >
>> >
>
>
More information about the lxc-users
mailing list