Create a Ubuntu 14.04 OpenVZ Template for Proxmox

Create a Ubuntu 14.04 OpenVZ Template for Proxmox

Get Social!

proxmox logo gradThe latest Ubuntu long term support is now available, called Ubuntu 14.04.

There isn’t currently a template available over on OpenVZ however I’m sure that will be shortly rectified. In the meantime, however, you can use the below steps to create a 14.04 Ubuntu template for OpenVZ/ Proxmox. This template has only been lightly tested so please report any errors as you find them.

This template is BETA, please report any problems in the comments.

Vistit Downloads Page

 

You can download a pre-created VM from here directly, or you can create your own using the below notes.

 

Before continuing, this guide assumes that you already have an installation of Ubuntu up and running which you can SSH to. This could be either a KVM or physical machine.

We will use debootstrap to create the template so make sure it’s installed and install it if you haven’t already.

Use debootstrap to download and configure all the required packages to a temporary directory. For this example, we’ll use /tmp/deb.

Copy the below script into the tmp directory of the template root which has just been created. For this example you’ll need to copy the text into this path:

Make the script runnable which chmod.

Run the above script using the chroot command to set up the template.

The script will now run and set up the template using /tmp/deb/ as the templates root.

Once completed, create an archive of the template root device and install it on your OpenVZ/ Proxmox server.

Copy the /tmp/ubuntu-14.04-x86_64-initial1.tar.gz file to your cache directory of your Proxmox install and create your first Ubuntu 14.04 container!

proxmox-ubuntu-1404-template


Related posts:


10 Comments

Paul

26-Apr-2014 at 10:20 pm

You need to symlink /sbin/iptables-save over to /bin/true

During the live migration process of a VZ container it executes iptables-save in order to try and save iptables rules. Since iptables isn’t installed and iptables-save is missing from this image, it fails with the following error:

Apr 26 18:16:02 dump container state
Apr 26 18:16:03 # vzctl –skiplock chkpnt 100 –dump –dumpfile /mnt/pve/proxvol/dump/dump.100
Apr 26 18:16:02 Setting up checkpoint…
Apr 26 18:16:02 join context..
Apr 26 18:16:02 dump…
Apr 26 18:16:03 Can not dump container: Invalid argument
Apr 26 18:16:03 Error: iptables-save exited with 255
Apr 26 18:16:03 ERROR: Failed to dump container state: Checkpointing failed

By “ln -s /bin/true /sbin/iptables-save” it will fix it. I’ve made the changes to the image I created and it’s able to live migrate now.

Josef

12-May-2014 at 2:33 pm

Thank you!

denis

29-May-2014 at 1:11 pm

login and password for u templ?

    james.coyle

    30-May-2014 at 12:42 pm

    You set that with the vzctl command.

Axel

6-Jul-2014 at 6:24 am

The procedure is working but after, each time, I start the VZ, I have this error message:
resolvconf: Error: /run/resolvconf/interface either does not exist or is not a directory
and at the creation of the VZ from the ubuntu-14.04-x86_64-initial1.tar.gz template, I had this error message:
touch: cannot touch `/var/lib/vz/root/105/etc/resolv.conf’: No such file or directory

    james.coyle

    8-Jul-2014 at 2:14 pm

    It’s because that file does not exist. Have you set the DNS entries in the Proxmox web GUI?

      Axel

      8-Jul-2014 at 9:51 pm

      Yes why ?

        james.coyle

        8-Jul-2014 at 10:18 pm

        I’m guessing it’s because the file does not exist – are you able to manually create it and does the error go away?

        I’ll update the image at the weekend.

gkoufoud

6-Aug-2014 at 11:11 am

Good job,
I’d like to mention some things…
1. /tmp permissions should be 777 (otherwise you may experience problems e.g. mysql installation etc) -> chmod 777 /tmp (inside client.sh script)
2. If you want to allow ssh root login add this to the client.sh : sed -i -e ‘s/^PermitRootLogin without-password/PermitRootLogin yes/g’ /etc/ssh/sshd_config

3. To avoid /etc/init.d/generate_ssh_keys startup script you can add the following to the client.sh script ->
sed -i ‘s/exit/#exit/g’ /etc/rc.local
echo “if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then” >> /etc/rc.local
echo ” ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N ”” >> /etc/rc.local
echo “fi” >> /etc/rc.local
echo “if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then” >> /etc/rc.local
echo ” ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N ”” >> /etc/rc.local
echo “fi” >> /etc/rc.local
echo “exit 0” >> /etc/rc.local

Thanks.

    james.coyle

    6-Aug-2014 at 1:37 pm

    Thanks, great suggestions!

Leave a Reply

Visit our advertisers

Search

Quick Poll

Which type of virtualisation do you use?
  • Add your answer

Visit our advertisers