[Libvir] Howto: install libvirt on Debian Etch (the ugly way)

Hello list I read on the list that other people tried to install libvirt on Debian Etch. I finally succeeded so I'll post a little Howto. Maybe someone with a better understanding of automake and C stuff knows a nicer way but the ugly folder with the links to the different header files. The start point is a Debian Etch with a running Xen (in my case it's the xen-hypervisor-3.0.3-1-i386-pae package). If you're not using the PAE version of the xen-hypervisor change the "apt-get source" line accordingly. First you will need to install a bunch of development packages apt-get install build-essential libxml2-dev libncurses5-dev apt-get isntall libreadline5-dev python-dev Go to your home directory and install the Xen hypervisor sources cd apt-get source xen-hypervisor-3.0.3-1-i386-pae Create a folder with a bunch of symbolic links. We will use this folder libvirt to find the header files. mkdir libvirt-include cd libvirt-include/ ln -s /root/xen-3.0-3.0.3-0/xen/include/public/xen.h ln -s /root/xen-3.0-3.0.3-0/tools/xenstore/xs.h ln -s /root/xen-3.0-3.0.3-0/tools/xenstore/xs_lib.h ln -s /root/xen-3.0-3.0.3-0/xen/include/public xen ln -s /root/xen-3.0-3.0.3-0/linux-2.6-xen-sparse/include/xen/public/ xen/linux Configure the dynamic linker that it will be able to find the libxenstore library echo '/usr/lib/xen-3.0.3-1/lib' > /etc/ld.so.conf.d/i486-linux-gnu.conf ldconfig Go to your home directory, download an extract the libvirt source package cd wget http://libvirt.org/sources/libvirt-0.2.3.tar.gz tar xvfz libvirt-0.2.3.tar.gz cd libvirt-0.2.3 Configure, build and install the libvirt CFLAGS="-fno-stack-protector -I/root/libvirt-include -L/usr/lib/xen-3.0.3-1/lib" ./configure --with-xen --without-qemu make make install Enable the Unix socket server for xend. Edit /etc/xen/xend-config.sxp and change the line #(xend-unix-server no) to (xend-unix-server yes) Restart your Xen-Daemon /etc/init.d/xend restart If everything work you should see your running virtual machines when you enter virsh list Regards Roman

