Starting with release 3.1, VirtualBox includes experimental support for the Extensible Firmware Interface (EFI), which is a new industry standard intended to eventually replace the legacy BIOS as the primary interface for bootstrapping computers and certain system services later.
By default, VirtualBox uses the BIOS firmware for virtual machines.
To use EFI for a given virtual machine, you can enable EFI in the
machine's "Settings" dialog (see Section 3.4.1, “"Motherboard" tab”).
Alternatively, use the VBoxManage
command
line interface like this:
VBoxManage modifyvm "VM name" --firmware efi
To switch back to using the BIOS, use:
VBoxManage modifyvm "VM name" --firmware bios
One notable user of EFI is Apple's Mac OS X, but recent Linuxes (such as Fedora 11) and Windows (starting with Vista) offer special versions that can be booted using EFI as well.
Another possible use of EFI in VirtualBox is development and testing of EFI applications, without booting any OS.
Note that the VirtualBox EFI support is experimental and will be enhanced as EFI matures and becomes more widespread. While Mac OS X and Linux guests are known to work fine, Windows guests are currently unable to boot with the VirtualBox EFI implementation.
EFI provides two distinct video interfaces: GOP (Graphics Output Protocol) and UGA (Universal Graphics Adapter). Mac OS X uses GOP, while Linux tends to use UGA. VirtualBox provides a configuration option to control the framebuffer size for both interfaces.
To control GOP, use the following
VBoxManage
command:
VBoxManage setextradata "VM name" VBoxInternal2/EfiGopMode N
Where N can be one of 0,1,2,3,4,5 referring to the 640x480, 800x600, 1024x768, 1280x1024, 1440x900, 1920x1200 screen resolution respectively.
To change the UGA resolution:
VBoxManage setextradata "VM name" VBoxInternal2/UgaHorizontalResolution 1440 VBoxManage setextradata "VM name" VBoxInternal2/UgaVerticalResolution 900
The video mode for both GOP and UGA can only be changed when the VM is powered off and remains persistent until changed.
It is currently not possible to manipulate EFI variables from within a running guest
(e.g., setting the "boot-args" variable by running the nvram
tool in a Mac OS X guest will not work).
As an alternative way, "VBoxInternal2/EfiBootArgs" extradata can be passed to a VM in order to set
the "boot-args" variable. To change the "boot-args" EFI variable:
VBoxManage setextradata "VM name" VBoxInternal2/EfiBootArgs <value>