Grub multiboot is unable to load Xen under EFI

Bug #1520979 reported by Dario Bertini
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Release Notes for Ubuntu
Fix Released
xen (Ubuntu)

Bug Description

As a new Xen user, when I install the `xen-hypervisor-amd64` package, I'd expect it to work fine.

But upon rebooting, even if Xen succeed to boot, the system is basically unusable, and there are plenty of Irq errors in dmesg.

It turns out that EFI is not very well supported under Xen:

The alternatives are:

- boot directly from the Efi (instead of relying on grub's multiboot)
- enable legacy boot in the EFI, and reinstall grub in bios-mode (and hope that everything goes well)

Since I don't think that the latter can be automated, the first one would be a better approach for ubuntu's packaging, I think.

But even if that's not possible, or there are no resources for it, at least (until EFI on Grub won't be properly supported), either at install time or at boot time, the fact that the system is running on EFI should be detected, and explicitly warn the user (halt the boot process?) to avoid leaving him in a puzzlingly half-working system.

ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: xen-hypervisor-4.5-amd64 4.5.1-0ubuntu1.1
ProcVersionSignature: Ubuntu 4.2.0-18.22-generic 4.2.3
Uname: Linux 4.2.0-18-generic x86_64
ApportVersion: 2.19.1-0ubuntu5
Architecture: amd64
CurrentDesktop: Unity
Date: Sun Nov 29 19:19:05 2015
InstallationDate: Installed on 2015-11-22 (7 days ago)
InstallationMedia: Ubuntu 15.10 "Wily Werewolf" - Release amd64 (20151021)
SourcePackage: xen
UpgradeStatus: No upgrade log present (probably fresh install)
mtime.conffile..etc.default.grub.d.xen.cfg: 2015-11-24T13:27:42.307217

Revision history for this message
Dario Bertini (berdario) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xen (Ubuntu):
status: New → Confirmed
Revision history for this message
Jeff Lane  (bladernr) wrote :

I have seen this issue as well, after being pointed to problems booting Xen w/ Ubuntu by a colleague.

To recreate this I did the following:

Deployed a server in UEFI mode via MAAS 1.9 using the latest Xenial images from the MAAS daily image stream.
After deployment, SSH'd to the server and installed xen-hypervisor-4.6-amd64 via apt-get.
Rebooted system after installation of Xen.

The system then attempted to EFI PXE (set to do so by default). It successfully PXEd and the MAAS server directed it to boot locally. Then it attempted to boot the Xen Hypervisor and halted at loading the initial ramdisk.

At that point, the system abended and rebooted. It was completely unable to boot Xen.

Changed in xen (Ubuntu):
importance: Undecided → Critical
Revision history for this message
Stefan Bader (smb) wrote :

My few cents here. Its unfortunate but its known and not simple to fix. The current multiboot protocol does not allow UEFI boot as things transition into a mode that shuts down certain services from the UEFI BIOS side. Which I think will cause the hypervisor not finding any memory since this is reported in a different way which is only available if the UEFI boot services were not stopped. Upstream was working on the problem on and off but I don't think there is a final solution yet.
There is a EFI executable added to /boot when installing the hypervisor but that would have to be loaded by the UEFI BIOS directly (not sure how passing command line arguments is supposed to be done exactly). It is not signed either, so secure boot would not work any way.
The best way forward IMO would be to have the needed fixes in multiboot2, so there is a way to boot via grub2 in UEFI mode. Still that has the secure boot topic unresolved.

Preventing installation of Xen when in UEFI mode is probably bad either (plus I am not sure it can be safely done). So maybe the best option is to clearly state in the release notes that Xen does currently not boot in UEFI mode.

Revision history for this message
Dario Bertini (berdario) wrote :

Thank you, anyhow concerning the last point:

> Preventing installation of Xen when in UEFI mode is probably bad either

Yes, but the release notes cannot be seen anywhere at installation time, if I'm not wrong. People would need to explicitly look for it.

Wouldn't it be possible to add a dpkg configure prompt ask for confirmation to the user? (just like for the accept-license prompts)

"We detected that you're running in UEFI mode, XEN is currently unsupported on this configuration. Continue at your own risk [yes] [abort]"

Revision history for this message
Stefan Bader (smb) wrote :

This might be nice to have but I would not see any reason to rush this. Xen is not on the ISO images (and the whole Xen host/hypervisor parts are in universe which usually means a lower priority on being perfect) so this can be fixed later, still.

Also a critical bug imo needs to be one that causes data loss (even high would not be true as that would be service disruptions) and this is an issue which affects new installations only. And it is recoverable at least using the recovery option of the server ISO. Should also be possible by accessing the grub menu and switching to the non-xen boot but I admit I would not be quick enough to hit left-shift during that little time that the hidden grub default allows.

For those reasons I would lower the priority to medium and add a task to add something to the release notes.

Changed in xen (Ubuntu):
importance: Critical → Medium
Stefan Bader (smb)
Changed in ubuntu-release-notes:
assignee: nobody → Stefan Bader (smb)
status: New → Confirmed
Stefan Bader (smb)
Changed in ubuntu-release-notes:
status: Confirmed → Fix Released
assignee: Stefan Bader (smb) → nobody
mstr (9sj)
Changed in ubuntu-release-notes:
assignee: nobody → mstr (9sj)
Revision history for this message
Fake Name (lemuix-2) wrote :

What part of this is "fixed"?

Anyways, xen can apparently support efi-booting as a efi executable directly, but for some reason ubuntu doesn't ship the "xen.efi" (see

While I understand that fixing this is kind of out of the scope of the ubuntu packager people, at least mark it "wontfix" or something.

Revision history for this message
Stefan Bader (smb) wrote :

The release notes task is marked fixed (meaning the issue is mentioned there). Ubuntu does ship the EFI executable (see /boot/xen-<version>-amd64.efi. Of course its not simple to use it.
And lastly the bug is open as a reminder to follow development that tries to extend grub2 multiboot (multiboot2) to allow Xen being booted via grub on EFI systems, too. Which would be the better way to integrate into any distro.

Mathew Hodson (mhodson)
Changed in ubuntu-release-notes:
assignee: mstr (9sj) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers