Diff for "LXC"


Differences between revisions 21 and 22
Revision 21 as of 2012-06-09 04:18:30
Size: 6115
Editor: 75-101-50-25
Comment: Add link to LXC Chapter in Ubuntu Server guide
Revision 22 as of 2013-02-18 19:40:11
Size: 2488
Editor: sateda
Comment:
Deletions are marked like this. Additions are marked like this.
Line 21: Line 21:
== Notes ==
 * Upstream libvirt support LXC.
 * KVM + LXC can function properly on same host.
 * LXC inside KVM works properly on same host.
 * LXC take advantage of KMS feature of new Kernels.
 * 64bit OS using a 32bit container.
 * LXC works well with btrfs.
 * No special hardware required.
 * No patch is required to the kernel, since LXC is already integrated into the Kernel.
 * OpenVZ Containers run on LXC, only Config modification required.
Ubuntu ships with the latest version of LXC and is very active in the upstream development of LXC and the containers capabilities in the kernel.
Line 32: Line 23:
== Use case examples ==
 1. Isolate individual processes (e.g. a webserver)
 2. VPS
 3. LTSP
 4. Software build, testing, upgrading (think sandboxing)
The best documentation available at the moment for LXC can be found in the Server Guide:
https://help.ubuntu.com/12.10/serverguide/lxc.html
Line 38: Line 26:
= Host configuration =
[[http://github.com/phbaer/lxc-tools/|External link - lxc-tools ]] collection of utility scripts which include:
 1. lxc-ubuntu - installs ubuntu container
 2. init - init.d script
 3. lxc-status - lxc-info on all the containers
 4. lxc-halt - stop a linux container SAFELY
A good getting started guide can be found at:
https://www.stgraber.org/2012/05/04/lxc-in-ubuntu-12-04-lts/
Line 45: Line 29:
[[http://blog.bodhizazen.net/linux/lxc-configure-ubuntu-lucid-containers/|External link - How to Ubuntu 10.04 LXC containers]]

[[http://blog.bodhizazen.net/linux/lxc-linux-containers/|External link - Ubuntu and Fedora Hosts]]

== kernel requirements ==
The Linux container capabilities are part of the main stream linux kernel and require kernel version >= 2.6.27 (well working as of 2.6.31).

There are no requirements to compile a kernel or apply patches.

== User space tools (lxc) ==
The user space tools, or lxc, are a set of scripts that manage linux containers.

You may install the lxc user space tools from the Ubuntu repositories.

{{{
sudo apt-get install lxc vlan bridge-utils python-software-properties screen
}}}

Or download the latest stable package from sourceforge and compile them yourself.
The lxc project maintains a git repository for a bleeding edge set of tools.

== Networking ==
There are several networking options available, the consensus appears to be that bridging your network card is the best option. As such I will cover bridging your network card here, hopefully this information can be expanded.

= Container configuration =
options/examples for config files
chroot/debootstrap/febootstrap
lxc-debian / lxc-fedora
lxc-console / ssh into containers

== Migrate OpenVZ containers ==

= Application configuration =
== Issues ==
“mknod: `/lib/udev/devices/ppp’: Operation not permitted” when updating Ubuntu 10.04 on virtual LXC machine
[[http://www.emanuelis.eu/2010/09/15/mknod-lib-udev-devices-ppp-operation-not-permitted-when-updating-ubuntu-10-04-on-virtual-lxc-machine/]]

= Other =
== Mini screen how-to ==
List screen sessions:
{{{
[HW] # sudo screen -ls
There are screens on:
        1407.init-ubuntu (07/10/2010 02:23:42 PM) (Detached)
        1364.init-test (07/10/2010 02:23:41 PM) (Detached)
        1357.init-2www (07/10/2010 02:23:40 PM) (Detached)
3 Sockets in /var/run/screen/S-root.
}}}
Login screen session:
{{{
[HW] # screen -r 1407.init-ubuntu
Starting nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
configuration file /etc/nginx/nginx.conf test is successful
nginx.

Ubuntu 10.04 LTS ubuntu /dev/console

ubuntu login:
}}}
Detach screen: '''C-a d''' or '''C-a C-d'''

[[http://ugatu.net/wiki/LXC|source]]

== lxc.network.type=phys & kernel versions ==
The problem:
{{{
[HW] # lxc-execute --name ubuntu -s lxc.network.type=phys bash
Segmentation fault (core dumped)
}}}
or
{{{
[HW] # lxc-execute --name net -s lxc.network.type=phys -s lxc.network.link=eth0 bash
lxc-execute: failed to move 'eth0' to the container : Message too long
}}}
The kernel before 2.6.35 does not support physical interface moving across namespace.
Maybe You can use Maverck 2.6.35 kernel in Lucid, see: [[https://launchpad.net/~kernel-ppa/+archive/ppa?field.series_filter=lucid|PPA for Ubuntu Kernel]]

[[http://comments.gmane.org/gmane.linux.kernel.containers.lxc.devel/403|source1]]
[[http://www.mail-archive.com/lxc-users@lists.sourceforge.net/msg00613.html|source2]]

= See also =
Some additional information can be found below:

Contents

  1. Overview

Overview

LinuX Containers (LXC) provide lightweight virtualization that lets you isolate processes and resources without the need to provide instruction interpretation mechanisms and other complexities of full virtualization.

Ubuntu ships with the latest version of LXC and is very active in the upstream development of LXC and the containers capabilities in the kernel.

The best documentation available at the moment for LXC can be found in the Server Guide: https://help.ubuntu.com/12.10/serverguide/lxc.html

A good getting started guide can be found at: https://www.stgraber.org/2012/05/04/lxc-in-ubuntu-12-04-lts/

Some additional information can be found below:


CategoryInstallation CategorySystem

LXC (last edited 2014-07-29 22:20:53 by 192)