EFI boot grub2 VirtualBox

Asked by Johnny

Hi,

I'm testing Cubic custom ISO in Virtualbox 6.1 with EFI enabled. (ubuntu focal 20.04 amd64)

When i'm booting with the official ISO i can select the boot device in the EFI boot manager and i'm redirected to the grub menu of live installation official ISO.

When i'm booting with my custom Cubic ISO, i'm redirected to the grub mini bash-like interface.

How can i conserve the structure of grubx64.efi as the official ubuntu ISO ?

Best regards

Question information

Language:
English Edit question
Status:
Solved
For:
Cubic Edit question
Assignee:
No assignee Edit question
Solved by:
Johnny
Solved:
Last query:
Last reply:
Revision history for this message
Cubic PPA (cubic-wizard) said :
#1

When I boot a customized ISO in VirtualBox 6.1, with "Enable EFI (special OSes only)" selected, I get the Grub menu...

    GNU GRUB versmn 2.04

    * Ubuntu (safe graphics)
    OEM install (for manufacturers)
    Boot from next volume
    UEFI Firmware Settings

Did you make any changes on the ISO Boot tab on the Options page in Cubic?
If so, what were they?

Revision history for this message
Johnny (johnnybee) said :
#2

Hi,

    GNU GRUB versmn 2.04

    * Ubuntu (safe graphics)
    OEM install (for manufacturers)
    Boot from next volume
    UEFI Firmware Settings

Yes this is the official Grub Menu when i'm booting without custom install.

When I boot in non uefi mode with my custom install, my preseed auto installation starts, but in uefi mode, my installation switches to the grub menu command line. I removed some ISO BOOT entries

Here my changes for ISO BOOT :

isolinux/txt.cfg :

default auto-install
label auto-install
  menu label ^Auto Install Ubuntu From Preseed
  kernel /casper/vmlinuz
  append file=/cdrom/preseed/preseed_auto.seed auto=true priority=critical debian-installer/locale=us_US keyboard-configuration/layoutcode=us ubiquity/reboot=true languagechooser/language-name=English countrychooser/shortlist=US localechooser/supported-locales=en_US.UTF-8 boot=casper automatic-ubiquity initrd=/casper/initrd splash ---

boot/grub/grub.cfg :
if loadfont /boot/grub/font.pf2 ; then
        set gfxmode=auto
        insmod efi_gop
        insmod efi_uga
        insmod gfxterm
        terminal_output gfxterm
fi

set menu_color_normal=white/black
set menu_color_highlight=black/light-gray

set timeout=2
menuentry "Auto Install Ubuntu From Preseed" {
        set gfxpayload=keep
        linux /casper/vmlinuz boot=casper file=/cdrom/preseed/preseed_auto.seed splash ---
        initrd /casper/initrd
grub_platform
if [ "$grub_platform" = "efi" ]; then
menuentry 'Boot from next volume' {
        exit
}
menuentry 'UEFI Firmware Settings' {
        fwsetup
}
fi

If I do not delete the existing entries in grub.cfg et txt.cfg (Ubuntu, Ubuntu safegraphics etc..) , the automatic installation switches to live cd mode. In non uefi mode the automatic installation is running correctly.

Revision history for this message
Johnny (johnnybee) said :
#3

I think I created bugs in my manual modifications.

So I kept the original files grub.cfg, txt.cfg and added my custom configuration.

I can boot in legacy VirtualBox or EFI mode without any problem.

With the UEFI VirtualBox mode you automatically enter the UEFI Interractive Shell v2.2 which lists the mapping table.

At the prompt I exit with an exit :
Shell> exit
I enter the Boot Manager menu
I select UEFI VBOX CD-ROM VB0-xxxxx

Grub is loaded with the whole menu edited in the custom configurations. The installation proceeds correctly

Translated with www.DeepL.com/Translator (free version)

Revision history for this message
Johnny (johnnybee) said :
#4

With the EFI Interactve shell in Virtualbox i did this :

Shell> fs0: (where fs0 is mapping to the custom iso cdrom)
FS0:\> cd efi\boot\
FS0:\>grubx64.efi

Then Grub appears with my custom menu

Revision history for this message
Johnny (johnnybee) said :
#5

I think we can pass the issue as resolved.

Thank you for help