On Wed, Apr 04, 2012 at 02:08:33PM +0100, Richard W.M. Jones wrote:
Ubuntu are now supplying a libguestfs package (or to be more
accurate,
they are just copying the Debian package) but it doesn't work out of the box.
There is a bug in apt which we worked around in febootstrap 3.14, but
the supplied version of febootstap is only 3.12. Hence you will get
errors like this during installation:
febootstrap: aptitude: error: no file was downloaded corresponding to package <some
package name>
and you'll get the same error if you try to build from source.
The solution is to build febootstrap 3.14:
cd /tmp
sudo apt-get build-dep febootstrap
sudo apt-get install devscripts
apt-get source febootstrap
wget
http://people.redhat.com/~rjones/febootstrap/files/febootstrap-3.14.tar.gz
tar zxf febootstrap-3.14.tar.gz
cd febootstrap-3.14
rm -rf debian
cp -a ../febootstrap-3.12/debian .
vi debian/changelog
# change the first line: 3.12 -> 3.14
debuild -i -uc -us -b
That will create an febootstrap 3.14 .deb file in /tmp which you can
install:
sudo dpkg -i ../febootstrap_3.14-1_amd64.deb
Then you can go ahead and use the libguestfs package:
sudo update-guestfs-appliance
or compile libguestfs from source.
There is another problem which you may hit, if you add a completely
blank disk to libguestfs (this also affects libguestfs-test-tool):
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/931371
https://bugzilla.kernel.org/show_bug.cgi?id=42778
I've found a way around the last problem, which seems to be caused by
the version of qemu-kvm in Ubuntu, not the kernel.
If you compile qemu from source and use that, then it works (for me).
Do:
git clone
git://git.qemu.org/qemu.git
cd qemu
./configure
make
Then create a 'qemu.wrapper' file containing (edited):
#!/bin/sh -
qemudir=/home/user/d/qemu
exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "$@"
and:
chmod +x qemu.wrapper
(See:
http://libguestfs.org/guestfs.3.html#qemu_wrappers )
Then set the environment variable:
export LIBGUESTFS_QEMU=/home/user/d/qemu/qemu.wrapper
Then run libguestfs / virt-tools programs as normal (albeit slower
because it's qemu, not full upstream KVM).
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top