Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
Last active August 29, 2015 14:05
Show Gist options
  • Save tkuchiki/e195871ca51527911b00 to your computer and use it in GitHub Desktop.
Save tkuchiki/e195871ca51527911b00 to your computer and use it in GitHub Desktop.
install LXC (CentOS 6.5)

install

# epel required
wget --no-check-certificate https://linuxcontainers.org/downloads/lxc-1.0.5.tar.gz
tar zxvf lxc-1.0.5.tar.gz
rpmdev-setuptree
cp ./lxc-1.0.5.tar.gz ~/rpmbuild/SOURCES/
cp lxc-1.0.5/lxc.spec ~/rpmbuild/SPECS/
yum install -y libcap-devel docbook2X graphviz
rpmbuild -bb ~/rpmbuild/SPECS/lxc.spec
rpm -ivh ~/rpmbuild/RPMS/x86_64/lxc-1.0.5-1.el6.x86_64.rpm ~/rpmbuild/RPMS/x86_64/lxc-libs-1.0.5-1.el6.x86_64.rpm
#service libvirtd start
#service cgconfig start

lxc-create -t centos -n centos-test
sed -i"" -e "/net.ipv4.ip_forward/c\net.ipv4.ip_forward = 1" /etc/sysctl.conf
# echo 1 > memory.use_hierarchy > /etc/cgroup/memory
shutdown -r now
lxc-start -f /var/lib/lxc/centos-test/config -n centos-test -d --logfile /var/log/lxc/centos-test.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment