0

I have set up xen on ubuntu server 12.04 LTS. I have tried installing a guest to an lvm I created called xen-lvm

The virt-install script:

sudo virt-install \
--name client2-ubuntu-server \
--ram 512 \
--location http://www.mirrorservice.org/sites/archive.ubuntu.com/ubuntu/dists/precise/main/installer-i386/ \
--accelerate \
--disk path=/dev/dev-server/xen-lvm \
--boot kernel=/boot/vmlinuz-3.2.0-35-virtual,initrd=/boot/initrd.img-3.2.0-35-virtual \
--force

I had first tried installing without the --boot option which had the exact same error when I try to start the vm (xm create client1-ubuntu-server):

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

Does anybody know what I need to do? Running 32 bit and hardware virtualization is out of the question (has to be paravirtualized).

Perhaps I am not supposed to install the master grub boot loader in the guest but alter the one for my host OS?


Update

I have managed to use xm create instead of virt-install in order to get to the point where I startup with a bootloader before the error as seen here: enter image description here I think the issue is because I don't have an pygrub option to select a 'virtual' kernel instead. I have failed to discover how to add the virtual kernel to the domU (preferably at the install stage). I would have thought that the xen netboot image would have installed with this but I guess not.

My xm create script is as such:

name = 'client1-ubuntu-32'
memory = 512
disk = ['phy:/dev/ubu-32/xen-lvm,xvda,w']
vif = [' ']

# Comment this out if uncommenting the next section (installing)
#bootloader="/usr/bin/pygrub"

# This section is for installing ubuntu
kernel = "/var/lib/xen/images/ubuntu-netboot/vmlinuz"
ramdisk = "/var/lib/xen/images/ubuntu-netboot/initrd.gz"
extra = "debian-installer/exit/always_halt=true -- console=hvc0"
1
  • # uname -r 2.6.18-308.24.1.el5xen # - make sure your kernel has XEN in it
    – alexus
    Jan 16, 2013 at 17:37

2 Answers 2

1

It turns out you can install grub to the PV guest with the use of pygrub.

The trick in the end was to use the 'manual package selection' at the apt/task menu in order to remove the generic kernels and install the virtual one instead. (You have to use shift-+ to add a package and shift-minus to remove them when highlighted). I have only tested this with using the xm create command with pygrub as one of the parameters. As the virtual kernel was selected by default I'm guessing this fix may also work with using virt-install (but not tested)

You also have to ensure that you change the default partitioning from using ext4 to using ext3 for this to work. I don't know if it's a pygrub specific issue or not.

This manual package selection is pain. Worth looking into a way to use the minimal virtual install mentioned here:

0

I don't know libvirt. However:

I have set up xen

has to be paravirtualized

but

--accelerate \

man virt-install

-p, --paravirt This guest should be a paravirtualized guest. If the host supports both para & full virtualization, and neither this parameter nor the "--hvm" are specified, this will be assumed. --accelerate Prefer KVM or KQEMU (in that order) if installing a QEMU guest. This behavior is now the default, and this option is deprecated. To install a plain QEMU guest, use '--virt-type qemu'

So it's look like you're passing the wrong option. Seems to generate a Xen config file though.

Also,

  • what is the content of the domU configuration file that has been generated ?
  • Has /boot/vmlinuz-3.2.0-35-virtual been compiled with paravirt support ?

Perhaps I am not supposed to install the master grub boot loader in the guest but alter the one for my host OS?

You can't use grub with a PV guest. You either use pygrub or pvgrub to store the kernel in-tree (in the VM). However your command line suggest that you are running an out-of-tree kernel (stored in the dom0 filesystem) so you don't need any bootloader.

Your domU is i386. Has the kernel PAE enabled ? non-PAE 32bits support has been dropped in Xen quite a long time ago.

3
  • Well I tried the following steps from your answer: 1. didnt set up grub bootloader on vm 2. put in --paravirt 3. removed the --accelerate I still recieved the same issue. Then I thought about the need to ensure that it is using the correct initrd.gz and vmlinuz, so I downloaded the archive.ubuntu.com/ubuntu/dists/precise/main/installer-i386/… mirror with wget, before removing all the ones that werent netboot-xen (e.g. netboot, cdrom, hdmedia). I then ran it and I get this error: ERROR Couldn't find xen kernel for Ubuntu tree. Jan 16, 2013 at 23:08
  • I tried again with the initrd and vmlinuz listed on this serverfault post: serverfault.com/questions/404201/… and using 'sudo xm create /etc/xen/ubuntu.cfg -c' still error: ERROR: Will only load images built for the generic loader or Linux images Jan 17, 2013 at 1:07
  • With using xm create I successfully installed to the point where I get a grub menu. The bad news is that the menu does not seem to show the same as menu.lst in /boot even though I have put in the cfg to use bootloader="pygrub". I made sure not to enter anything for grub bootloader when installing the domU. Here is pic of current incorrect menu img1.uploadscreenshot.com/images/orig/1/152034119-orig.png Jan 17, 2013 at 1:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .