Download and install a custom version of libvirt/virsh
CUSTOM_ROOT=/home/ajaisingh/n4/nested-vm/
mkdir -p $CUSTOM_ROOT/src
wget https://libvirt.org/sources/libvirt-4.0.0.tar.xz
# Compiling a new version of libvirt (v4.0.0), requires libnl-devel, libnl-route, libyajl-devel, libdevmapper-devel
sudo apt-get install libnl-route-3-dev
sudo apt-get install libnl-3-dev
sudo apt-get install libyajl-dev libyajl2
sudo apt-get install libdevmapper-dev
# If this step fails with some libraries missing, install those too, this is pretty machine specific.
./configure --prefix=/home/ajaisingh/n4/nested-vm/
make -j120
make install
Install libvirt-python next because we need to use virt-manager and that requires libvirt python bindings
cd $CUSTOM_ROOT/src
wget https://libvirt.org/sources/python/libvirt-python-4.0.0.tar.gz
tar -xvf libvirt-python-4.0.0.tar.gz
cd libvirt-python-4.0.0/
export LD_LIBRARY_PATH=$CUSTOM_ROOT/lib
export PKG_CONFIG_PATH=$CUSTOM_ROOT/lib/pkgconfig:$PKG_CONFIG_PATH
python setup.py build
python setup.py install --root $CUSTOM_ROOT
Then we install a custom virt-manager into the same location and it should ideally pick up the newer python bindings. (Otherwise set PYTHONPATH at runtime)
cd $CUSTOM_ROOT/src
wget https://virt-manager.org/download/sources/virt-manager/virt-manager-1.5.1.tar.gz
tar -xvf virt-manager-1.5.1.tar.gz
cd virt-manager-1.5.1/
python setup.py install --root $CUSTOM_ROOT
Finally get it all in your $PATH
:
export $PATH=$CUSTOM_ROOT/bin:$CUSTOM_ROOT/usr/bin:$PATH
There are some errors. This :
export PKG_CONFIG_PATH=$CUSTOM_ROOT/lib/pkgconfig:$PKG_CONFIG_PATH
becomes this :
export PKG_CONFIG_PATH=$CUSTOM_ROOT/lib/pkgconfig
and this :
export $PATH=$CUSTOM_ROOT/bin:$CUSTOM_ROOT/usr/bin:$PATH
becomes this :
export PATH=$CUSTOM_ROOT/bin:$CUSTOM_ROOT/usr/bin:$PATH