Get Social

Installing proxmox on debian wheezy

I’ve heard about this system of virtualization earlier (http://en.wikipedia.org/wiki/Proxmox)…

This is a system using KVM and OpenVZ as hypervisors and having a convenient web interface for management. So, we have a pumped-up home computer with Debian Wheezy 7.3 (amd64) on board. When I finally decided to install it, it turned out that now, with the release of the new version of Proxmox 3.1, the policy of granting access to repositories has changed.

Here (https://pve.proxmox.com/wiki/Package_repositories) we can find descriptions of the repositories. I see that Proxmox VE Enterprise Repository is not suitable – it’s paid subscription.

Official guide (http://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_Wheezy) strongly recommends Proxmox VE No-Subscription Repository, but description of this repository scares me: “The pve-no-subscription repo can be used for testing and non-production use. Its not recommended to run on production servers as these packages are not always heavily tested and validated. As the name suggests, there is no Proxmox VE Subscription Key needed to access this repository.

What to do? I decided to try to put version 3.0 – a stable previous release.

Add a line to the package manager:

echo "deb http://download.proxmox.com/debian wheezy pve" >> /etc/apt/sources.list

Further, we will do, as described in the documentation. Put the repository key:

wget -O- "http://download.proxmox.com/debian/key.asc" | apt-key add -

Then update packages list and install currently available updates (I’m using aptitude):

aptitude update && aptitude safe-upgrade

Install kernel:

aptitude install pve-firmware pve-kernel-2.6.32-26-pve

At the same time, the system shown error message::

The following packages have unsatisfied dependencies:
 pve-firmware : Conflicts: firmware-linux-free but 3.2 installed
                Conflicts: firmware-linux-free:i386 which is a virtual package.
                Conflicts: firmware-realtek but 0.36+wheezy.1 installed
                Conflicts: firmware-realtek:i386 which is a virtual package.
The following actions will allow dependencies:

     Remove next packages:                                          
1)     firmware-linux-free                                              
2)     firmware-realtek                                                 

     Leave the following dependencies unresolved:                     
3)     linux-image-3.2.0-4-amd64 recommends firmware-linux-free (>= 3~)


Will you accept this decision? [Y/n/q/?]

I took this decision, so proxmox developers propose to remove the kernel linux-image-3.2.0-4-amd64
After checking after rebooting, that everything works with kernel pve-kernel-2.6.32-26-pve, safely delete the default kernel:

aptitude remove linux-image-amd64 linux-image-3.2.0-4-amd64

We check the bootloader configuration:

update-grub

Now we install Proxmox VE packages:

aptitude install proxmox-ve-2.6.32 ntp ssh lvm2 postfix ksm-control-daemon vzprocps open-iscsi bootlogd

Enter https://your-hostname:8006/ and rejoice!

Errors when installing Proxmox on Debian

[1] Proxmox: initscript rrdcached, action “start” failed

The installation of proxmox-ve-2.6.32 and its dependencies was interrupted by a specific error:

Configures package rrdcached (1.4.7-2) …
Starting RRDtool data caching daemon: rrdcachedBase directory (-b) resolved via file system links!
Please consult rrdcached '-b' documentation!
Consider specifying the real directory (/media/all/var/lib/rrdcached/db)
invoke-rc.d: initscript rrdcached, action "start" failed.
dpkg: Error while processing parameter rrdcached (--configure):
 Subprocess installed post-installation script returned error code 5
dpkg: Dependencies do not allow to configure package pve-cluster:
 pve-cluster depends on rrdcached, hovewer:
  Package rrdcached not yet configured.

This was due to the fact that I made /var directory as symbolic link from the directory located on same hard drive, while the root of the system is on the SSD. I could, of course, mount it, but I was too lazy to create a separate partition for /var, so I used the same partition as /home. You should not have such a problem.

Overcame it so:

1) Determine where the configuration is stored

dpkg -L rrdcached

...
/etc/default/rrdcached
...

2) Open file and uncomment the parameter, specifying folder actual location without symbolic links:

nano /etc/default/rrdcached

...
OPTS="-b /media/all/var/lib/rrdcached/db"
...

[2] Proxmox: Unable to get local IP address

Configures package pve-cluster (3.0-8) …
[....] Starting pve cluster filesystem : pve-cluster[main] crit: Unable to get local IP address
 (warning).
invoke-rc.d: initscript pve-cluster, action "start" failed.

How I overcame it (rocknroothost -this is my hostname, substitute it with your one here):

cp -av /etc/hosts /etc/hosts.original

Then we edit /etc/hosts for next view:

---
127.0.0.1 localhost.localdomain localhost
192.168.99.99 rocknroothost.pp.ua rocknroothost pvelocalhost
---

Also /etc/hostname for such view:

---
rocknroothost
---

after that we need execute:

apt-get install -f

And installation process will continue

/etc/init.d/hostname.sh start

[3] Proxmox: failed to load

Finally, having worn out the installation, I enter the browser:
http://rocknroothost:8006/ => get error: failed to load, and I check service

lsof -i tcp:8006

I break my head, google … but it’s just ridiculous – I had to watch carefully:
https , no http 🙂

Delete the message proxmox “No Valid Subscription”

How to we can remove proxmox message “No Valid Subscription”?

To do this, you just need to edit the file pvemanagerlib.js:

open in test editor:

nano /usr/share/pve-manager/ext4/pvemanagerlib.js

You can use “locate pvemanagerlib.js” command to find this file.

Find the line:

  if (data.status !== 'Active') {

We copy and comment on it (just in case) and correct, as shown below:

//  if (data.status !== 'Active') {
  if (false) {

Now “No Valid Subscription” message does not bother us anymore.

Update. path in new proxmox version: /usr/share/pve-manager/js/pvemanagerlib.js

Installing and configuring the adminer on debian (phpmyadmin alternative)

On my current work, there was a task to install and adjust this tool.

What is it? According to Wikipedia: “Adminer (formerly known as phpMinAdmin) is a tool for managing content in MySQL databases (since version 2 also in PostgreSQL, MS SQL, SQLite and Oracle databases).

Next – go to his site and get acquainted closer … We see that there is simply an adminer, and there is – adminer-mysql. We need for mysql. Since the package for it is still in the sid branch, it will not turn out beautifully from the repository. We will not connect this branch so that the package manager does not become littered, especially since the entire utility is one file and we can have the latest version simply by downloading it from the site. On our Debian server, create a directory and download the latest version of adminer:

mkdir /var/www/adminer
cd /var/www/adminer
wget https://www.adminer.org/latest-mysql.php

Next, create a configuration file for Apache:

nano /etc/apache2/conf.d/adminer.conf

Add the following entry:

Alias /adminer /var/www/adminer

<Directory /var/www/adminer>
        Options FollowSymLinks
        DirectoryIndex latest-mysql.php

        <IfModule mod_php5.c>
                AddType application/x-httpd-php .php

                php_flag magic_quotes_gpc Off
                php_flag track_vars On
                php_flag register_globals Off
                php_value include_path .
        </IfModule>
</Directory>

Now, use it with url: http://yourserver/adminer

P.S. It is also possible to change the interface – you just need to download the file adminer.css to the adminer.php directory.