You are here
Hi! As promised, I'm publishing today what I was able to advance on this topic. I basically took the original lxc-ubuntu script and remove everything that didn't make sense for the task, and added some stuff. The resulting script is meant to be run under a turnkeylinux environment with tklpatch installed, as it uses tklpatch-extract-iso to explode the iso.
So to test this, you'll:
1. Download a turnkey iso.
2. Run tkl2lxc turnkey.iso
The script will result in a rootfs which you should be able to use under LXC. Just move it to /var/lib/lxc/mycontainername/ and add a config and fstab file (you can use the standar ubuntu files which lxc-ubuntu creates).
Known issues:
- Init scripts are broken. The same that happened with ovz containers, so I think that Jed latests improvements on those could come handy here. Basically, one of them hangs and the others don't get run (inithooks never get runned). Meanwhile, you can ssh to the container and start up services manually.
I have included in the script a function called tkl_extras, here we could add what's needed. Speaking of inithooks, there's an fgconsole command that doesn't work under lxc, so I commented it. There must be other things but I haven't have time to finish the script.
Feel free to modify/republish to see if we get this running!
I am missing the script...
I am missing the script... :)
where can I download it ?
QUOTE: ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol
Oops
I forgot to hit the upload button after selecting the file . It's available now.
Most of it works... I
Most of it works...
I am currently adapting it and merging it with my own script which was also based on the ubuntu template.... and will adapt the init system also, so that inithooks are done also
Will post it later today
QUOTE: ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol
Working like a charm...
I adapted the script and it is working alright now. I use it as a standalone script now, so no tklpatch needed. But to make things simpler I will rewrite it for TKLpatch, based on Jeremy's version. That way you get a tar file and integrate a simple lxc template setup for it which you can use with lxc-create.
Currently it gives:
and the lxc-start output
QUOTE: ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol
Working LXC tklpatch version
Same as other thread...
I adapted Jeremy's tkliso2ovz and merged it with Adrian's lxc script and streamlined it a bit, and now I have the same one for LXC tkliso2lxc
Perhaps you can get it and put it on your GitHub. That way you can generate OVZ and LXC files from the TKL iso's
I think TKL is now the only one which can generate prepared LXC containers... :)
Almost everything is the same, except the init scripts are original and for inithooks I created a interactive.d directory
I think ovz and lxc are almost compatible, so if there are changes in the ovz conf, they probably are needed also in the lxc conf file.
Inithooks works nicely, at first start keys are generated, for root there is no password.
I think the next job would be to make a template which can be used with lxc-create which just extracts the tar file in a rootfs directory, modifies the resolv.conf, sets the interfaces and sets the root password.
make that and it will work
make that and it will work :)
QUOTE: ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol
some LXC experiences.....
Currently I have the TKL lamp running on a RH6.1 box which is running in VM ESX
TKL lamp startup times are less then 5 seconds... and it is (now) a joy to work with :)
Only problem now is the sshd which refuses connections with:
Probably this has to do with selinux which is enabled on the RH6.1 host
Also the upstart scripts in /etc/init are troubling..... probably its me, but they are a real pain to get it working... I am trying to reduce them and just use the init.d scripts.
Problems also with the /etc/network/if-up.d which started ntpdate and I forgot to remove the umount* scripts which resulted in a readonly host filesystem
I have made a small daemon for running inside the container (<10k) which will accept and execute commands from outside the container (using fifo's) and sending back the result. Which helps incase you want to have a proper shutdown instead of lxc-stop which just kills it very hard.
The sshd seems to be now the only problem left, so I have to figure out what to do with it. As last resort, I will compile it from source altering the selinux check in it...
I will update the tkliso2lxc the coming days to a new improved version.
QUOTE: ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol
Good work
OVZ has these same issues (although the SSH one may be a little different). I assume that the fixes used in the OVZ patch didn't work? Or didn't you fully apply them? (I'm guessing thats a possibility as the OVZ patch removes if-up, umount etc).
version 0.2
I adapted the first version (0.2 version can be downloaded)
Some experience:
I use a bridge with an ip 192.168.2.0 range, so the lxc containers have a seperate network and I use ipchain (and masquerading) rules for connecting to/from the outside world.
I made a small cmd daemon for running inside a lxc containers, so from the host I can execute commands inside the container. Needed that for shutting down a container in an ordered fashion instead of using lxc-stop (pulling the power)
But its works like a charm.... Running inside a ESX vmware RH6.1 host, a TKL lamp container starts within 3 seconds.
QUOTE: ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol
alternative download link?
I've started to look into TurnKey support for LXC (and docker), and wanted to take a look at the work that's already been done, unfortunately the atbas.org link mentioned above doesn't exist anymore.
If someone has a copy lying around, could you upload it somewhere?
You are missing the tklpatch
You are missing the tklpatch programs
Read the post about tklpatch: http://www.turnkeylinux.org/docs/tklpatch
For LXC it is easier now to take the OpenVZ files and modify them a bit.
QUOTE: ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol
TurnKey LXC announced
Just in case anyone comes across this thread, we've announced TurnKey LXC - both an appliance as well as a generic TurnKey LXC template for deploying any TKL appliance in LXC. Full details in the announcement.
Add new comment