Get started with lxc.
来源:互联网 发布:刘道成 mysql 百度云 编辑:程序博客网 时间:2024/05/10 12:52
Finally, I got some free time!!!!!!
Get lxc started in RHEL. Only for newbie to lxc.
Normally, we clone the lxc from github.com
git clone http://github.com/lxc/lxc.git
Then compile it.
[root@atest-guest lxc]# ./autogen.sh [root@atest-guest lxc]# ./configure [root@atest-guest lxc]# make[root@atest-guest lxc]# make install
But unfortunately, there are some problem to start enjoying lxc in rhel.
(1). Default lib is /usr/local/lib/. But it is not in the default libdir in RHEL.
[root@atest-guest lxc]# lxc-lslxc-config: error while loading shared libraries: liblxc.so.1: cannot open shared object file: No such file or directorylxc-config: error while loading shared libraries: liblxc.so.1: cannot open shared object file: No such file or directorylxc-config: error while loading shared libraries: liblxc.so.1: cannot open shared object file: No such file or directory.[root@atest-guest lxc]# locate liblxc.so/data/lxc/src/lxc/liblxc.so/usr/local/lib/liblxc.so/usr/local/lib/liblxc.so.1/usr/local/lib/liblxc.so.1.1.0.alpha2[root@atest-guest lxc]# ln -s /usr/local/lib/liblxc.so.1 /usr/lib64/liblxc.so.1[root@atest-guest lxc]# lxc-ls[root@atest-guest lxc]# echo $?0
(2). Please create a br named as lxcbr0.
[root@atest-guest lxc]# lxc-create -t sshd -n sshdGenerating public/private rsa key pair.Your identification has been saved in /usr/local/var/lib/lxc/ssh1/rootfs/etc/ssh/ssh_host_rsa_key.Your public key has been saved in /usr/local/var/lib/lxc/ssh1/rootfs/etc/ssh/ssh_host_rsa_key.pub.The key fingerprint is:9a:e8:af:2c:d9:2e:4a:d1:0d:b2:a8:23:41:bc:05:72 root@atest-guestThe key's randomart image is:+--[ RSA 2048]----+|..E ||o.. || + o ||o * o ||o+ . . S ||... . o ||+. o. o ||o.+o. ||.. +=o. |+-----------------+Generating public/private dsa key pair.Your identification has been saved in /usr/local/var/lib/lxc/ssh1/rootfs/etc/ssh/ssh_host_dsa_key.Your public key has been saved in /usr/local/var/lib/lxc/ssh1/rootfs/etc/ssh/ssh_host_dsa_key.pub.The key fingerprint is:de:f9:31:bd:ec:7a:d7:4c:9f:e3:0c:ee:97:aa:6b:6d root@atest-guestThe key's randomart image is:+--[ DSA 1024]----+| || || || || S || . . . . .|| . o +..o=|| o.E+*=|| .oBBB+.|+-----------------+[root@atest-guest lxc]# lxc-start -n sshd --foregroundlxc-start: conf.c: instantiate_veth: 2855 failed to attach 'vethPVKSIK' to the bridge 'lxcbr0': Operation not permittedlxc-start: conf.c: lxc_create_network: 3138 failed to create netdevlxc-start: start.c: lxc_spawn: 829 failed to create the networklxc-start: start.c: __lxc_start: 1088 failed to spawn 'sshd'lxc-start: lxc_start.c: main: 345 The container failed to start.lxc-start: lxc_start.c: main: 349 Additional information can be obtained by setting the --logfile and --logpriority options.[root@atest-guest lxc]# brctl showbridge namebridge idSTP enabledinterfaces[root@atest-guest lxc]# brctl addbr lxcbr0[root@atest-guest linux_btrfs]# brctl showbridge namebridge idSTP enabledinterfaceslxcbr08000.000000000000no
(3). Error about capabilities.
[root@atest-guest lxc]# lxc-start -n sshd --foregroundlxc-start: conf.c: setup_caps: 2337 unknown capability sys_modulelxc-start: conf.c: lxc_setup: 4172 failed to drop capabilitieslxc-start: start.c: do_start: 688 failed to setup the containerlxc-start: sync.c: __sync_wait: 51 invalid sequence number 1. expected 2lxc-start: start.c: __lxc_start: 1088 failed to spawn 'sshd'lxc-start: lxc_start.c: main: 345 The container failed to start.lxc-start: lxc_start.c: main: 349 Additional information can be obtained by setting the --logfile and --logpriority options.[root@atest-guest lxc]# yum install libcap-devel.x86_64 -y[root@atest-guest lxc]# ./configure ....................Security features: - Apparmor: no - Linux capabilities: yes - seccomp: no - SELinux: no - cgmanager: no..........................[root@atest-guest lxc]# make -j 4[root@atest-guest lxc]# make install[root@atest-guest lxc]# lxc-start -n sshd [root@atest-guest lxc]# echo $?0
0 0
- Get started with lxc.
- Get started with MySql
- Get started with WPF
- Get started with jquery
- Get Started With Tiny_MCE
- Get started with jQueryMx
- Getting Started with LXC on an Ubuntu 13.04 VPS
- Get started with Android fragments
- How Do I get Started with Oracle?
- Get started with GAE/webapp framework
- How to get started with WebRTC
- How to get started with WebRTC
- Get started with OpenCV on Android
- How do I get started with CUDA?
- RHEL7: How to get started with Systemd.
- Java - Get Started with Trouble Shooting
- 【学习笔记】Get Started with MATLAB-Chapter01
- 【学习笔记】Get Started with MATLAB-Chapter02
- 在线查看Android源码
- oj4
- 彻底删除oracle数据库
- 文档对象模型DOM
- java虚拟机学习
- Get started with lxc.
- Foundation框架基础 常用的结构体
- 程序编译运行时头文件或动态链接库的查找
- java编程中引用数据类型就是类、接口、数组,怎么理解理引用的格式和意义了????
- foundation框架基础 NSDate-日期
- 职业生涯规划
- hdu1754 I Hate It(线段树)
- POJ 2299 Ultra-QuickSort (树状数组)
- phpmyadmin使用load语句导入.dat数据中文乱码问题解决