View Single Post
Old 27th January 2011, 16:08
CSsab CSsab is offline
Senior Member
Join Date: Apr 2010
Posts: 174
Thanks: 19
Thanked 32 Times in 27 Posts
Default Portable ISPConfig 3 using an lxc container??

When formatting my hard drive on the host I thought I might format a couple of USB drives I had so that they would mount when I booted the system.

I gave one a mount point of /mail2
and the other a mount point of /web2

Additionally I gave them user and group quota.

Here are the fstab entries on the host.

# /mail2 was on /dev/sdc1 during installation
UUID=e86c7cd4-cf2c-4064-8c55-c2ae06d1b1b2 /mail2 ext4 rw,nosuid,usrquota,grpquota 0 2
# /web2 was on /dev/sdb1 during installation
UUID=a3bffff2-49bf-45cb-ba4e-1c0d35adfbad /web2 ext4 rw,nosuid,usrquota,grpquota 0 2

They have to be "rw" in order for debootstrap to write to them.

root@lxchost:/web2# ls aquota.user lost+found

NOTE: I am using the latest templates from the lxc git which I name and copy into /usr/lib/lxc/templates (in this case I have called the template "lxc-debian-my")

chmod +x /usr/lib/lxc/templates/lxc-debian-my

/usr/lib/lxc/templates/lxc-debian-my -p /mail2

This downloads a Debian Squeeze minimal right into the flash drive.

root@lxchost:~# ls /var/lib/lxc/
db mail ns1 ns2 web

(There are my other containers already running in the multiserver setup)

To give the container an init script so not to crash the host:

ln -s /mail2 /var/lib/lxc/mail2

root@lxchost:~# ls /var/lib/lxc/
db mail mail2 ns1 ns2 web

There it is "mail2" ...

And now to start the container:

root@lxchost:~# lxc-start -n mail2 -d
root@lxchost:~# lxc-info -n mail2
'mail2' is RUNNING
root@lxchost:~# lxc-ps --name mail2 --forest
mail2 25493 ? 00:00:00 init
mail2 25709 ? 00:00:00 \_ dhclient3
mail2 25785 ? 00:00:00 \_ sshd
mail2 25802 pts/30 00:00:00 \_ getty
mail2 25803 pts/26 00:00:00 \_ getty
mail2 25804 pts/27 00:00:00 \_ getty
mail2 25805 pts/28 00:00:00 \_ getty
mail2 25806 pts/29 00:00:00 \_ getty

So the system is up and running and now to configure and install ISPConfig 3.

The next step might be to work out how to use quota inside the container - I can't figure it out and would appreciate help.

I'll be trying to plug this node into an ISPConfig install on a completely different system and see how that goes.
Reply With Quote