Discussion:
how to multiboot xen with grub2 on Ubuntu
Abhishek Dixit
2011-03-08 09:39:22 UTC
Permalink
I installed Ubuntu 10.04 using Wubi installer inside a folder in
Windows7 in its C drive.

Following is one grub entry which perfectly works without any problem

menuentry "Ubuntu, Linux 2.6.32.27" {
insmod ntfs
set root='(hd0,2)'
search --no-floppy --fs-uuid --set 96f65c80f65c6313
loopback loop0 /ubuntu/disks/root.disk
set root=(loop0)
linux /boot/vmlinuz-2.6.32.27 root=/dev/sda2
loop=/ubuntu/disks/root.disk ro quiet splash
initrd /boot/initrd.img-2.6.32.27
}

To be able to use Xen I need to edit grub2 entries as per this page
http://bderzhavets.wordpress.com/2010/04/24/set-up-ubuntu-10-04-server-pv-domu-at-xen-4-0-dom0-pvops-2-6-32-10-kernel-dom0-on-top-of-ubuntu-10-04-server/
scroll down to grub section

So the entries which I have tried and failed to use Xen along with
grub2 are following

Entry 1 which failed is

menuentry "Xen Linux 2.6.32.27" {
insmod ntfs
set root='(hd0,2)'
loopback loop0 /ubuntu/disks/root.disk
set root=(loop0)
kernel (hd0,2)/boot/xen.gz
module (hd0,2)/boot/vmlinuz-2.6.32.27 dummy=dummy
root=/dev/sda2 loop=/ubuntu/disks/root.disk ro console=tty0
module (hd0,2)/boot/initrd.img-2.6.32.27
}


Entry 2 which failed is

menuentry "Xen Linux 2.6.32.27" {
insmod multiboot2
set root='(hd0,2)'
set root=(loop0)
kernel (hd0,2)/boot/xen.gz dummy=dummy
module (hd0,2)/boot/vmlinuz-2.6.32.27 dummy=dummy
root=/dev/sda2 loop=/ubuntu/disks/root.disk ro console=tty0
module (hd0,2)/boot/initrd.img-2.6.32.27
}


I also tried insmod multiboot each time I got

error file not found
error unknown command 'kernel'
error unknown command 'module'
error unknown command 'module'

Any thing else which I can try?This seems to be a grub problem only.
--
Regards
Abhi
Jordan Uggla
2011-03-08 21:17:04 UTC
Permalink
Post by Abhishek Dixit
menuentry "Xen Linux 2.6.32.27" {
      insmod ntfs
      set root='(hd0,2)'
      loopback loop0 /ubuntu/disks/root.disk
      set root=(loop0)
      kernel (hd0,2)/boot/xen.gz
      module (hd0,2)/boot/vmlinuz-2.6.32.27 dummy=dummy
root=/dev/sda2 loop=/ubuntu/disks/root.disk ro console=tty0
      module (hd0,2)/boot/initrd.img-2.6.32.27
}
Entry 2 which failed is
menuentry "Xen Linux 2.6.32.27" {
       insmod multiboot2
       set root='(hd0,2)'
       set root=(loop0)
       kernel (hd0,2)/boot/xen.gz dummy=dummy
       module (hd0,2)/boot/vmlinuz-2.6.32.27 dummy=dummy
root=/dev/sda2 loop=/ubuntu/disks/root.disk ro console=tty0
       module (hd0,2)/boot/initrd.img-2.6.32.27
}
Compare these with the entry given in the instructions that you linked to:

menuentry "Xen 4 / Ubuntu 10.04 kernel 2.6.32.12" {
insmod ext2
set root='(hd1,5)'
multiboot (hd1,5)/boot/xen.gz dummy=dummy dom0_mem=1024M
module (hd1,5)/boot/vmlinuz-2.6.32.12 dummy=dummy nopat
root=/dev/sdb5 ro console=tty0
module (hd1,5)/boot/initrd.img-2.6.32.12
}

Notice there is no "kernel" command in grub2, you need to use "multiboot".

Also, since I assume your /boot/ is within your wubi root.disk rather
than in "(hd1,5)" you should remove (hd1,5) from your file paths to
end up with an entry like:

