Thursday, 30 January 2014

compile and install libvirt

Compile and Install libvirt on Ubuntu 12.04 

( $virsh -c esx://example.com/ error: invalid argument in libvirt was built without the 'esx' driver)

libvirt uses the standard configure/make/install steps:

Compiling from source

1) Download the libvirt-1.0.3.tar.gz from libvirt.org
    or
    use wget http://libvirt.org/source/ libvirt-1.0.3.tar.gz
2) extract all

$tar -xvf  libvirt-1.0.3.tar.gz

3) $cd libvirt-1.0.3

4) Install the dependencies such as  

sudo apt-get install gcc make pkg-config libxml2-dev libgnutls-dev libdevmapper-dev libcurl4-gnutls-dev python-dev libpciaccess-dev libxen-dev libnl-dev
       
5) ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --with-esx=yes --with-xen=yes

6) make
    sudo make install
7) Check whether libvirt and virsh were installed

virsh  --version
libvirt --libvirt

It displays 1.0.3 for libvirt


Try connecting to esx hypervios  using virsh commands

$virsh -c esx://example.com?no_verify=1
(replace example.com with ip or url)

enter the username and password of the node(hypervisor)

after authentication it will redirect to virsh mode:
#virsh

Now start using virsh commands to create, start, suspend, resume virtual machines.

 


      

No comments:

Post a Comment