Install Arch Linux in Virtualbox with UEFI Firmware

Hello and welcome. Arch Linux is one of my favourite Linux distros. It’s a rolling release which means there’s no new version to upgrade to. The installation process if kind of difficult for new Linux users. But once you successfully installed Arch Linux on your computer, it’s actually easy to use. In this tutorial, I’m going to simulate a UEFI boot in virtualbox and install Arch Linux in it.

Enable UEFI in Virtualbox

First, create a virtualbox machine using virtualbox. To enable UEFI, go to the settings window of your virtual machine. Select System on the left pane, then check Enable EFI and hit the OK button.
Install Arch Linux in Virtualbox with UEFI Firmware

Install Arch Linux with UEFI hardware in Virtualbox

Add Arch Linux ISO image in the storage settings before starting virtual machine, or you will be dropped into UEFI shell.

Install Arch Linux in Virtualbox with UEFI Firmware

Now start your virtual machine from Arch Linux ISO image. Choose the first option so we can install Arch Linux in UEFI mode.

Install Arch Linux in Virtualbox with UEFI Firmware

You will be automatically logged in as the root user.

Check if you can access Internet in this virtual machine.

ping -c6

If you install Arch Linux on a real hardware, you can use this command to connect to Wi-Fi networks.


Set US keyboard as the keyboard layout:

loadkeys us

Now let’s configure the partition. I’m using only one virtual hard drive, so the name of virtual hard drive is /dev/sda. Since we install Arch Linux on UEFI hardware, it’s better to partition the disk in GPT and also an EFI system partition is required.

Make a GPT style disk with parted partition editor.

parted /dev/sda mklabel gpt

You can confirm it’s a GPT disk using this command:

parted /dev/sda -l

Install Arch Linux in Virtualbox with UEFI Firmware

Let parted use /dev/sda.

parted /dev/sda

Then make a EFI system partition with 512MB space. Partition type is set to primary.

mkpart primary fat32 2048s 1050624s

Be aware that my virtual hard disk’s sector size is 512B both logically and physically. You may need to adjust the above command.

Check EFI system partition.

unit MiB


Install Arch Linux in Virtualbox with UEFI Firmware

To make it a EFI system partition, we need to set boot flag on this partition.

set 1 boot on

Now make a root partition.

mkpart primary ext4 1050625s 100%

100% means to use all of the available hardware space because I’m not making a swap partition. Now, exit out of parted partition editor.


Format /dev/sda1 as fat16 partition and /dev/sda2 as ext4 partition

mkfs -t fat /dev/sda1
mkfs -t ext4 /dev/sda2

Mount the root partition under /mnt.

mount /dev/sda2 /mnt

Make a boot directory on /dev/sda2 partition.

mkdir /mnt/boot

Mount /dev/sda1 under /mnt/boot/

mount /dev/sda1 /mnt/boot/

Select a mirror that is close to your location.

nano /etc/pacman.d/mirrorlist

To set your preferred mirror, copy that mirror address to the top of the mirror list. I live in China so I selected a mirror in China as my preferred mirrot.

Install Arch Linux in Virtualbox with UEFI Firmware

Save and close this file. Now install Arch Linux base system.

pacstrap -i /mnt base

Next, generate a /etc/fstab file.

genfstab -U -p /mnt >> /mnt/etc/fstab

Change root

arch-chroot /mnt

Generate locales.

nano /etc/locale.gen

Find locales that you need and uncomment them. For example, I uncommmented en_US.UTF-8 UTF-8 and zh_CN.UTF-8 UTF-8. Save the file.

Generate /etc/locale.conf file and make en_US.UTF-8 as the default locale.

echo LANG=en_US.UTF-8 > /etc/locale.conf

export LANG=en_US.UTF-8

Set your time zone. I set Shanghai as my time zone.

ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

Enable eth0 network interface.

systemctl enable [email protected]

Install wireless-tools:

 pacman -S wireless_tools wpa_supplicant wpa_actiond dialog

To connect to wireless networks, use this command:


Enable wireless network interface.

systemctl enable net-auto-wireless.service

Install network manager and related tools.

pacman -S networkmanager networkmanager-vpnc network-manager-applet networkmanager-pptp networkmanager-openconnect

Enable network manager.

systemctl enable NetworkManager

Configure pacman package manager.

nano /etc/pacman.conf

Find repositories section, [core], [extra], [community] repository is enabled by default. If your Arch Linux is 64 bit and you want to be able to install and run 32 bit software, you must enable [multilib] repository. To enable [multilib] repository, copy and paste the following two lines at the end of this file.

       Include = /etc/pacman.d/mirrorlist

Save and close this file. Now update repositories.

pacman -Sy

Set a password for the root user.

passwd root

Create a standard user account. Replace <username> with your preferred username.

useradd -m -g users -G wheel,storage,power -s /bin/bash <username>

Set a password for this user.

passwd <username>

Install sudo utility

pacman -S sudo

Allow member of wheel group to use sudo.

EDITOR=nano visudo

Find this line.

# %wheel ALL=(ALL) ALL

Remove the # sign and save this file.

Install grub and efi boot manager

pacman -S grub efibootmgr

