Jump to content


Other linux distro in your vps - Posted By underpressure

How To

  • Please log in to reply
1 reply to this topic

#1 Cryo Kinesis

Cryo Kinesis

    Haphost Staff

  • Moderators
  • 128 posts
  • LocationGridania, Eorzea

Posted 05 August 2014 - 06:07 PM

Disclaimer: Neither I nor Haphost takes responsibility for your actions. You do it all on your own risk.

This article describes only using precreated templates and not creating it. If you want to run distro, which hasn't available template, you have to create it. This article applicable to Debian 6.
Terms: $CTID - id of your vps container, can be known while you enter to serial console (entered into CT 4711, here, for example, it is equal to 4711). $VPSIP - ip of vps, can be known from control panel. $HOSTNAME - hostname of vps, can be known for control panel.
0. Check if you have access to serial console (not ssh root@vpsip, but ssh console-xxx@94.249.x.254). If you have not, don't even start process of installing.
1. We need linux machine with openvz kernel and vzctl (utility to control openvz containers) I used debian 6 inside Virtualbox, where it can be installed with

# apt-get install linux-headers-2.6.32-5-openvz-686 linux-headers-2.6.32-5-common-openvz linux-image-2.6-openvz-686 vzctl
It suggests to install package grub(virtual package which allows migrate from grub-legacy to grub2), so let's do it.
# apt-get install grub
When we got it installed, we have to go reboot with
# shutdown -r now.
2. OK, we booted with openvz kernel and
# uname -r
shows us
. And we are ready to next step: choosing distro. So, we go to download.openvz.org/template/precreated/ to take a look on official templates, or go to download.openvz.org/template/precreated/contrib/ to take a look on contributed templates, or we google "%DISTRONAME% openvz template" if we haven't found neither official nor contributed template on download.openvz.org.
I choosed openSUSE-12.1-x86 template, and start download it with
wget download.openvz.org/template/precreated/suse-12.1-x86.tar.gz -O /var/lib/vz/template/cache/suse-12.1-x86.tar.gz
But, download speed on download.openvz.org is pretty slow for me, so I taked look to mirror list on wiki.openvz.org/Download_mirrors and downloaded from mirror which is closer to me.
3. OK, we download template and it is time to create container with openSUSE. Do it with command
vzctl create $CTID --ostemplate suse-12.1-x86 --ipadd $VPSIP --hostname $HOSTNAME
4. Now, you can change root password with
vzctl exec $CTID passwd
. I don't noticed that option in man vzctl and changed it later.
5. We got working container and it is time to transfer it to vps.
First, stop container with
vzctl stop $CTID
. Then, make a tar.gz archive with your container with
tar cfvz archive.tar.gz /var/lib/vz/private/$CTID/
. Then, transfer archive to your machine with
scp archive.tar.gz root@vpsip:/
6. OK, we got archive.tar.gz in /. Now, we should make symlinks in order to have files exctracted in right place. Let's do it with
cd /var/lib && mkdir vz && cd vz && mkdir private && cd private && ln -sf / /var/lib/vz/private/$CTID/
Now, (I understand that it shouldn't be necessary, but i got errors while extracting without it) we go to directory /var/lib/vz/private/$CTID/ with
cd /var/lib/vz/private/$CTID/
and start extract archive.tar.gz with
tar xfvz archive.tar.gz
7. Now, it should make a final cleanup (not must), and remove files which wasn't accessed last 120 minutes (i.e. which wasn't extracted). I'd suggest you check what files will be deleted before deleting with
find -amin +120
and delete them with
find -amin +120 -delete

8. Reboot machine with
shutdown -r now
9. If you did step 4, skip that step. If you didn't, install root password via serial console with
10. Finally, you got machine, which runs distro, which wasn't supposed to you by Haphost.
Licensed under CC-BY-NC-SA.
  • Pete likes this


#2 beaver



  • Members
  • PipPip
  • 13 posts

Posted 14 November 2014 - 02:36 AM

any screen shots


Also tagged with one or more of these keywords: How To

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users