launch a linux container

此篇是工作笔记:

lxc-0.9.0 and lxc1.0.0 的 POWER 架构demo板的linux kernel配置:

kernel config:

General setup  --->
        [*] Control Group support  --->
                [*]   Example debug cgroup subsystem                                                                                  
                [*]   Freezer cgroup subsystem
                [*]   Device controller for cgroups
                [*]   Cpuset support
                [*]     Include legacy /proc/<pid>/cpuset file
                [*]   Simple CPU accounting cgroup subsystem
                [*]   Resource counters
                [*]     Memory Resource Controller for Control Groups
                [*]       Memory Resource Controller Swap Extension
                [*]         Memory Resource Controller Swap Extension enabled by default
                [*]       Memory Resource Controller Kernel Memory accounting (EXPERIMENTAL)
                [*]     HugeTLB Resource Controller for Control Groups
                [*]   Group CPU scheduler  --->
                [*]   Block IO controller
                [*]     Enable Block IO controller debugging
        [*] Namespaces support  --->
                [*]   UTS namespace
                [*]   IPC namespace
                [*]   PID Namespaces
                [*]   Network namespace
[*] Networking support  --->
        Networking options  --->
                <*> 802.1d Ethernet Bridging
                [*]   IGMP/MLD snooping
                <*> 802.1Q VLAN Support
                [*]   GVRP (GARP VLAN Registration Protocol) support
Device Drivers  --->
        [*] Network device support  --->
                <*>     MAC-VLAN support (EXPERIMENTAL)
                <*>       MAC-VLAN based tap driver (EXPERIMENTAL)
                <*>     Virtual ethernet pair device
        Character devices  --->
                [*]   Support multiple instances of devpts
File systems  --->
        <*> Second extended fs support
        [*]   Ext2 extended attributes
        [*]     Ext2 POSIX Access Control Lists
        [*]   Ext3 extended attributes
        [*]     Ext3 POSIX Access Control Lists
       <*> The Extended 4 (ext4) filesystem
        [*]   Ext4 POSIX Access Control Lists
       

 busybox config

[*] Busybox settings

         [*]    Build Options
                      [*]      Build BusyBox as a static binary (no shared libs)           

               Networking Utilities

                   [*] inetd

                   [ ] Support RPC services

 

If enabling  below  udhcp client configure

  Networking Utilities

  [ *]     udhcp client (udhcpc)

  Need corresponding bootargs :

  add ip=dhcp in bootargs

 If disabling below  udhcp client configure

  Networking Utilities

  [ ]     udhcp client (udhcpc)

  Need not additional configration for bootargs.

  Need not additional configration for bootargs.

rootfs configuration

Add lxc package.

Add hv-test package if doing hv-test.

------------------------------------------------------------------------------------------

basic steps:

1. bootup linux.

2. mount the 'cgroups' pseudo-filesystem.
#mkdir /cgroup
#mount -t tmpfs cgroup /cgroup
#mkdir /cgroup/{freezer,devices,memory,cpuacct,cpuset,cpu}
#mount -t cgroup -o freezer cgroup /cgroup/freezer
#mount -t cgroup -o devices cgroup /cgroup/devices
#mount -t cgroup -o memory cgroup /cgroup/memory
#mount -t cgroup -o cpuacct cgroup /cgroup/cpuacct
#mount -t cgroup -o cpuset cgroup /cgroup/cpuset

#mount -t cgroup -o cpu cgroup /cgroup/cpu

3. check the dir " /var/lib/lxc" existing or not

    # ls /var/lib/lxc

   If it does not exist please  create the following working folder.
   # mkdir /var/lib/lxc

4. # lxc-create -n vm -t busybox -f /usr/share/doc/lxc/examples/lxc-no-netns.conf

5.watch working directory:

#ls /var/lib/lxc/

6.# lxc-start -n ctx1

7.# lxc-stop -n ctx1

8.# lxc-destroy -n ctx1



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值