Install Grub boot loader to /dev/sda.

grub-install /dev/sda --target=x86_64-efi --efi-directory=/boot

Generate Grub configuration file.

grub-mkconfig -o /boot/grub/grub.cfg

Exit out of chroot environment.


Reboot virtual machine. You will be greeted by Grub2 boot menu.

Install Arch Linux in Virtualbox with UEFI Firmware

Login with the standard user. To change hostname:

sudo hostnamectl set-hostname <your-hostname>

Install alsa-utils.

sudo pacman -S alsa-utils

Start alsamixer sound configuration tool.


MM stands for mute. Press M key to unmute and use up and down arrow key to adjust sound volume. You must unmute Master and PCM.

Press ESC to exit out of sound configuration. Now enter this command to test sound.

speaker-test -c2

If you hear something, that means the sound system is working. Press Ctrl+C to stop sound test.

Install X window system.

sudo pacman -S xorg-server xorg-xinit xorg-server-utils

Install mesa to enable 3D support.

sudo pacman -S mesa

Check what graphics card your system has.

lspci -k | grep -A 2 -i "VGA"

If you have an integrated Intel graphics card, install intel open source graphics card driver.

sudo pacman -S xf86-video-intel

If you have Nvidia graphics card, install Nvidia closed-source graphics driver.

sudo pacman -S nvidia lib32-nvidia-utils

For ATI card:

sudo pacman -S xf86-video-ati

The vesa display driver works with most video cards.

sudo pacman -S xf86-video-vesa

I’m using the Virtualbox graphics adapter and I have to install this package.

sudo pacman -S virtualbox-guest-utils

Notebook users can install trackpad driver.

sudo pacman -S xf86-input-synaptic

Install xorg test widget.

sudo pacman -S xorg-twm xorg-xclock xterm

Use this command to test  xorg.


If you can see the following 3 programs running, that means is working.

Install Arch Linux in Virtualbox with UEFI Firmware

Install font.

sudo pacman -S ttf-dejavu ttf-ubuntu-font-family

Install xfce4 desktop environment

sudo pacman -S xfce4 xfce4-goodies gamin firefox

Before we start our xfce4 desktop encironment we need to copy xinitrc file to our home directory an edit it.

cp /etc/X11/xinit/xinitrc ~/.xinitrc

nano ~/.xinitrc

Comment out the last 5 lines and add this line at the end of this file.

exec startxfce4

Install Arch Linux in Virtualbox with UEFI Firmware

Save and close the file. Now start X window system.


You should be able to enter into XFCE4 desktop.

Install Arch Linux in Virtualbox with UEFI Firmware

Install Slim Login Manager

Instead of typing startx command every time, we can install a login manager such as Slim to enable us to automatically boot into graphical user interface. To install Slim login manager, execute this command:

sudo pacman -S slim slim-themes

Then enable Slim to auto-start when computer is power on.

sudo systemctl enable slim.service

Edit /etc/slim.conf to select a theme for our login manager.

sudo nano /etc/slim.conf

Find this line:

current_theme     default

change it to this:

current_theme       archlinux-simplyblack

Save and close the file. Reboot your Arch Linux computer, you will be greeted by the Slim login manager.

Install Arch Linux in Virtualbox with UEFI Firmware

Enable NTP time synchronization.

timedatectl set-ntp true

Some common packages that you may like after you install Arch Linux:

sudo pacman -S flashplugin vlc terminator htop parted gparted transmission-cli transmission-gtk wine wine-mono wine_gecko winetricks banshee

Drop into the EFI Shell

If your Arch Linux machine drop into an EFI shell, First enter the following command to add the Grub boot loader.

bcfg boot add 1 fs0:/EFI/arch/grubx64.efi "Manually Added"



Select Continue in the next screen and you will see the Grub boot menu.

To prevent dropping into EFI shell in the future, once you boot into Arch Linux, run the following command to make Arch Linux Grub as the default boot loader.

sudo mkdir /boot/EFI/BOOT

sudo cp /boot/EFI/arch/grubx64.efi /boot/EFI/BOOT/BOOTX86.EFI

So that EFI can find the default boot loader.

You can also create a startup.nsh script on the root of EFI system partition.

sudo nano /boot/startup.nsh

And put the following text into the shell script.

bcfg boot add 1 fs0:/EFI/arch/grubx64.efi "Manually Added"

So even if you drop into the EFI shell, you don’t need to manually execute these two command.

It’s not easy for Linux beginners to install Arch Linux, but once you practice a little and make some notes, you will find it’s actually fun.

Rate this tutorial
[Total: 21 Average: 4.3]

3 Responses to “Install Arch Linux in Virtualbox with UEFI Firmware

  • Erik van de Ven
    1 month ago

    One thing, you don’t necessarily have to install slim login manager, just to prevent you from typing startx everytime. You can just automatically execute startx, after login, check this out: But I do think it’s nicer to have a graphical login screen, instead of the terminal.

  • fortnite mac hack
    1 month ago

    Hello, i really think i will be back to your website

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • * Some of my previous answers are lost after I uninstalled Disqus comment system from my website. I try to recover those answers whenever I can.