[ubuntu-cloud] Running the UEC images in VirtualBox - /dev/disk/by-label/uec-rootfs does not exist.

Scott Moser smoser at ubuntu.com
Mon Oct 11 16:58:09 BST 2010

On Sun, 10 Oct 2010, Laurence Rowe wrote:

> I'm trying to run the 32bit 10.10 UEC release in VirtualBox 3.2.8. To
> do this, I first convert the image to VDI using:
>   $ VBoxManage convertfromraw -format VDI maverick-server-uec-i386.img
> maverick-server-uec-i386.vdi
> In order for VirtualBox to use the floppy boot image, it must be
> renamed to end .iso and set as the CD (not floppy) boot image:
>   $ cp maverick-server-uec-i386-floppy maverick-server-uec-i386-floppy.iso
> Additionally you must "Enable PAE/NX" under Settings -> System -> Processor.
> On booting I am presented with the grub boot screen and choose
> "uec-image with ubuntu:ubuntu" and after a while I see the messages:
>   "Gave up waiting for root device."
>   "ALERT! /dev/disk/by-label/uec-rootfs does not exist. Dropping to a shell!"
> From the shell I can see:
>   (initramfs) find /dev/disk
>   /dev/disk
>   /dev/disk/by-path
>   /dev/disk/by-path/pci-0000:00:01.1-scsi-1:0:0:0
> And ls -l shows that to be a symlink to ../../sr0, which is the cd
> drive with the floppy boot iso image (/dev/sc0 -> sr0).
> Grub doesn't seem to have a problem finding the disk:
>   grub> search --label uec-rootfs
>    hd0

Right.  Grub sees the disk, and actually loads the kernel and ramdisk off
of it.  The boot disk that you have is has only grub on it, it loads
kernel and ramdisk from the disk image.

> So it seems to be a limitation of the floppy boot image is missing a
> driver or something. The only issue I could find that looked vaguely
> related was https://bugs.launchpad.net/ubuntu/+source/udev/+bug/635096

The failure is due to a bug I just opened
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/658461 .
I subscribed you to the bug, and nominated it for Maverick SRU.

Short answer, is the -virtual kernel is missing a module that is necessary
to see the disk that virtualbox is providing.

The following shell will allow you to work around.  What it basically does
is grab the current 'linux-image' that satisfies "linux-server", extracts
it, copies the missing dependency to -virtual, and recreates the
initramfs in the image.

- arch=amd64; bn=maverick-server-uec-${arch}
- tar -Sxvzf ubuntu-10.10-server-uec-${arch}.tar.gz
- cp ${bn}-floppy ${bn}-floppy.iso
- mkdir ./mnt
- sudo bash -c '
  set -xe
  img=$1; d=$2; MNT=""
  [ -d "$d" ] || exit 1
  cleanup() {
    f=$d/etc/resolv.conf; [ -e "$f.dist" ] && mv $f.dist $f
    rm -Rf "${d}.x"
    [ -z "$MNT" ] || umount "${MNT}"
  trap cleanup EXIT
  mount -o loop "$img" "$d"
  mv "${d}/etc/resolv.conf" "${d}/etc/resolv.conf.dist"

  chroot "${d}" env LANG=C sh -c \
     "apt-get update && apt-get install --download-only linux-server --yes"
  mkdir -p "${d%/}.x"
  [ -f "${d}/var/cache/apt/archives/"linux-image-2*generic-pae*.deb ] &&
  dpkg -x "${d}/var/cache/apt/archives/"linux-image-2*${sver}*.deb "${d}.x"
  cp "${d}.x/lib/modules/"*-${sver}/kernel/drivers/ata/libahci.ko \
  chroot "${d}" env LANG=C update-initramfs -k all -u
  rm -f "${d}/var/cache/apt/archives/"linux*
  ' arg0 "${bn}.img" ./mnt
- rm -f "${bn}.vdi"
- VBoxManage convertfromraw -format VDI "${bn}.img" "${bn}.vdi"

More information about the Ubuntu-cloud mailing list