Question

i'am new to xen (i used to work with kvm and and full virtualization vm's)

I have a fresh install: squeeze amd64 and xen 4. Newly created domU's and imported squeeze domU's are working fine.

Now I want import an old lenny 32bit domU:

vm.cfg was:

kernel  = "/boot/vmlinuz-2.6.26-2-xen-686"
ramdisk = "/boot/initrd.img-2.6.26-2-xen-686"
disk = [ 'phy:vxen/vm,sda1,w' ]
root = "/dev/sda1 ro"

I commented kernel and ramdisk lines and added pygrub:

bootloader = '/usr/lib/xen-default/bin/pygrub'
#kernel  = "/boot/vmlinuz-2.6.26-2-xen-686"
#ramdisk = "/boot/initrd.img-2.6.26-2-xen-686"

The vm won't boot and i got this message after the grub screen:

Error: (2, 'Invalid kernel', 'elf_xen_note_check: ERROR: Will only load images built for the generic loader or Linux images')

Inside this vm (I can start it on the old server) Grub is installed

vm:~# dpkg --list | grep grub
ii  grub                              0.97-47lenny2              GRand Unified Bootloader (Legacy version)
ii  grub-common                       1.96+20080724-16           GRand Unified Bootloader, version 2 (common files)

In /boot i have those files: initrd.img-2.6.26-2-xen-686 initrd.img-2.6.26-2-686 vmlinuz-2.6.26-2-686 vmlinuz-2.6.26-2-xen-686

cat /boot/grub/menu.lst

## ## End Default Options ##

title           Debian GNU/Linux, kernel 2.6.26-2-686
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-2-686 root=/dev/sda1 ro quiet
initrd          /boot/initrd.img-2.6.26-2-686

title           Debian GNU/Linux, kernel 2.6.26-2-686 (single-user mode)
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-2-686 root=/dev/sda1 ro single
initrd          /boot/initrd.img-2.6.26-2-686

### END DEBIAN AUTOMAGIC KERNELS LIST

cat /boot/grub/device.map

(hd0)   /dev/sda
(hd1)   /dev/sdb

I wanted to install grub2 and update, to be able to start in my new dom0, but update-grub fail

Searching for GRUB installation directory ... found: /boot/grub
warning: grub-probe can't find drive for /dev/sda1.
grub-probe: error: Cannot find a GRUB drive for /dev/sda1.  Check your device.map.

I tried those steps since i use lvm:

nano /boot/grub/device.map
(hd0)   /dev/xvda
cd /dev
mknod xvda b 202 0
dpkg --configure -a
update-grub

Upgrade-grub still fail.

Anyway, anyone knows a solution to run this old vm on my new squeeze dom0?

Was it helpful?

Solution

I figured out: Inside the virtual machine modify fstab

replace /dev/sda1 with /dev/xvda1

copy the kernel files on the new xen serveur

/boot/vmlinuz-2.6.26-2-xen-686

/boot/initrd.img-2.6.26-2-xen-686

Modify the new vm.cfg:

   #bootloader = '/usr/lib/xen-default/bin/pygrub'
    kernel  = "/boot/vmlinuz-2.6.26-2-xen-686"
    ramdisk = "/boot/initrd.img-2.6.26-2-xen-686"

    root        = '/dev/xvda1 ro'
    disk        = [
              'phy:vxen/vm,xvda1,w',
          ]

and the new vm will start.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top