Converting JailTime.org templates for HyperVM
Well, after finally figuring out how to do this myself, I felt necessary that I shared this with others, so that people can easily do this on their own without having to feel their way through doing this on their own.
Note: Root access is required. This MUST be done on a server or VPS that allows mounting using the loop device, as this is needed for some of the steps.
For our example, we are going to demonstrate how to convert the debian image into a HyperVM-ready image. This can also be done on any other template provided by JailTime.org.
Firstly, we must download the image onto the machine we’re going to be doing the conversion on.
wget “http://jailtime.org/lib/exe/fetch.php?cache=cache&media=download%3Adebian64%3Adebian.4-0.64.20080709.img.tar.bz2″
After downloading the file, we are going to extract out the image. There will be a xen configuration file in the archive as well, but this can be ignored as HyperVM generates its own xen configuration file.
tar jxf debian.4-0.64.20080709.img.tar.bz2
Next, we will prepare a directory to mount the image file to, and mount it using the loop device.
mkdir /mnt/foo
mount -o loop /root/debian.4-0.64.img /mnt/foo
Now, to get to the very simple part. All we need to do now is tarball the image so that HyperVM can read it appropriately.
cd /mnt/foo
tar -czf /home/hypervm/xen/template/debian-4.0-x86_64-jailtime.tar.gz
Please note, when naming the templates, you MUST name the template in the following schema:
distro-version-arch-custom.tar.gz
This instructs HyperVM which configuration variables it must pass to xen, and which configuration HyperVM must choose to ensure that the VPS will boot successfully.
After that step, your template is ready for use.
Note: I have noticed that some of the jailtime.org templates lack running GeTTY on xvc0, which may prove to be a hassle for some users, especially if they make use of the HyperVM console login. If you want to enable this, add the following line into your /etc/inittab
1:2345:respawn:/sbin/getty -L xvc0 9600 vt100
Also ensure that the line containing tty1 is commented out, as this may cause conflicts.
Happy templating!
Comments
13 Responses to “Converting JailTime.org templates for HyperVM”
Leave a Reply



the tar was only successful after i place ” . ” after tar -czf /home/hypervm/xen/template/debian-4.0-x86_64-jailtime.tar.gz. so its will work with
” tar -czf /home/hypervm/xen/template/debian-4.0-x86_64-jailtime.tar.gz . ”
everything was successful until i tried to log into the ssh. all the passwords i tried failed. how did you fix that?
thanks for a helpful article. not many would share this.
I tried creating templates using this doc but they do not work.
Thanks
What is the error you are getting Jay?
Zie,
This may be a case of root login being disabled via ssh. Some of the templates are set up like this, and you will need to edit the /etc/ssh/sshd_config to allow root login. Worst case, if you’re still experiencing the issue, try changing the password via HyperVM. This will reset the password and should fix any issue you’re experiencing if the first fix doesn’t work.
I did this
First login to your xen main node as -su
# wget “http://www.jailtime.org/lib/exe/fetch.php?cache=cache&media=download%3Agentoo%3Agentoo.2008-0.20080719.img.tar.bz2″
tar jxf gentoo.2008-0.20080719.img.tar.bz2
mkdir /mnt/tmp
mount -o loop /tmp/gentoo.2008-0.img /mnt/tmp
nano /mnt/tmp/etc/inittab
1:2345:respawn:/sbin/getty -L xvc0 9600 vt100
nano /mnt/tmp/etc/ssh/sshd_config
PermitRootLogin yes
cd /mnt/tmp tar czf /home/hypervm/xen/template gentoo.2008-0.20080719.tar.gz .
And when i try creating the XEN VM it do not work
I dont know how to even fix it.
Anyone got the gentoo and debian working template for hypervm? Lot of people are facing problem with these templates. I want to use for myself and distribute for free if anyone can provide me.
Thanks
I created one more image now this time debian and it shows VM up but its not pinging.
HyperVM’s default gentoo and debian templates are screwed up.
Anyone care to share the gentoo and debian template please.
Thanks
Are you sure you set the proper network configs for the VM’s?
To cross check I rebuild the VM again with centos working template of hypervm it pings. But when I rebuild the VM using gentoo or debian image as explained in the tutorial it do not ping.
Thanks
# mount -o loop /root/centos.5-2.64.img /mnt/foo
/root/centos.5-2.64.img: No such file or directory
any ideas?
Ah i get down as far as the tar process now but I get
tar: Cowardly refusing to create an empty archive
Try `tar –help’ or `tar –usage’ for more information.
thnx
using this tutorial i was able to convert centos-5.2 and debian-4.0 and use them with hypervm…
i made sure to update the sshd_config file so that root can login at least for the 1st time…
1. tar -jxf {distro.tar.bz2}
2. mkdir /mnt/foo
3. mount -o loop distro.img /mnt/foo
4. cd /mnt/foo
5. tar -czf ~/distro.tar.gz .
6. umount -l /mnt/foo
I would love to hear more about this topic.
This doesn’t work on any Fedora templates at jailtime at all./