So I got a lot further building libguestfs on Ubuntu, up to the point where I can boot the appliance and run some simple commands. We need to push some patches upstream, and there are still some things in Ubuntu itself which are broken. This documents how far I've got. (1) libguestfs from git, Ubuntu 9.10, all updated to the latest versions. You will of course also need to read the README file and install the long list of dependencies, all of which are in the Ubuntu repositories. http://git.annexia.org/?p=libguestfs.git;a=summary http://libguestfs.org/README.txt (2) I'm going to post patches as follow-ups to this email, of which most/all will be required. (3) You will need debirf 0.25. I installed it from: http://gb.archive.ubuntu.com/ubuntu/pool/universe/d/debirf/ (4) This is how I'm configuring: ./autogen.sh \ --with-readline \ --with-repo=karmic \ --with-mirror=http://gb.archive.ubuntu.com/ubuntu/ \ --enable-debug-command (5) make (6) 'make check' fails during the Gnulib tests. (7) After building you can do a quick sanity check: $ ./fish/guestfish alloc /tmp/test.img 10M : run : list-devices /dev/sda If it doesn't work, add the '-v' option and post the full output here. I was able to run some basic guestfish commands, but I didn't yet test it extensively. Rich. ---------------------------------------------------------------------- $ ./fish/guestfish Welcome to guestfish, the libguestfs filesystem interactive shell for editing virtual machine filesystems. Type: 'help' for help with commands 'quit' to quit the shell
<fs> alloc /tmp/test.img use 'alloc file size' to create an image <fs> alloc /tmp/test.img 10M <fs> run open /dev/kvm: No such file or directory Could not initialize KVM, will disable KVM support <fs> list-devices /dev/sda <fs> help part-disk NAME part-disk - partition whole disk with a single primary partition
SYNOPSIS part-disk device parttype DESCRIPTION This command is simply a combination of "part_init" followed by "part_add" to create a single primary partition covering the whole disk. "parttype" is the partition table type, usually "mbr" or "gpt", but other possible values are described in "part_init". This command is dangerous. Without careful use you can easily destroy all your data.
<fs> part-disk /dev/sda mbr <fs> mkfs ext3 /dev/sda1 <fs> mount /dev/sda1 / <fs> touch /hello <fs> umount-all <fs> list-partitions /dev/sda1 <fs> sync <fs> $ strings /tmp/test.img lost+found hello lost+found hello
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
These are some experimental patches. By applying all 5 I was able to get Ubuntu to build and work (but see parent message, you still need debirf 0.25). 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
We are using a modified debirf install-kernel script (actually, it's called install_kernel in libguestfs). This didn't work with the latest Ubuntu and/or debirf, so this patch reverts to symlinking to the one shipped with debirf. I haven't tested whether this still works on Debian. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
On Mon, Dec 21, 2009 at 04:01:29PM +0000, Richard W.M. Jones wrote:
We are using a modified debirf install-kernel script (actually, it's called install_kernel in libguestfs). This didn't work with the latest Ubuntu and/or debirf, so this patch reverts to symlinking to the one shipped with debirf.
I haven't tested whether this still works on Debian. You can't specify the kernel architecture via $KARCH anymore. This turned out to be a problem when building on a 64bit host for a 32 bit sysmtem IIRC - I can patch that back in for Debian easily though. Cheers, -- Guido
It's not clear why we use aptitude instead of apt-get in these scripts. In debirf 0.25 on Ubuntu, aptitude appears to be uninstalled during creation of the appliance, so it obviously doesn't work. Revert to using apt-get. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
Hi Rich, On Mon, Dec 21, 2009 at 04:02:47PM +0000, Richard W.M. Jones wrote:
It's not clear why we use aptitude instead of apt-get in these scripts. In debirf 0.25 on Ubuntu, aptitude appears to be uninstalled during creation of the appliance, so it obviously doesn't work. Revert to using apt-get.
We should rather build-dep on aptitude here then - it's much more clever when it comes to dependency resolution. Cheers, -- Guido
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
From 59b0a9b3b08fcaa182c4816f606da8094020641b Mon Sep 17 00:00:00 2001 From: Richard Jones <rjones@ubuntu910x64.home.annexia.org> Date: Mon, 21 Dec 2009 15:52:36 +0000 Subject: [PATCH 2/5] Ubuntu: Use apt-get instead of aptitude when installing guestfsd.
--- appliance/debian/modules/y0_install-guestfsd | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/appliance/debian/modules/y0_install-guestfsd b/appliance/debian/modules/y0_install-guestfsd index c95e4f0..3eb8ba9 100755 --- a/appliance/debian/modules/y0_install-guestfsd +++ b/appliance/debian/modules/y0_install-guestfsd @@ -16,8 +16,8 @@ find $DEBIRF_ROOT/lib/modules/*/kernel -name '*.ko' $whitelist -a -exec rm '{}' # install additional packages: PKGLIST=$(< packagelist) echo "Will add $PKGLIST" -debirf_exec aptitude -R -y install $PKGLIST -debirf_exec aptitude -y remove vim-tiny dhcp3-client iptables +debirf_exec apt-get --assume-yes install $PKGLIST +debirf_exec apt-get --assume-yes remove vim-tiny dhcp3-client iptables
debirf_exec mkdir -p --mode=0777 /sysroot
-- 1.6.3.3
_______________________________________________ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
This patch is not necessary for Ubuntu support, but it seems better to run 'service udev start' instead of the init script directly. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
On Mon, Dec 21, 2009 at 04:04:00PM +0000, Richard W.M. Jones wrote:
This patch is not necessary for Ubuntu support, but it seems better to run 'service udev start' instead of the init script directly.
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
From 26e35f0690aaad0d64dd8f0a81ebd90377c826b2 Mon Sep 17 00:00:00 2001 From: Richard Jones <rjones@ubuntu910x64.home.annexia.org> Date: Mon, 21 Dec 2009 15:54:00 +0000 Subject: [PATCH 3/5] appliance: Use 'service udev start' instead of running init script.
--- appliance/init | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/appliance/init b/appliance/init index b741a49..75eb03e 100755 --- a/appliance/init +++ b/appliance/init @@ -8,7 +8,7 @@ mount -t proc /proc /proc mount -t sysfs /sys /sys
if [ -x /etc/init.d/udev ]; then - /etc/init.d/udev start + service udev start Hmm...if we use the -x check above this doesn't really make a difference and it breaks Debian Lenny since /usr/sbin/service isn't there. Cheers, -- Guido
Now this is a tricky patch. In Ubuntu everything uses upstart and the udev script in particular has been converted to use upstart. The problem with this is that upstart isn't running, can't be run, and isn't desirable for minimal appliances even if we could run it. There is no alternative non-upstart way to start udev. Hence we start udev by hand with a sequence of commands, roughly based on 'start_udev' that Fedora ships, but greatly simplified. These commands seem to be the minimal ones which are necessary to start udevd, although in fine tradition nothing is documented anywhere. I haven't tested whether this sequence of commands is suitable for Fedora or Debian yet. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
On Mon, Dec 21, 2009 at 04:09:10PM +0000, Richard W.M. Jones wrote: [..snip..]
-if [ -x /etc/init.d/udev ]; then +if [ -x /sbin/udevd ]; then + echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug + /sbin/udevd --daemon + /sbin/udevadm trigger + /sbin/udevadm settle --timeout=10 +elif [ -x /etc/init.d/udev ]; then service udev start elif [ -x /sbin/start_udev ] && /sbin/start_udev; then Shouldn't this be: if [ -x /etc/init.d/udev ]; then .... elif [ -x /sbin/udevd ]; then ... elif ...
Otherwise we'll start udev by hand even if the init script is there. Cheers, -- Guido
Several packages appear to be missing on Ubuntu. The NTFS-3g package cannot be installed because it provokes an error in the installation of fuse-utils. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
On Mon, Dec 21, 2009 at 04:10:59PM +0000, Richard W.M. Jones wrote: [..snip..]
#elif DEBIAN == 1 bsdmainutils - btrfs-tools + /* Not on Ubuntu: btrfs-tools */ /* Dependency problem prevents installation of these two: gfs-tools gfs2-tools @@ -37,10 +39,12 @@ hfsplus iproute libaugeas0 - nilfs2-tools + /* Not on Ubuntu: nilfs2-tools */ + /* Fails to install on Ubuntu: ntfs-3g */ reiserfsprogs udev util-linux + /* Not on Ubuntu: zerofree */ #endif Wouldn't it be nicer to have a "UBUNTU == 1" otherwise we'd penalize Debian for Ubuntu's brokeness? Cheers, -- Guido
Yes, I can confirm also on Ubuntu Lucid that libguestfs builds smoothly with the series of patches. I'm having fun finally using the latest version natively :) -- Wolf On Mon, 2009-12-21 at 20:22 +0100, Guido Günther wrote:
On Mon, Dec 21, 2009 at 03:43:57PM +0000, Richard W.M. Jones wrote:
So I got a lot further building libguestfs on Ubuntu, up to the point where I can boot the appliance and run some simple commands. We need Very cool! -- Guido
_______________________________________________ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
As a follow-up, I ran some tests (attached is the output): make -C capitests check make -C regressions check The C API tests made me realize there was some ntfs stuff missing in my Lucid Appliance in the "ntfsprogs" package (mkfs.ntfs). Adding that to the package list made all the ntfs tests pass. -- Wolf On Mon, 2009-12-21 at 14:31 -0500, Wolfgang Richter wrote:
Yes, I can confirm also on Ubuntu Lucid that libguestfs builds smoothly with the series of patches. I'm having fun finally using the latest version natively :)
-- Wolf
On Mon, 2009-12-21 at 20:22 +0100, Guido Günther wrote:
On Mon, Dec 21, 2009 at 03:43:57PM +0000, Richard W.M. Jones wrote:
So I got a lot further building libguestfs on Ubuntu, up to the point where I can boot the appliance and run some simple commands. We need Very cool! -- Guido
_______________________________________________ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
_______________________________________________ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
[I have CC'd this to some people who have asked about libguestfs on Ubuntu on the mailing list.] I made some experimental, lightly tested, unsupported packages for Ubuntu available here: http://www.annexia.org/tmp/debian/ You will need Ubuntu 9.10 & amd64. These are based on the Debian packaging[1] done by Guido Gunther and Laurent Leonard, many thanks to them: http://git.debian.org/?p=pkg-libvirt/libguestfs.git;a=summary http://wiki.debian.org/Teams/DebianLibvirtTeam The five Ubuntu patches from before are straight rebases, and you can find a few other things I changed in the sources. What is missing is libsys-virt-perl (Sys::Virt, the Perl bindings for libvirt). Since this doesn't exist on Ubuntu, you will have to supply it yourself, or install the package with a broken dependency (dpkg seems to allow this? - I was a bit surprised). Without this package, virt-inspector and a few other bits won't work. If you want help, please post on the mailing list: http://www.redhat.com/mailman/listinfo/libguestfs Rich. [1] The Debian packaging doesn't work on Debian, because of what appears to be a bug in fakeroot: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=561991 -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
participants (3)
-
Guido Günther -
Richard W.M. Jones -
Wolfgang Richter