Difference between revisions of "LXC Ubuntu containers"

From MyWiki
Jump to: navigation, search
Line 18: Line 18:
 
Running a desktop - http://xmodulo.com/lxc-containers-ubuntu.html<br>
 
Running a desktop - http://xmodulo.com/lxc-containers-ubuntu.html<br>
 
'''Redirecting a port to a container :'''<br>
 
'''Redirecting a port to a container :'''<br>
iptables -t nat -A PREROUTING -i eth0 -p tcp  -m tcp --dport 80 -j DNAT --to 10.0.3.238:80
+
iptables -t nat -A PREROUTING -i eth0 -p tcp  -m tcp --dport 80 -j DNAT --to 10.0.3.238:80<br>
 +
 
 +
[[ Problem failing to boot Centos 7 ]] <br>

Revision as of 12:33, 8 October 2015

lxc-ls - list the containers existing on the system
lxc-destroy --name u1
lxc-create -t download -n u1 to select a distribution from a list
lxc-create -t download -n centos-6 ( This gives a nore meaningful name ! )
Files are located under /var/lib/lxc

In Centos, to enable an x display to tunnel via ssh the xauth program needs bo be installed
lxc-attach --name <name>


sudo lxc-ls --fancy
sudo lxc-start --name u1 --daemon
sudo lxc-info --name u1
sudo lxc-stop --name u1
sudo lxc-destroy --name u1

Running a desktop - http://xmodulo.com/lxc-containers-ubuntu.html
Redirecting a port to a container :
iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j DNAT --to 10.0.3.238:80

Problem failing to boot Centos 7