In this article I document how I installed Proxmox VE on one Hetzners dedicated servers. Proxmox Virtualisation Environment is a complete open source server virtualization management solution. It is based on KVM virtualization & container-based virtualization and manages virtual machines, storage, virtualized networks, and HA Clustering.

I purchased one of Hetzner's servers from their server auction page which included an i7 920 CPU, 24GB DDR3 RAM, Adaptec HW RAID with 2x750GB & 2x3TB hard drives with each pair configured as RAID1.

Debian install

As a first step, I install Debian Squeeze, 64 bit minimal. Before, I ordered my EX4 server at Hetzner, it was few hours and I had the IP address and root password. So, login to Heztner Robot, activate the rescue system, write down the temporary root password, and reboot. Then login again via SSH as root, with the temporary password and start the installimage script. Select Debian 6.0 64 bit minimal in Linux, in the config file change the hostname and configure the partitions to your personal preference. On the 750GB device I'm using 500 MB for the /boot and the rest is divided into 3 volume groups. As logical volumes, I setup 8GB for swap, 100GB for /root, 100GB for /home and the rest for /var. Save the config file, and wait for the partition to finish writing.

At this point make sure to change the temporary root password with passwd to something more private.

Initial Host setup

To get rid of some warnings, reconfigure system locales with dpkg-reconfigure locales. Select the local language, as a second language, next to the English, but set English for the system language. Als timezone should be checked with dpkg-reconfigure tzdata.

Than add the first user with sudo rights and reconfigure the SSH configs to get basic security in place. Be careful with these steps as the potential is there to lock yourself out, and have to go back to the beginning.

Install sudo which will allow non-root users to execute root commands:
apt-get install sudo

Then add a standard user:
adduser yourusername
adduser yourusername sudo
 
Please check out one of my other tutorials that explains initial server setup and leads on to securing your server to minimize the chance of any unwanted intrusions.

Now we are going to setup some new directories for Proxmox storage and backup. Become root via sudo, and:

mkdir -p /data/
 
Pick up one empty volume group, and check the exact number of the free PE extents via:
vgdisplay
 
Replace vg0 with your choice! Once we have it, create the logical volume, and format it:
lvcreate -l <free PE extent> vg0 -n data
mkfs.ext4 /dev/vg0/data -L data
 
Add to the /etc/fstab this line, re-mount, and check the result:
/dev/vg0/data /data ext4 defaults 0 0
mount -a
df -h
 
If everything is fine, create the two directories, we'll need them later in Proxmox admin interface:
mkdir -p /data/iso/template/iso
mkdir -p /data/backup
 

Proxmox VE 3.x Installation

First, become root via sudo su
 
Add to /etc/apt/sources.list the following lines:
###########################################################################
# PVE packages provided by proxmox.com
deb http://download.proxmox.com/debian squeeze pve
 
Add the Proxmox VE repository key:
wget -O- "http://download.proxmox.com/debian/key.asc" | apt-key add -
 
Update your repository and system by running:
aptitude update
aptitude full-upgrade
 
And now install Proxmox VE Kernel. The exact kernel might differ in the future, as of the time being it is as follows, but always check it at Proxmox:
aptitude install pve-kernel-2.6.32-12-pve
 
Than reboot, become root, and make sure Proxmox VE Kernel is seleted on boot.
uname -a
 
The result should be something like:
Linux wepoca 2.6.32-12-pve #1 SMP Tue May 15 06:02:20 CEST 2012 x86_64 GNU/Linux
 
Now install the Proxmox VE packages:
aptitude install proxmox-ve-2.6.32
 
There will be two decisions during the install, accept defaults, but read what you are doing!
1. 
The following packages have unmet dependencies:
pve-firmware: Conflicts: firmware-linux-nonfree but 0.28+squeeze1 is installed.
                Conflicts: firmware-realtek but 0.28+squeeze1 is installed.
The following actions will resolve these dependencies:
 
     Remove the following packages:
1)     firmware-linux-nonfree      
2)     firmware-realtek            
 
Accept this solution? [Y/n/q/?]
 
2. Listening address for citadel server
 a. 0.0.0.0 (default)

 b. internal authentication (Citadel will use its own internal user accounts database) 

Configure pve-redirect for apache2:
a2ensite pve-redirect.conf
 
And restart apache:
/etc/init.d/apache2 restart
 
Install the rest of needed packages:
aptitude install ntp ssh lvm2 postfix ksm-control-daemon vzprocps mtr-tiny mc
 
One decision (accept defaults, but read it!)
The following NEW packages will be installed:
  ksm-control-daemon postfix{b} ssh vzprocps 
0 packages upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 1526 kB of archives. After unpacking 3883 kB will be used.
The following packages have unmet dependencies:
  postfix: Conflicts: mail-transport-agent which is a virtual package.
  citadel-mta: Conflicts: mail-transport-agent which is a virtual package.
The following actions will resolve these dependencies:
 
     Remove the following packages:
1)     citadel-mta                 
 
Accept this solution? [Y/n/q/?] 
 
Accept the suggestion to remove Exim and configure postfix according to your network as an “Internet site”
host: wepoca.net
 
Now check the resulting setup with pveversion -v
pve-manager: 2.1-1 (pve-manager/2.1/f9b0f63a)
running kernel: 2.6.32-12-pve
proxmox-ve-2.6.32: 2.1-68
pve-kernel-2.6.32-12-pve: 2.6.32-68
lvm2: 2.02.95-1pve2
clvm: 2.02.95-1pve2
corosync-pve: 1.4.3-1
openais-pve: 1.1.4-2
libqb: 0.10.1-2
redhat-cluster-pve: 3.1.8-3
resource-agents-pve: 3.9.2-3
fence-agents-pve: 3.1.7-2
pve-cluster: 1.0-26
qemu-server: 2.0-39
pve-firmware: 1.0-16
libpve-common-perl: 1.0-27
libpve-access-control: 1.0-21
libpve-storage-perl: 2.0-18
vncterm: 1.0-2
vzctl: 3.0.30-2pve5
vzprocps: 2.0.11-2
vzquota: 3.0.12-3
pve-qemu-kvm: 1.0-9
ksm-control-daemon: 1.1-1
 

Create user for Proxmox web interface

Login to the host, become root. First create the admin group, with all (!) admin rights to PVE
pveum groupadd admin -comment "System Administrators"
pveum aclmod / -group admin -role Administrator
 
Next, create the user (same as the first user - after root - in Debian), and add it to the admin group

pveum useradd yourusername@pam -comment 'Wepoca'

Optionally change password or leave the same as the linux user:
pveum passwd yourusername@pam

Finally, add user to the admin group:
pveum usermod yourusername@pam -group admin

Then log in as yourusername@pam to the Proxmox web interface using the IP of your EX4 host from Hetzner https://<your-IP>:8006/

As a first config over the web, you can set the keyboard locale at Datacenter --> Options --> keyboard, according to your preference.

Set also the storage for Proxmox over Datacenter --> Storage, as defined above, for ISO and for backup files. Do not forget to add the Proxmox user (yourusername in this excersice) in Datacenter --> Users.

In the next tutorial I'll follow-up with how to setup the network and how to install and configure a firewall called Shorewall which is a kind of a front-end to iptables/netfilter.