Ubuntu 16.04 in bhyve: hard disk not visible in EFI boot manager

neubert

Dabbler
Joined
Jun 24, 2011
Messages
26
FreeNAS 11.1 U6

Hi,

I have created a bhyve vm with the Ubuntu 16.04.05 server image as CD-ROM and a 128 GiB zvol as hard disk. Installation completes but EFI is not able to boot the system (tried several times, also with Zenyal 5.1). After booting the vm, it drops me to the UEFI shell. Leaving the shell brings up the bhyve menu. In the Boot Maintenance Manager I cannot see the hard disk in the Boot From File menu, only the CD-ROM. So there is no way to boot the fresh Ubuntu. I can boot Ubuntu rescue system from the CD-ROM image, which in turn helps to get access to the partitions on the hard disk and the efi boot partition. They all look fine.

What do I need to do to make bhyve recognize the virtual hard disk and use its EFI partition to boot into Ubuntu via grub (installed in master boot sector)?

Your help would be appreciated. Thank you in advance.

Kind regards,
Boris
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
What happens if you remove CD-ROM device and then boot your VM?
 

neubert

Dabbler
Joined
Jun 24, 2011
Messages
26
bhyve EFI does not run Grub nor Ubuntu with or without CD-ROM. The only difference is that without virtual CD-ROM device, I see no files in the Boot Maintenance Manager / Boot From File menu whereas I see the files on the virtual CD-ROM device if it is present.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776

neubert

Dabbler
Joined
Jun 24, 2011
Messages
26
Thank you, Patrick, for pointing out rEFInd. I used the Ubuntu rescue system to install rEFInd to /boot/efi (/dev/sda1 in the zvol virtual hard disk). rEFInd is now listed as a boot option in the BHYVE menu but does not boot since the virtual hard disk is still not visible from the BHYVE menu.
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
Try the 16.04.4 iso
 

neubert

Dabbler
Joined
Jun 24, 2011
Messages
26
I installed the 16.04.4 iso and the result is the same: drops me to the EFI shell, virtual hard disk is not visible in the Boot Maintenance Manager | Boot From File menu, <ubuntu> is the first boot option in the Change Boot Order menu.
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
I installed the 16.04.4 iso and the result is the same: drops me to the EFI shell, virtual hard disk is not visible in the Boot Maintenance Manager | Boot From File menu, <ubuntu> is the first boot option in the Change Boot Order menu.

Is this after install? If yes, grab a copy of the rEFInd.iso and see if you can boot your VM using that as the CDROM device. Did you choose "yes" for force EFi during the install?
 
Last edited:

neubert

Dabbler
Joined
Jun 24, 2011
Messages
26
Is this after install? If yes, grab a copy of the rEFInd.iso and see if you can boot your VM using that as the CDROM device. Did you choose "yes" for force EFi during the install?

Thank you, KrisBee!

I chose "yes" and forced EFI during the Ubuntu install.

I can boot the rEFInd ISO. It does not show any system in the top line (left of the blue right arrow). I started the disk partitioning tool in rEFInd which says:

Code:
Starting gdisk_x64.efi
Using load options ''
Error: Unsupported while loading gdisk_x64.efi

* Hit any key to continue *


I therefore suppose that something is wrong with the configuration of the virtual disk of the vm. It has the following parameters:

Code:
VM: epiphyt
Type: Disk
ZVol: /mnt/volume0/vm-epiphyt-sda (128.0 GiB)
Mode: AHCI
Disk sectorsize: 4.096


I chose the sector size to correspond to the zvol's actual sector size (turned from 16K to 4K). The zvol is sparse, lz4-compressed, without dedup.

Anything wrong with this?

Best regards,
Boris
 

Nvious1

Explorer
Joined
Jul 12, 2018
Messages
67

neubert

Dabbler
Joined
Jun 24, 2011
Messages
26
I just ran into this problem. Were you able to just switch the disk type over to VirtIO and then it work or did you have to blow away the VM and do a fresh install with that disk type?

I simply can't remember. I started so many times over... It should be possible to switch disk type, then boot Ubuntu into recovery mode from installation cd-rom (iso) and reinstall the efi parts and boot loader from the command line.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Hey guys,

just wanted to inform everyone who has not yet switched to the latest Ubuntu LTS that 18.04 LTS installs and boots just fine with bhyve and FreeNAS 11.2. VirtIO disk and network - no special procedures necessary.

Kind regards,
Patrick.
 

sda-79

Cadet
Joined
Apr 1, 2019
Messages
1
Hello to all!
This decision helped me.
system FreeNAS-11.2 VM Ubuntu server 16.04
  1. "Power on" the virtual machine.
  2. Wait "Boot failed efi misc device" Shell>exit EFI text-mode menu appear, with menu items called
    Continue, Select Language, Boot Manager, Device Manager, and Boot Maintenance Manager.
  3. Select "Boot Maintenance Manager." A new menu should appear.
  4. Select "Boot From File."
  5. A "file explorer" menu appears, which shows your virtual disks, identified by long strings of hexadecimal numbers and other stuff that looks like gibberish to most people.
  6. Using the file explorer, you should be able to drill down to locate the EFI/ubuntu/grubx64.efi file on the virtual disk. Select it.
  7. The virtual machine should reboot into GRUB.
  8. sudo -i
  9. mkdir /boot/efi/EFI/BOOT
  10. cp /boot/efi/EFI/ubuntu/grubx64.efi /boot/efi/EFI/BOOT/bootx64.efi
  11. Enjoy!
 
Last edited:
Top