Install Proxmox 4.2 VE on a Hetzner server

With the release of Proxmox 4.2 we are getting IPv6 support including LXC containers. This comes at the cost of OpenVZ container (unless you want to install custom patches) but I feel it’s a step in the right direction. Over the past week we got a new Hetzner box and in this tutorial I will show you how to install Proxmox 4.

Step 1 - Installimage

After you get the credentials to your new Hetzner server, you start by logging in to your server using rescue mode.The rescue mode allows you to boot install an Operating systems or Proxmox on top of Debian 8. Once you login to rescue mode with the credentials provided you simply run the command

root@rescue ~ # installimage

You will see the follwoing screen appear
From here go to Custom_Image and choose the second option which is Proxmox 4.2 on Jessie.

Step 2 -Configure Installation

The installation will begin and you will be asked to edit a configuration file .Its importand to edit the fqdm option to a domain name you intend to use. For this scroll down to the DQDM option of teh configuration and then save and exit to continue.

The rest of the options deal with LVM and hardware raid, you need to configure this yoursef depending on your setup.If you are suing software raid like i am you can leave the rest of the options as they are..

The installation will then begin and you should see something like the following

The installation will finish and you should reboot to your proxmox server
To access the web interface navigate to
https://your-hetzner-ip:8006
and login with your credentials which are the same ones you used for the rescue systems.I suggest you change those

Step 3: Configure Networking

In order to be able to create virtual machines using Proxmox, we need to have additional IP addresses. For this purpose I will show you how to configure your machine by having only one static IP address from Hetzner including an additional subnet (in my case /28). Below is an example screenshot of the server panel @ Hetzner:

Since we are doing a routed setup, you must enabled IP forwarding by running the following commands:

1
2
sysctl -w net.ipv4.ip_forward=1
sysctl -w net.ipv6.conf.all.forwarding=1

Attention-with proxmox version 4.3 i also ha to make the follwoing modification to he file /etc/sysctl.d/99-hetzner.conf

# sysctl config

net.ipv4.ip_forward=1

net.ipv4.conf.all.rp_filter=1
net.ipv4.icmp_echo_ignore_broadcasts=1
# ipv6 settings (no autoconfiguration)
net.ipv6.conf.default.autoconf=0

Now keeping this in mind we need to configure the server network interface settings. To do this, login back as root to the server and edit /etc/network/interfaces.

1
vi /etc/network/interfaces
The default setup will look something like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Loopback device:
auto lo
iface lo inet loopback
# device: eth0
auto eth0
iface eth0 inet static
address 136.243.110.154
netmask 255.255.255.192
gateway 136.243.110.129
# default route to access subnet
up route add -net 136.243.110.128 netmask 255.255.255.192 gw 136.243.110.129 eth0
iface eth0 inet6 static
address 2a01:4f8:181:1123::2
netmask 64
gateway fe80::1
We will change the above configuration to the following:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 136.243.110.154 #our main ip address
netmask 255.255.255.255 #we just need the one IP
pointopoint 136.243.110.129 #more: http://goo.gl/jGVrO4
gateway 136.243.110.129
iface eth0 inet6 static
address 2a01:4f8:181:1123::2
netmask 128
gateway fe80::1
up sysctl -p
# Configuration so that our subnet is available for use:
auto vmbr1
iface vmbr1 inet static
address 136.243.179.113 #Add ANY ip address of the subnet
netmask 255.255.255.240 #This is the netmask of that particular subnet
bridge_ports none #bridge settings
bridge_stp off
bridge_fd 0
Be careful of your netmask, as it depends on the subnet you have. If you have /28 it will be 255.255.255.240 where as if you ordered a /29 subnet it would be 255.255.255.248 etc. You can find this out by hovering over your subnet in the Hetzner panel.

Step 4: Proxmox web interface and our first container

The Proxmox installation comes with a web interface from where you can manage your containers. You can login to the web interface on port 8006 in our case: https://136.243.110.154:8006/

Before you can create your first container you need to download some OS templates. To do this:

  1. Click on the “local” icon in the left sidebar
  2. Click on “Templates” in the top tab
  3. Select the OS images you want to download (for our example, we will download Ubuntu 14)

After you’ve done this, you can click on “Create CT” in the top right corner of Proxmox and it will present you with a dialog for creating your first LXC container.

The first step will look something like this:

The most crucial part is the network step:

You must set the gateway as the gateway IP address we used in the network configuration. It’s also different from the previous version of Proxmox as you have to add /32 as a subnet mask on the IPv4, as to let Proxmox know how many IP’s you are attaching to the virtual machine.

Once you do this, you can start your VM and it should be accessible from the web!

I did not test/configure IPv6 for this tutorial, but if this helped you can also have a look at an older tutorial done by Hetzner for Proxmox v3.x (Thx to Mawan for his intro to Proxmox).