Bug 213541

Summary: xen unable to load
Product: Base System Reporter: terence26
Component: miscAssignee: freebsd-xen (Nobody) <xen>
Status: Open ---    
Severity: Affects Some People CC: linimon, meyer.sydney, royger
Priority: ---    
Version: 11.0-STABLE   
Hardware: amd64   
OS: Any   

Description terence26 2016-10-16 17:14:11 UTC
adding "xen_kernel="/boot/xen" results in error "can't load module /boot/xen" during boot (and booting stops)
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2016-10-17 06:18:51 UTC
Also can you please tell us what version this applies to?  I have had to make a guess to appease the PR system.
Comment 2 terence26 2016-10-17 06:27:08 UTC
Yes of course

10.3 and 11.0

Test system

Dell E6430 with Core i7-3740QM, 16GB RAM, 1 x 256GB SSD Samsung EVO, 1 x USB 32GB Sandisk Extreme
Comment 3 Roger Pau Monné freebsd_committer 2016-10-24 16:53:50 UTC
10.3 doesn't support Xen Dom0, you will have to use 11.0 at least (or HEAD).

Can you post the output of `ls -lah /boot/xen` and `pkg info xen-kernel`?

Thanks, Roger.
Comment 4 terence26 2016-10-26 08:28:54 UTC
root@adi-vw1:~ # ls -lah /boot/xen
-r-xr-xr-x  1 root  wheel   1.8M Oct 16 21:26 /boot/xen

root@adi-vw1:~ # pkg info xen-kernel
Name           : xen-kernel
Version        : 4.7.0_3
Installed on   : Sun Oct 16 11:39:45 2016 CEST
Origin         : emulators/xen-kernel
Architecture   : freebsd:11:x86:64
Prefix         : /usr/local
Categories     : emulators
Licenses       : GPLv2
Maintainer     : royger@FreeBSD.org
WWW            : http://www.xenproject.org/
Comment        : Hypervisor using a microkernel design
Annotations    :
        cpe            : cpe:2.3:a:xen:xen:4.7.0:::::freebsd11:x64:3
Flat size      : 1.84MiB
Description    :
The Xen Project hypervisor is an open-source type-1 or baremetal hypervisor,
which makes it possible to run many instances of an operating system or indeed
different operating systems in parallel on a single machine (or host). The Xen
Project hypervisor is the only type-1 hypervisor that is available as open
source. It is used as the basis for a number of different commercial and open
source applications, such as: server virtualization, Infrastructure as a Service
(IaaS), desktop virtualization, security applications, embedded and hardware

WWW: http://www.xenproject.org/
Comment 5 Roger Pau Monné freebsd_committer 2016-10-26 08:43:51 UTC
Are you also setting the xen_cmdline bootloader option?

See https://wiki.xen.org/wiki/FreeBSD_Dom0 for more information about what to set there.
Comment 6 terence26 2016-10-26 08:52:19 UTC
Yes I have; and I have tried it on 3 different computers
Comment 7 Roger Pau Monné freebsd_committer 2016-10-26 09:03:21 UTC
Can you paste the full contents of your /boot/loader.conf?

Thanks, Roger.
Comment 8 terence26 2016-10-26 09:07:24 UTC
root@adi-vw1:/boot # cat loader.conf
xen_cmdline="dom0_mem=4096M dom0_max_vcpus=2 dom0pvh=1 com1=115200,8n1 guest_log
lvl=all loglvl=all console=com1,vga"
root@adi-vw1:/boot #
Comment 9 Roger Pau Monné freebsd_committer 2016-10-26 09:39:38 UTC
Are you using UEFI? Booting a FreeBSD/Xen Dom0 from UEFI is not yet supported.
Comment 10 terence26 2016-10-26 10:00:55 UTC
I am not sure, how do I verify that?
Comment 11 Roger Pau Monné freebsd_committer 2016-10-26 10:07:55 UTC
Just boot FreeBSD and execute the following:

# sysctl -a | grep bootmethod
machdep.bootmethod: BIOS

It should say BIOS, or else you won't be able to boot Xen.

Comment 12 Sydney Meyer 2016-10-26 11:21:34 UTC
Isn't loading vmm.ko perhaps panicking the system?
Comment 13 Roger Pau Monné freebsd_committer 2016-10-26 11:23:24 UTC
No, this is way earlier, at the bootloader phase. The panic would happen later on, when the kernel has actually booted.
Comment 14 Roger Pau Monné freebsd_committer 2016-10-26 14:40:43 UTC
Can we get some confirmation of whether the error was caused by trying to boot from UEFI?
Comment 15 terence26 2016-10-26 15:42:03 UTC
it is UEFI
Comment 16 Roger Pau Monné freebsd_committer 2016-10-26 15:51:44 UTC
Ack. There is probably a switch on your BIOS that will allow you to switch between UEFI boot and legacy BIOS boot. However that's vendor specific, so I cannot provide any details how to do this, you will have to go to your BIOS setup and search there.
Comment 17 terence26 2016-11-05 08:40:16 UTC
I have not answered in a while as I have been testing.

I have done as suggested, which is install (many times) as MBR, but a new issue occurs which still leads to xen not working - boot folder is missing

apparently from what I can understand, the bootloader pool is not created and not mounted

What next?
Comment 18 Roger Pau Monné freebsd_committer 2016-11-07 09:36:27 UTC

You will have to provide a little bit more info, are you able to boot fine without Xen? Do you think you can setup a serial console and provide the full output of the non-booting case?

Thanks, Roger.