menuentry "Xen Linux 2.6.32.27" {
      insmod ntfs
      set root='(hd0,2)'
      loopback loop0 /ubuntu/disks/root.disk
      set root=(loop0)
      multiboot /boot/xen.gz
      module /boot/vmlinuz-2.6.32.27 dummy=dummy root=/dev/sda2
loop=/ubuntu/disks/root.disk ro console=tty0
      module /boot/initrd.img-2.6.32.27
}
--
Jordan Uggla (Jordan_U on irc.freenode.net)
Abhishek Dixit
2011-03-08 21:23:16 UTC
Permalink
Post by Jordan Uggla
Post by Abhishek Dixit
menuentry "Xen Linux 2.6.32.27" {
      insmod ntfs
      set root='(hd0,2)'
      loopback loop0 /ubuntu/disks/root.disk
      set root=(loop0)
      kernel (hd0,2)/boot/xen.gz
      module (hd0,2)/boot/vmlinuz-2.6.32.27 dummy=dummy
root=/dev/sda2 loop=/ubuntu/disks/root.disk ro console=tty0
      module (hd0,2)/boot/initrd.img-2.6.32.27
}
Entry 2 which failed is
menuentry "Xen Linux 2.6.32.27" {
       insmod multiboot2
       set root='(hd0,2)'
       set root=(loop0)
       kernel (hd0,2)/boot/xen.gz dummy=dummy
       module (hd0,2)/boot/vmlinuz-2.6.32.27 dummy=dummy
root=/dev/sda2 loop=/ubuntu/disks/root.disk ro console=tty0
       module (hd0,2)/boot/initrd.img-2.6.32.27
}
menuentry "Xen 4 / Ubuntu 10.04 kernel 2.6.32.12" {
 insmod ext2
 set root='(hd1,5)'
 multiboot (hd1,5)/boot/xen.gz dummy=dummy dom0_mem=1024M
 module (hd1,5)/boot/vmlinuz-2.6.32.12 dummy=dummy nopat
root=/dev/sdb5 ro console=tty0
 module (hd1,5)/boot/initrd.img-2.6.32.12
}
Notice there is no "kernel" command in grub2, you need to use "multiboot".
Ok
Post by Jordan Uggla
Also, since I assume your /boot/ is within your wubi root.disk rather
than in "(hd1,5)" you should remove (hd1,5) from your file paths to
menuentry "Xen Linux 2.6.32.27" {
       insmod ntfs
       set root='(hd0,2)'
       loopback loop0 /ubuntu/disks/root.disk
       set root=(loop0)
       multiboot /boot/xen.gz
       module    /boot/vmlinuz-2.6.32.27 dummy=dummy root=/dev/sda2
loop=/ubuntu/disks/root.disk ro console=tty0
       module    /boot/initrd.img-2.6.32.27
}
--
I tried exactly the above entries which you mentioned on grub prompt

grub>        insmod ntfs
grub>        set root='(hd0,2)'
grub>        loopback loop0 /ubuntu/disks/root.disk
grub>        set root=(loop0)
Upto here things worked perfectly
but the moment I did
grub>        multiboot /boot/xen.gz

I got error
error: file not found.
Here what am I missing?
--
Regards
Abhi
Abhishek Dixit
2011-03-08 21:24:53 UTC
Permalink
Post by Abhishek Dixit
Post by Jordan Uggla
Post by Abhishek Dixit
menuentry "Xen Linux 2.6.32.27" {
      insmod ntfs
      set root='(hd0,2)'
      loopback loop0 /ubuntu/disks/root.disk
      set root=(loop0)
      kernel (hd0,2)/boot/xen.gz
      module (hd0,2)/boot/vmlinuz-2.6.32.27 dummy=dummy
root=/dev/sda2 loop=/ubuntu/disks/root.disk ro console=tty0
      module (hd0,2)/boot/initrd.img-2.6.32.27
}
Entry 2 which failed is
menuentry "Xen Linux 2.6.32.27" {
       insmod multiboot2
       set root='(hd0,2)'
       set root=(loop0)
       kernel (hd0,2)/boot/xen.gz dummy=dummy
       module (hd0,2)/boot/vmlinuz-2.6.32.27 dummy=dummy
root=/dev/sda2 loop=/ubuntu/disks/root.disk ro console=tty0
       module (hd0,2)/boot/initrd.img-2.6.32.27
}
menuentry "Xen 4 / Ubuntu 10.04 kernel 2.6.32.12" {
 insmod ext2
 set root='(hd1,5)'
 multiboot (hd1,5)/boot/xen.gz dummy=dummy dom0_mem=1024M
 module (hd1,5)/boot/vmlinuz-2.6.32.12 dummy=dummy nopat
root=/dev/sdb5 ro console=tty0
 module (hd1,5)/boot/initrd.img-2.6.32.12
}
Notice there is no "kernel" command in grub2, you need to use "multiboot".
Ok
Post by Jordan Uggla
Also, since I assume your /boot/ is within your wubi root.disk rather
than in "(hd1,5)" you should remove (hd1,5) from your file paths to
menuentry "Xen Linux 2.6.32.27" {
       insmod ntfs
       set root='(hd0,2)'
       loopback loop0 /ubuntu/disks/root.disk
       set root=(loop0)
       multiboot /boot/xen.gz
       module    /boot/vmlinuz-2.6.32.27 dummy=dummy root=/dev/sda2
loop=/ubuntu/disks/root.disk ro console=tty0
       module    /boot/initrd.img-2.6.32.27
}
--
I tried exactly the above entries which you mentioned on grub prompt
grub>        insmod ntfs
grub>        set root='(hd0,2)'
grub>        loopback loop0 /ubuntu/disks/root.disk
grub>        set root=(loop0)
Upto here things worked perfectly
but the moment I did
grub>        multiboot /boot/xen.gz
I got error
error: file not found.
Here what am I missing?
Sorry I mistyped the error
the error was
error: unknown command 'multiboot'

