How to install VirtualBox on Arch
Installing Oracle VirtualBox on Arch is easy, but you need to know a couple of things before.
Installation
- First, install
virtualbox
withpacman
(you will need superuser privileges).pacman -S virtualbox
- It will ask you which VirtualBox kernel modules you want to install: if your device has the default kernel (
linux
), selectvirtualbox-host-modules-arch
. For any other kernel (linux-lts
,linux-zen
,linux-hardened
, etc.), selectvirtualbox-host-dkms
.
- It will ask you which VirtualBox kernel modules you want to install: if your device has the default kernel (
- Restart your computer.
VirtualBox Guest Additions
- Install
virtualbox-guest-iso
on your Arch machine. - In your running VirtualBox VM window, press on
Devices -> Optical Drives -> Choose a disk file
. Go to/usr/lib/virtualbox/additions/
and selectVBoxGuestAdditions.iso
. - Inside the VM, open your mounted CD-ROM device, open a terminal in that folder (if it is a Linux VM) and type (as root):
bash ./VBoxLinuxAdditions.run
.
Troubleshooting
Not loaded modules
If, when you go to start a new VM, VirtualBox shows an error about a not loaded module, check if you are using the latest kernel (check if there are updates for the linux
package in pacman
and update if needed).
VirtualBox downloads required kernel modules in a folder whose name is the latest kernel version (e.g.: /lib/modules/5.15.5-arch1-1/
) and the kernel only looks for modules inside a folder with its current version (e.g.: /lib/modules/5.15.2-arch1-1/
). Therefore, if you are not using the latest kernel, your current kernel will not load the modules.
More
Check Arch Wiki for more info about the installation and VirtualBox usage.
If you have any suggestion, feel free to contact me via social media or email.
Latest tutorials and articles:
Featured content: