Difference between revisions of "Containers"

From Anarchaserver
Line 7: Line 7:


== STEP 1 Create Let's create a 'Transitional' virtual machine, a container ==  
== STEP 1 Create Let's create a 'Transitional' virtual machine, a container ==  
<code>lxc-create -n transitional -t debian</code>
<code>lxc-create -n transitional -t debian</code>


Change password of the container, it is the root password  
Change password of the container, it is the root password  


<code>lxc-start -n transitional -d </code>
<code>lxc-start -n transitional -d </code>
start the container,dettach the container from the root terminal
 
 
Start the container,dettach the container from the root terminal
 
<code>lxc-attach -n transitional passwd </code> 


<code>Could not find writable mount point for cgroup hierarchy 8 while trying to create cgroup. </code>
<code>Could not find writable mount point for cgroup hierarchy 8 while trying to create cgroup. </code>
Line 27: Line 34:


<code>lxc-checkconfig</code>
<code>lxc-checkconfig</code>
So let's install all the packages ~ and see whether it works
<code>apt-get install lxc libvirt0 libpam-cgroup libpam-cgfs bridge-utils</code>





Revision as of 19:02, 24 May 2017

We install containers to manage the transitional, finally LXE: https://wiki.debian.org/LXC

STEP 0 Install lxc

apt-get update apt-get install lxc

STEP 1 Create Let's create a 'Transitional' virtual machine, a container

lxc-create -n transitional -t debian


Change password of the container, it is the root password

lxc-start -n transitional -d


Start the container,dettach the container from the root terminal

lxc-attach -n transitional passwd

Could not find writable mount point for cgroup hierarchy 8 while trying to create cgroup.

We imagine that if we upgrade to jessie 8.8, that the Cgroup issue (=a subsystem in the linux kernell, which allows process separation) will be a resolved. For now we add the mountpoint. and follow this manual [1]

cat /etc/fstab cgroup /sys/fs/cgroup cgroup defaults 0 0

We mount manually, we do it easy by mount all mount -a

But it doesn't work.

lxc-checkconfig

So let's install all the packages ~ and see whether it works

apt-get install lxc libvirt0 libpam-cgroup libpam-cgfs bridge-utils




lxc-attach -n transitional passwd

STEP 2 How can a container access the network?

A container, has MAC adress, we need a bridge for networking, via dhcp, So the container get an ip, and give access to the server's internal network

Do we opt for static of dynamic ip's? the dhcp server can have static ip via host/ it is anyhow setup to give a unique ip to the MAC address of the container (guest). So the choice is obsolete.

STEP 3 How can we access via the internet a container?

Setup routing / (reverse) proxy system for networking, so depending on the different services (Living data, Nekrocemetery, Transitional) we create subdomains which direct you to the correct container.