On Wed, Jul 04, 2007 at 09:55:20PM +0200, Roman Ammann wrote:
I read on the list that other people tried to install libvirt on Debian Etch. I finally succeeded so I'll post a little Howto. Maybe someone with a better understanding of automake and C stuff knows a nicer way but the ugly folder with the links to the different header files.
The start point is a Debian Etch with a running Xen (in my case it's the xen-hypervisor-3.0.3-1-i386-pae package). If you're not using the PAE version of the xen-hypervisor change the "apt-get source" line accordingly.
First you will need to install a bunch of development packages
apt-get install build-essential libxml2-dev libncurses5-dev apt-get isntall libreadline5-dev python-dev
Go to your home directory and install the Xen hypervisor sources
cd apt-get source xen-hypervisor-3.0.3-1-i386-pae
Create a folder with a bunch of symbolic links. We will use this folder libvirt to find the header files.
mkdir libvirt-include cd libvirt-include/ ln -s /root/xen-3.0-3.0.3-0/xen/include/public/xen.h ln -s /root/xen-3.0-3.0.3-0/tools/xenstore/xs.h ln -s /root/xen-3.0-3.0.3-0/tools/xenstore/xs_lib.h ln -s /root/xen-3.0-3.0.3-0/xen/include/public xen ln -s /root/xen-3.0-3.0.3-0/linux-2.6-xen-sparse/include/xen/public/ xen/linux
Configure the dynamic linker that it will be able to find the libxenstore library
echo '/usr/lib/xen-3.0.3-1/lib' > /etc/ld.so.conf.d/i486-linux-gnu.conf ldconfig
Hum, this really is the installation of Xen, hopefully you should be able to download prepackaged version, including the development part to avoid this, but I have no experience with Debian myself.
Go to your home directory, download an extract the libvirt source package
cd wget http://libvirt.org/sources/libvirt-0.2.3.tar.gz tar xvfz libvirt-0.2.3.tar.gz cd libvirt-0.2.3
Configure, build and install the libvirt
That is the standard process, but again using prepackaged versions would be nicer. Also note that theorically libvirt should now be able to compile and work without Xen support assuming QEmu (and possibly KVM support in recent kernel versions).
CFLAGS="-fno-stack-protector -I/root/libvirt-include -L/usr/lib/xen-3.0.3-1/lib" ./configure --with-xen --without-qemu make make install
Enable the Unix socket server for xend. Edit /etc/xen/xend-config.sxp and change the line
#(xend-unix-server no)
to
(xend-unix-server yes)
I would also make sure the http server is desactivated this is a giant security hole: #(xend-http-server no)
Restart your Xen-Daemon
/etc/init.d/xend restart
If everything work you should see your running virtual machines when you enter
virsh list
Ideally we should find prepackaged version for most common OS, coming with the OS or from trusted sources. I'm fine pointing to such repositories, and providing instructions on how to install in the FAQ. And if the problem is storage, I'm fine hosting packages on libvirt.org itself, I just need a person willing to maintain the package for one year at least (i.e. providing updates). And as usual if there is portability problems and/or fixes, send them to the list, I'm eager to get libvirt on new platform, new oses, and new virtualization engines ! For example I'm wondering about -fno-stack-protector passed before, why is that needed ? Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Wed, Jul 04, 2007 at 04:45:26PM -0400, Daniel Veillard wrote:
On Wed, Jul 04, 2007 at 09:55:20PM +0200, Roman Ammann wrote:
I read on the list that other people tried to install libvirt on Debian Etch. I finally succeeded so I'll post a little Howto. Maybe someone with a better understanding of automake and C stuff knows a nicer way but the ugly folder with the links to the different header files.
The start point is a Debian Etch with a running Xen (in my case it's the xen-hypervisor-3.0.3-1-i386-pae package). If you're not using the PAE version of the xen-hypervisor change the "apt-get source" line accordingly.
First you will need to install a bunch of development packages
apt-get install build-essential libxml2-dev libncurses5-dev apt-get isntall libreadline5-dev python-dev
Go to your home directory and install the Xen hypervisor sources
cd apt-get source xen-hypervisor-3.0.3-1-i386-pae
Create a folder with a bunch of symbolic links. We will use this folder libvirt to find the header files.
mkdir libvirt-include cd libvirt-include/ ln -s /root/xen-3.0-3.0.3-0/xen/include/public/xen.h ln -s /root/xen-3.0-3.0.3-0/tools/xenstore/xs.h ln -s /root/xen-3.0-3.0.3-0/tools/xenstore/xs_lib.h ln -s /root/xen-3.0-3.0.3-0/xen/include/public xen ln -s /root/xen-3.0-3.0.3-0/linux-2.6-xen-sparse/include/xen/public/ xen/linux
Configure the dynamic linker that it will be able to find the libxenstore library
echo '/usr/lib/xen-3.0.3-1/lib' > /etc/ld.so.conf.d/i486-linux-gnu.conf ldconfig
Hum, this really is the installation of Xen, hopefully you should be able to download prepackaged version, including the development part to avoid this, but I have no experience with Debian myself.
This is because the xen-devel equivalent on Debian was not including the header files for Xen. I believe this problem is in the process of being fixed, so this work around won't be neccessary in future. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

I writed a howto to compile the libvirt and virt-manager on Debian etch: http://wiki.xen-br.org/index.php?title=Compiling_libvirt_in_Debian_etch I make a libxen3-dev to solve the libvirt compilation (in document). Regards Marco Sinhoreli On 7/4/07, Daniel P. Berrange <berrange@redhat.com> wrote:
On Wed, Jul 04, 2007 at 09:55:20PM +0200, Roman Ammann wrote:
I read on the list that other people tried to install libvirt on Debian Etch. I finally succeeded so I'll post a little Howto. Maybe someone with a better understanding of automake and C stuff knows a nicer way but the ugly folder with the links to the different header files.
The start point is a Debian Etch with a running Xen (in my case it's
xen-hypervisor-3.0.3-1-i386-pae package). If you're not using the PAE version of the xen-hypervisor change the "apt-get source" line accordingly.
First you will need to install a bunch of development packages
apt-get install build-essential libxml2-dev libncurses5-dev apt-get isntall libreadline5-dev python-dev
Go to your home directory and install the Xen hypervisor sources
cd apt-get source xen-hypervisor-3.0.3-1-i386-pae
Create a folder with a bunch of symbolic links. We will use this folder libvirt to find the header files.
mkdir libvirt-include cd libvirt-include/ ln -s /root/xen-3.0-3.0.3-0/xen/include/public/xen.h ln -s /root/xen-3.0-3.0.3-0/tools/xenstore/xs.h ln -s /root/xen-3.0-3.0.3-0/tools/xenstore/xs_lib.h ln -s /root/xen-3.0-3.0.3-0/xen/include/public xen ln -s /root/xen-3.0-3.0.3-0/linux-2.6-xen-sparse/include/xen/public/ xen/linux
Configure the dynamic linker that it will be able to find the
echo '/usr/lib/xen-3.0.3-1/lib' > /etc/ld.so.conf.d/i486-
ldconfig
Hum, this really is the installation of Xen, hopefully you should be able to download prepackaged version, including the development part to avoid
On Wed, Jul 04, 2007 at 04:45:26PM -0400, Daniel Veillard wrote: the libxenstore library linux-gnu.conf this,
but I have no experience with Debian myself.
This is because the xen-devel equivalent on Debian was not including the header files for Xen. I believe this problem is in the process of being fixed, so this work around won't be neccessary in future.
Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
-- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
participants (4)
-
Daniel P. Berrange
-
Daniel Veillard
-
Marco Sinhoreli
-
Roman Ammann