Tuesday, January 25, 2011

Managing LXC container

Just like a virtual machine you can start/stop it:
  1. Start lxc container vm0:
    lxc-start -n vm0 -d
    
  2. Login into console:
    lxc1:~# lxc-console -n vm0
    
    Type <Ctrl+a q> to exit the console
    
    Debian GNU/Linux 6.0 vm0 tty1
    
    vm0 login:
    
  3. Since ssh server is already installed, you should be fine to login (assuing you have dhcp server running in the network and dynamic dns is configured accordingly):
    ssh vm0
    
  4. Shutdown lxc container vm0:
    ssh vm0 halt && lxc-wait -n vm0 -s STOPPED
    
  5. Stop lxc container vm0 (this simply kills all processes related to container):
    lxc-stop -n vm0
    

No comments :

Post a Comment