Introduction
This article aims to help users who are experiencing issues with booting an EFI (Unified Extensible Firmware Interface) system in VirtualBox on MacOS. In this tutorial, we will cover the necessary steps to ensure proper installation and configuration of VirtualBox to run a Linux distribution, such as Ubuntu Desktop, from an EFI system partition.
Prerequisites
Before we begin, make sure you have:
- VirtualBox installed on your MacOS system.
- A compatible Linux distribution, such as Ubuntu Desktop, with an EFI system partition.
Installation
Follow the steps below to install and configure VirtualBox to boot from an EFI system partition:
Step 1: Create a new Virtual Machine
Launch VirtualBox and click on the "New" button to create a new virtual machine. Choose the type and version of your Linux distribution, and select "EFI" as the boot order.
VirtualBox > File > New > Virtual Machine
VirtualBox New Virtual Machine Wizard
Type: Linux
Version: Ubuntu_64
Memory size: 2048 MB
Hard Disk: Create a new virtual hard disk now
Virtual Hard Disk Creator
Type: VDI (VirtualBox Disk Image)
Size: 20 GB
Allocate all space now
File Location: Select your desired location
Name: Ubuntu
Step 2: Install the Guest Additions
Install the VirtualBox Guest Additions in your Linux distribution to improve performance and provide better integration between the host and guest systems.
Ubuntu > sudo apt update
Ubuntu > sudo apt install virtualbox-guest-utils
Step 3: Create an EFI system partition
If you haven't already, create an EFI system partition in your Linux distribution. This partition is required for booting the virtual machine from an EFI system.
Ubuntu > sudo fdisk -l
Ubuntu > sudo umount /boot/efi
Ubuntu > sudo mkfs.vfat /dev/sda1
Ubuntu > sudo mount /dev/sda1 /boot/efi
Step 4: Install the GRUB bootloader
Install the GRUB bootloader on the EFI system partition to enable booting from the virtual machine.
Ubuntu > sudo grub-install --force --target=x86_64-efi --boot-directory=/boot/efi
Step 5: Configure the VirtualBox settings
Configure the VirtualBox settings to boot from the EFI system partition.
VirtualBox > Select your virtual machine > Settings > System > Motherboard > Boot Order: First Hard Disk
VirtualBox > Select your virtual machine > Settings > Storage > Controller: SATA > Add Hard Disk > Choose the virtual hard disk created earlier > Attach as: SATA
VirtualBox > Select your virtual machine > Settings > Display > Graphics Controller: VMSVGA
VirtualBox > Select your virtual machine > Settings > Network > Adapter 1: Attached to: NAT
Conclusion
By following the steps outlined in this article, you should now be able to boot an EFI system in VirtualBox on MacOS. If you encounter any issues, please refer to the resources below for further assistance.