[Libguestfs] libguestfs on Ubuntu 10.04 LTS (was: Re: appliance VM won't start, can't find /init, but /init is in the image.)

Richard W.M. Jones rjones at redhat.com
Thu Sep 1 12:21:16 UTC 2011


David,

Better late than never ...  I have fixed all the problems with the
Ubuntu 10.04 LTS build, and libguestfs works and passes the testsuite.

There were several problems stopping this.  As you diagnosed,
'apt-cache depends --recurse' is simply broken in this version of
Ubuntu.  I first tried to backport the newer version, but it has far
too many dependencies that would also have to be updated.  Instead I
pushed a workaround into febootstrap:

http://git.annexia.org/?p=febootstrap.git;a=commitdiff;h=e4c7daf8bcdcf094719b3169ed79aece64a933bd
http://git.annexia.org/?p=febootstrap.git;a=commitdiff;h=72101b100aa33b0b9879f9b18edfdd88c1aa2755
http://git.annexia.org/?p=febootstrap.git;a=commitdiff;h=3ac623701e5fe5ce94b22b4f40f72ee0161d5184

Also, as you were very close to diagnosing, there were a few problems
with the appliance init script.  This version of Ubuntu does not
create a /sys directory, so mounting /sys failed, and that caused a
cascade of other failures.  The fix is simple:

http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=5b012024c49672cc69635ff01f9b9e4f87de1c65

Ubuntu has an old version of gettext, so you need to apply a patch to
po/Makefile.in.in (patch not upstream, attached).

udev is too old.  Even with fixed udev rules for creating
virtio-serial ports, the symlinks aren't being created.  Instead of
trying to work out why this was, I just hacked the daemon to look for
the port directly (patch not upstream, attached).

Those were the code changes.

I also had to manually backport and build the following packages from
oneiric:

- hivex_1.2.7-1build1 [not strictly required]
- qemu-kvm_0.14.1+noroms-0ubuntu3
- vgabios_0.6c-2ubuntu3

I also had to install linux-image-2.6.38-10-server from lucid-updates,
and fix the broken permissions, see
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759725 .

With all that lot, it works and passes the test suite.

I'm going to put some proper instructions and sources and binaries on
the website later.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/
-------------- next part --------------
>From 999afc31da4f4cf0eaeb4f1d243b8e09b82790f0 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones at redhat.com>
Date: Thu, 1 Sep 2011 12:47:46 +0100
Subject: [PATCH 1/2] ubuntu 10.04: Old version of gettext in Ubuntu.

---
 po/Makefile.in.in |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/po/Makefile.in.in b/po/Makefile.in.in
index 83d8838..114b230 100644
--- a/po/Makefile.in.in
+++ b/po/Makefile.in.in
@@ -9,7 +9,7 @@
 # General Public License and is *not* in the public domain.
 #
 # Origin: gettext-0.18
-GETTEXT_MACRO_VERSION = 0.18
+GETTEXT_MACRO_VERSION = 0.17
 
 PACKAGE = @PACKAGE@
 VERSION = @VERSION@
-- 
1.7.0.4

-------------- next part --------------
>From 68a4a5fa434948210afc30e62bc6ed4c0745a5a5 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones at redhat.com>
Date: Thu, 1 Sep 2011 13:00:11 +0100
Subject: [PATCH 2/2] ubuntu 10.04: Use /dev/vport0p1.

Ubuntu 10.04 LTS does not have the right udev rules to create
the symlink with the channel name.
---
 daemon/guestfsd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
index 51bb0b7..661291f 100644
--- a/daemon/guestfsd.c
+++ b/daemon/guestfsd.c
@@ -112,7 +112,7 @@ int autosync_umount = 1;
 const char *program_name = "guestfsd";
 
 /* Name of the virtio-serial channel. */
-#define VIRTIO_SERIAL_CHANNEL "/dev/virtio-ports/org.libguestfs.channel.0"
+#define VIRTIO_SERIAL_CHANNEL "/dev/vport0p1"
 
 static void
 usage (void)
-- 
1.7.0.4



More information about the Libguestfs mailing list