Ubuntu 22.04 guest. UEFI or BIOS?

Discussions about using Linux guests in VirtualBox.
Post Reply
Shamino
Posts: 3
Joined: 4. Oct 2019, 21:04

Ubuntu 22.04 guest. UEFI or BIOS?

Post by Shamino »

VIrtualBox 6.1.36. Windows 10 host.

I'm running some tests with Ubuntu 22.04 (more specifically, the Xubuntu variant). I can install it with either EFI or BIOS (aka EFI disabled). The OS seems to install and boot fine either way. The installer always creates a GPT partition table and therefore always insists on creating a "Reserved BIOS Boot Area" (aka "bios_grub" partition) and an "EFI System partition", whether the VM is using EFI or BIOS. Even when the VM is using BIOS, the installer seems to install Grub in an EFI-compatible way, because I can actually switch the VM to EFI and it still boots (which I did not expect to work).

The only difference I found so far is the procedure for trying to boot into an optical disk image after the OS has been installed.
  • Without EFI, I just add the disk image to the virtual optical drive. Since that drive appears before the HDD in the boot order (System / Motherboard setting), it boots the optical disk when media is present.
  • With EFI, the boot order seems to be ignored. It always boots into the Linux installation on the HDD unless I press ESC very early in the boot sequence (almost instantly after the VM starts), which brings me to a text-menu (EFI shell?) shell where I can select the optical drive in order to boot from it.
My question is: Is there any practical difference between using BIOS and EFI for a VM like this (Ubuntu 22.04)? If I'm not developing or installing EFI-specific software, does it matter? Which is recommended at this time?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Ubuntu 22.04 guest. UEFI or BIOS?

Post by scottgus1 »

Your points on how to get CD boot in EFI vs Legacy BIOS are accurate. The boot order settings in the VM settings in the main Virtualbox window are only for Legacy BIOS. EFI ignores these settings.

The manual section pi (3.14) :D says this about EFI:
One notable user of EFI is Apple Mac OS X. More recent Linux versions and Windows releases,
starting with Vista, also offer special versions that can be booted using EFI.
Another possible use of EFI in Oracle VM VirtualBox is development and testing of EFI applications, without booting any OS.
Note that the Oracle VM VirtualBox EFI support is experimental and will be enhanced as
EFI matures and becomes more widespread. Mac OS X, Linux, and newer Windows guests are
known to work fine. Windows 7 guests are unable to boot with the Oracle VM VirtualBox EFI
implementation.
As my guess has it, EFI was added to support Mac OS on supported Apple hosts, Other OS types may be able to use it too. It would depend on whether the OS installed in the VM needs EFI on whether to use it. Windows 11 in its non-hacked form is supposed to require EFI.
Post Reply