Changes

48 bytes added ,  11:00, 18 September 2012
Line 1: Line 1: −
=Prepare a Linux Container (CT)=
+
=Prepare a Linux Container=
 
==Requirements==
 
==Requirements==
 
* A console should be disabled (lxc.console = none)
 
* A console should be disabled (lxc.console = none)
* udev should not run in CT ($ mv /sbin/udevd{,.bcp})
+
* udev should not run inside containers ($ mv /sbin/udevd{,.bcp})
   −
== Prepare a host environment ==
+
== Preparing a host environment ==
    
* Mount cgroupfs
 
* Mount cgroupfs
Line 21: Line 21:  
  ONBOOT="yes"
 
  ONBOOT="yes"
 
  BRIDGE=br0
 
  BRIDGE=br0
==Create CT==  
+
==Create and start a container==  
 
* Download an OpenVZ template and extract it.
 
* Download an OpenVZ template and extract it.
 
  curl http://download.openvz.org/template/precreated/centos-6-x86_64.tar.gz | tar -xz -C test-lxc
 
  curl http://download.openvz.org/template/precreated/centos-6-x86_64.tar.gz | tar -xz -C test-lxc
   −
* Create a config files
+
* Create config files
 
  $ cat ~/test-lxc.conf  
 
  $ cat ~/test-lxc.conf  
 
  lxc.console=none
 
  lxc.console=none
Line 42: Line 42:  
  none /root/test-lxc-root/dev/shm tmpfs  defaults 0 0
 
  none /root/test-lxc-root/dev/shm tmpfs  defaults 0 0
   −
* Register CT
+
* Register the container
 
  $ lxc-create -n test-lxc -f test-lxc.conf
 
  $ lxc-create -n test-lxc -f test-lxc.conf
   −
* Start CT
+
* Start the container
 
  $ mount --bind test-lxc test-lxc-root/
 
  $ mount --bind test-lxc test-lxc-root/
 
  $ lxc-start -n test-lxc
 
  $ lxc-start -n test-lxc