Monday, August 19, 2013

ubuntu 10.04 to 12.04 kvm guest can't boot after upgrade

After upgrading a virtual machine from Ubuntu 10.04 to 12.04, the upgraded guest couldn't boot.  I had left the 2.6.38.x kernel on, and it seemed to allow the machine to boot just fine.

The 3.2.0.x kernel would just boot to busybox, whether I chose regular mode or recovery mode.  The kernel messages didn't seem to show any errors during bootup, but it just jumped to busybox after loading the network driver (in busybox, run dmesg, then continue to use SHIFT&PAGEUP to scroll backwards to see the kernel messages).

I tried googling for a bit without much success, but I decided to try installing the linux-image-generic kernel instead of using the linux-image-virtual image that was already installed.

The virtual machine managed to bootup just fine after this change.  I tried googling some more for answers, for the differences between linux-image-generic and linux-image-virtual, and only came up with the answer that they are pretty much the same, minus extra drivers and such.  I'm not sure which driver was missing, but it won't kill me to run the linux-image-generic image I guess.

If anyone knows a way to track down what driver might be missing in the linux-image-virtual images, I don't mind troubleshooting it a little more to try and help ubuntu developers maybe add the missing driver to the virtual images.  I'll provide the qemu virtual machine definition below in hopes it may help suggest what might be missing from the linux-image-virtual images.

WORKS:
ii  linux-image-2.6.38-16-virtual          2.6.38-16.67~lucid1                        Linux kernel image for version 2.6.38 on x86/x86_64
ii  linux-image-3.2.0-51-generic           3.2.0-51.77                                Linux kernel image for version 3.2.0 on 32 bit x86 SMP

DOESN'T WORK:
ii  linux-image-3.2.0-51-virtual           3.2.0-51.77                                Linux kernel image for version 3.2.0 on 32 bit x86 Virtual Guests


<domain type='kvm'>
  <name>server2</name>
  <uuid>195bcf90-2aa5-5e9f-db88-eeeeeeeeeeee</uuid>
  <memory>1310720</memory>
  <currentMemory>1310720</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-0.12'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/bigvg/server2_root'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/bigvg/server2_swap'/>
      <target dev='vdb' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/bigvg/server2_space'/>
      <target dev='vdc' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/storage/iso/ubuntu-10.04.2-server-i386.iso'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <shareable/>
      <address type='drive' controller='0' bus='1' unit='0'/>
    </disk>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:d5:ee:ee'/>
      <source bridge='br0'/>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' keymap='en-us'/>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </memballoon>
  </devices>
</domain>
Posts I used to learn how to insert code snippets in my blogger posts:
http://www.craftyfella.com/2010/01/syntax-highlighting-with-blogger-engine.html

http://www.opinionatedgeek.com/dotnet/tools/htmlencode/Encode.aspx

http://www.restlessprogrammer.com/2013/02/adding-code-snippets-to-your-blog.html