Install libguestfs on proxmox

Proxmox is a good software for manageing kvm and openvz guests. However it does not shine in making changes to the already deployed (expecially KVM) guests. What I mean by not shine? You cannot assign a static IP address to a KVM guest which was deployed from a template. You cannot modify it's hostname, password, increase partitions if they are not LVM based. Therefore you need a tool which could do all those stuff for you and here is where libguestfs comes in the game.

If you don't have a proxmox subscription you will find out that it is impossible to make an update to your proxmox machine since it will break on the proxmox repository. First you need to edit the proxmox repository file:
/etc/apt/sourses.list.d/pve-enterprise.list comment out the line which is in that file and add the following line into it.

deb http://download.proxmox.com/debian wheezy pve-no-subscription

The content of the file should look like this:

#deb https://enterprise.proxmox.com/debian wheezy pve-enterprise
deb http://download.proxmox.com/debian wheezy pve-no-subscription

For the changes to take effect you have to run apt-get update

#apt-get update

Install all the dependencies by running the following command:

#apt-get -y install augeas-lenses augeas-tools autoconf automake autopoint autotools-dev camlp4 comerr-dev debirf debootstrap dos2unix e2fslibs-dev fakechroot febootstrap genisoimage gettext git git-man gperf htop ledit libaugeas-dev libaugeas0 libavahi-client3 libavahi-common-data libavahi-common3 libburn4 libcap-ng0 libcroco3 libdb5.1-dev libdrm-intel1 libdrm-nouveau1a libdrm-radeon1 libdrm2 liberror-perl libexpat1-dev libfakechroot libfindlib-ocaml libfindlib-ocaml-dev libfontenc1 libgettextpo0 libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libhivex-dev libhivex0 libisoburn1 libisofs6 libjte1 libmagic-dev libncurses5-dev libnetcf1 libnl1 libnuma1 libpciaccess0 libpcre++-dev libpcre++0 libpcre3-dev libpcrecpp0 libpython2.7libpython3.2 libreadline-dev libreadline6-dev libsgmls-perl libsp1c2 libssl-dev libssl-doc libterm-readkey-perl libtinfo-dev libunistring0 libvirt-dev libvirt0 libxcb-glx0 libxcb-shape0 libxcomposite1 libxdamage1 libxen-4.1 libxen-dev libxenstore3.0 libxfont1 libxinerama1 libxml-light-ocaml libxml-light-ocaml-dev libxml2-dev libxrandr2 libxv1 libxxf86dga1 libxxf86vm1 libyajl2 lsb-release module-init-tools nfs-kernel-server ntfs-3g ocaml-base-nox ocaml-findlib ocaml-interp ocaml-native-compilers ocaml-nox pkg-config po4a powermgmt-base python-dev python2.7-dev python3 python3-all python3-all-dbg python3-dbg python3-dev python3-minimal python3.2 python3.2-dbg python3.2-dev python3.2-minimal shtool sp sudo tightvncserver unzip vim vim-runtime x11-utils x11-xserver-utils xfonts-base xfonts-encodings xfonts-utils xorriso zip zlib1g-dev

Run the upgrade of the software

#apt-get upgrade

Now download the libguestfs version 1.20.x newer versions are not compatible with the debian wheezy.

#wget http://libguestfs.org/download/1.20-stable/libguestfs-1.20.12.tar.gz

Now we unachive the libguestfs and install it

#tar -xzvf libguestfs-1.20.12.tar.gz
#cd libguestfs-1.20.12
#./configure
#make
#make install

After the libguestfs was successfully installed you have to update the path so that the software would know where to look for the needed libraries

#ldconfig

The version of febootstrap installed by apt is an older version and some options are not available therefore we need to install a newer version.

We will cloning a newer version from the github then install it.

#git clone https://github.com/libguestfs/febootstrap
#cd febootstrap
#autobuild.sh
#autogen.sh
#./configure
#make
#make install

After a successfull installation just reboot the server so that it would load the new kernel versions if any.
Note: all command are assuming full root access. If you only have sudo access then prepend sudo to the commands.

Keresztes Péter-Zoltán

Read more posts by this author.

Subscribe to IT Ghost

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!