and when I do
grub> insmod multiboot
error:file not found.
--
Regards
Abhi
Abhishek Dixit
2011-03-09 04:59:46 UTC
Permalink
Post by Abhishek Dixit
Post by Abhishek Dixit
Post by Jordan Uggla
Post by Abhishek Dixit
menuentry "Xen Linux 2.6.32.27" {
      insmod ntfs
      set root='(hd0,2)'
      loopback loop0 /ubuntu/disks/root.disk
      set root=(loop0)
      kernel (hd0,2)/boot/xen.gz
      module (hd0,2)/boot/vmlinuz-2.6.32.27 dummy=dummy
root=/dev/sda2 loop=/ubuntu/disks/root.disk ro console=tty0
      module (hd0,2)/boot/initrd.img-2.6.32.27
}
Entry 2 which failed is
menuentry "Xen Linux 2.6.32.27" {
       insmod multiboot2
       set root='(hd0,2)'
       set root=(loop0)
       kernel (hd0,2)/boot/xen.gz dummy=dummy
       module (hd0,2)/boot/vmlinuz-2.6.32.27 dummy=dummy
root=/dev/sda2 loop=/ubuntu/disks/root.disk ro console=tty0
       module (hd0,2)/boot/initrd.img-2.6.32.27
}
menuentry "Xen 4 / Ubuntu 10.04 kernel 2.6.32.12" {
 insmod ext2
 set root='(hd1,5)'
 multiboot (hd1,5)/boot/xen.gz dummy=dummy dom0_mem=1024M
 module (hd1,5)/boot/vmlinuz-2.6.32.12 dummy=dummy nopat
root=/dev/sdb5 ro console=tty0
 module (hd1,5)/boot/initrd.img-2.6.32.12
}
Notice there is no "kernel" command in grub2, you need to use "multiboot".
Ok
Post by Jordan Uggla
Also, since I assume your /boot/ is within your wubi root.disk rather
than in "(hd1,5)" you should remove (hd1,5) from your file paths to
menuentry "Xen Linux 2.6.32.27" {
       insmod ntfs
       set root='(hd0,2)'
       loopback loop0 /ubuntu/disks/root.disk
       set root=(loop0)
       multiboot /boot/xen.gz
       module    /boot/vmlinuz-2.6.32.27 dummy=dummy root=/dev/sda2
loop=/ubuntu/disks/root.disk ro console=tty0
       module    /boot/initrd.img-2.6.32.27
}
--
I tried exactly the above entries which you mentioned on grub prompt
grub>        insmod ntfs
grub>        set root='(hd0,2)'
grub>        loopback loop0 /ubuntu/disks/root.disk
grub>        set root=(loop0)
Upto here things worked perfectly
but the moment I did
grub>        multiboot /boot/xen.gz
I got error
error: file not found.
Here what am I missing?
Sorry I mistyped the error
the error was
error: unknown command 'multiboot'
and when I do
grub> insmod multiboot
error:file not found.
It looks like this grub setup has just enough modules to use loopback
file on ntfs, but the ACTUAL /boot directory is on the loopback NOT
ntfs (hd0,2). Therefore any attempt to read any files from (hd0,2)
simply wont work, cause there's no file there.How can I trouble shoot
this
troubleshoot ntfs-loop-xen combination.

Loading...