Installing Arch Linux in VirtualBox

Jarret B

Well-Known Member
Staff member
Joined
May 22, 2017
Messages
454
Reaction score
519
Credits
19,511
I've covered installing Arch Linux on a system, but installing it on VirtualBox is a bit more tricky.

Technically, there is only one very important aspect of installing on it on VirtualBox that is different.

I have tested this quite a bit for installations and cloning a machine also works well.

Download

To start, you need the ISO file for the installation. The website is at ‘https://archlinux.org/download/’. Towards the bottom of the page is a listing that is sorted by country. Find your country, then choose a site to download from for Arch. Once selected, you are given a choice of files to download from the server you chose. For instance, the file you want to download is an ISO file similar to ‘archlinux-<date>-x86_64.iso’. An example is 'archlinux-2025.06.01-x86_64.iso', which is the June 2025 64-bit version. Of course, in the future, the version will change, but you should always need the newest version. Download the file, placing the file where you can access it from VirtualBox.

VirtualBox Setup

After opening VirtualBox, I'm using version 7.1.4 r165100 (Qt6.5.3), you need to click on 'New'.

A window appears to let you set up the basic information of the new machine you are creating.

The following are the options for this tab:
  • Name - the name you want for the machine, such 'Arch Linux'
  • Folder - the folder where the program stores the Virtual Machine, which should have a location by default
  • ISO Image - ISO image that you previously downloaded for Arch
  • Edition - grayed out (inmost cases)
  • Type - Linux
  • Subtype - ArchLinux
  • Version - Arch Linux (64-bit)
The next tab to set up is 'Hardware':
  • Base Memory - at least 2048 MB
  • Processors - at least one, but preferably more if possible
  • EFI - checkbox to use as UEFI if checked (your preference)
The last tab is 'Hard Disk':
  • Create a Virtual Hard Disk Now - set the location with a size of at least 25 GB. You can choose which type you prefer (VDI, VHD, VDMK, etc)
Click on 'Finish' to create the machine. There are only a few more adjustments you need to make. Select the new machine and click on 'Settings'.

Under 'Display', change the Video Memory to '128 MB' and check the option for 'Enable Video Acceleration'.

Select the 'Network' option and change 'NAT' to 'Bridged'.

Click 'OK' to save the changes to the Machine.

Now, just click on 'Start'.

Arch Install

When the Virtual Machine starts, you’ll see a screen similar to Figure 1, after it boots into the ISO.

Figure 1.JPG

FIGURE 1

Select the top option to start the install.

The machine should boot a basic Arch system to allow you to perform an install. If you follow the previous instructions in 'Getting Started with Arch Linux: A Beginner's Installation Guide', the install will unfortunately not work in VirtualBox. I'll get into this and explain why, when we get to the spot.

Your system should stop at a Command-Line Interface (CLI) and you should be ‘root’ since the prompt is ‘root@archiso’.

The first thing to do is to update the repository package list:

Code:
pacman -Sy

After you update the package list, we need to check for an updated version of the 'archinstall' package.

Code:
sudo pacman -S archinstall

Type 'y' and enter to update the file, if it finds an update, when prompted.

Now, we are ready to start the installation:

Code:
archinstall

Once the installation starts, you’ll see an output similar to Figure 1.

Figure 2.JPG

FIGURE 2

You can move up and down, select an option with ‘enter’ and go back to the main menu, once inside a sub-menu, by selecting ‘Back’.

The options are:
  • Archinstall Language – set to your preferred language
  • Locales – Lets you configure the keyboard layout, locale language and encoding
  • Mirrors and Repositories – Specify your country for the closest mirror sites for downloading
  • Disk Configuration – Configure partitioning of drives and format
  • Swap – Enable/Disable Swap
  • Bootloader – Set the bootloader. The default is GRUB
  • Hostname – specifies the Hostname of the system
  • Root Password – sets the password for the ‘root’ user
  • User Account – Lets you setup user accounts to use other than ‘root’
  • Profile – Allows you to specify the type of system, such as Desktop, Server, etc. as well as Desktop Environment and the Greeter
  • Audio – Specifies the audio server
  • Kernel – Lets you set the type of kernel to use. The default is ‘linux’
  • Network Configuration – You can manually set the configuration of the network interface (DHCP) or install a network manager
  • Additional Packages – specify other packages to install, such as Firefox, gparted etc. Separate each package with a space
  • Timezone – Default is UTC, or you can specify the timezone to use
  • Automatic Time Sync (NTP) – Sets up NTP protocol to sync system time to an NTP Server
NOTE: Most of the defaults are fine, unless you need to change Locales, are 'Mirrors and repositories', 'Disk Configuration', 'Root Password', 'User Account', 'Profile', 'Network configuration' and 'Timezone'.

The big difference for a virtual setup is the Repositories which are found under 'Mirrors and repositories'. The option is 'Optional Repositories'. There are two choices:
  1. xinitmultilab - 32-bit repository for libraries used on 64-bit systems
  2. testing - staging area for packages that are being tested before placed into stable use
Either or both repositories will work. It lists the drivers under 'Profiles'. Here, you choose the 'Type' and then a Display Manager. After this, there is a menu including 'Type', 'Graphic Driver' and 'Greeter'.

Choose 'Graphic Driver' and the default is 'All open-source'. The other options, and the drivers, are:
  • AMD/ATI (Open-source)
    • libva-mesa-driver
    • mesa
    • vulkan-radeon
    • xf86-video-amdgpu
    • xf86-video-ati
    • xorg-server
    • xorg-xinit
  • Intel (Open-source)
    • intel-media-driver
    • libva-intel-driver
    • mesa
    • vulkan-intel
    • xorg-server
    • xorg-xinit
  • Nvidia (Open kernel module for newer GPUs, Turing+)
    • dkms
    • libva-nvidia-driver
    • nvidia-open-dkms
    • xorg-server
    • xorg-xinit
  • Nvidia (Open-source nouveau driver)
    • libva-mesa-driver
    • mesa
    • vulkan-nouveau
    • xf86-video-nouveau
    • xorg-server
    • xorg-xinit
  • Nvidia (Proprietary)
    • dkms
    • libva-nvidia-driver
    • nvidia-dkms
    • xorg=server
    • xorg-xinit
  • VirtualBox (Open-source)
    • mesa
    • xf86-video-vmware
    • xorg-server
    • xorg-xinit
If you do not add one of the extra repositories, then some of the driver fail on VirtualBox.

Once you set the options, you can save the settings to a place on the hard disk you specify. After everything is as you wish, select ‘Install’. It should show you the configuration script, so press ‘Enter’ to start the installation.

At the end of the installation, the script asks you if you want to 'Exit archinstall', 'Reboot system' or 'chroot' into the OS, as shown in Figure 3.

Figure 3.JPG

FIGURE 3

Select 'Exit archinstall' and at a terminal prompt, you can issue the command to shut down the system:

Code:
shutdown now

After the Virtual Machine shuts down, you can remove the optical media (the ISO file) from the Settings. Start the machine and you should be in Arch Linux.

Conclusion

Hopefully, this will make it easier to test Arch Linux by only needing VirtualBox.

Give Arch Linux a try, it is very customizable and you can create different Virtual Machines to test each Display Manager or Greeter.
 
Last edited by a moderator:


Follow Linux.org

Members online


Top