LXC安装使用遇到的问题!

安装:

$ ./autogen.sh
$ ./configure
$ make
$ sudo make install

创建Rootfs

debian

$ sudo debootstrap sid rootfs http://ftp.tw.debian.org/debian/

ubunut

sudo debootstrap lucid rootfs http://ftp.tw.debian.org/ubuntu/





1. 动态库链接出错

lxc-create: error while loading shared libraries: liblxc.so.1: cannot open shared object file: No such file or directory

遇见这个错误说明没找到liblxc.so.1文件

1:查看/usr/local/lib下是否有这个库文件,有的话说明已经安装了liblxc,没有说明没有安装

2:若没有安装就下载个安装包,安装好,再测试

3:若已经安装,有两个方法解决

A:在/etc/ld.so.conf中添加/usr/local/lib,再执行一下ldconfig,测试是否可行

B:给liblxc.so.1做个软件链接 (不如A方法好)

ln -s /usr/local/lib/liblxc.so.1 /usr/lib/liblxc.so.1

2. 创建虚拟机出错

lxcVmStart:1477 : internal error The 'cpuacct', 'devices' & 'memory' cgroups controllers must be mounted

运行/etc/init.d/cgconfig (若没有cgconfig,则说明没有安装cgroup-bin(http://packages.ubuntu.com/lucid/admin/cgroup-bin))

重启libvirtd;

lxcVmStart:1496 : internal error Unable to find 'memory' cgroups controller mount
修改/etc/cgconfig.conf配置文件加入memory的mount项

mount {
	cpu = /mnt/cgroups/cpu;
	cpuacct = /mnt/cgroups/cpuacct;
	devices = /mnt/cgroups/devices;
	memory = /mnt/cgroups/memory;
}
重启cgroup,libvirtd。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值