How to install Arch Linux (on VirtualBox)

This guide shows how to install Arch Linux on virtual box. In our last guide, we showed just how to install arch Linux as a main OS. We will do this as a step-by-step guide. Once more we would like to say that the most detailed guide is always the official. The guide you’re about to read though, is considered as simplified. The Desktop Environment we use is Gnome, but since it’s the last step of this guide, you can choose your own. Last thing before we start. When you see the commands, do start just blindly copy/paste them, but keep an eye in italic letters.


How to install arch Linux on virtual box To follow this guide it is already considered that you’ve installed a virtual box.



How to install arch Linux


Step 1

We download the ArchLinux ISO file from here. It’s the official link. We choose whichever way fits best for us either its torrent, http or ftp.



Step 2

We run VirtualBox and we set up our virtual Image with the following way

a) We choose “new” and we create and new VM in our VirtualBox

How to install arch Linux 1

b) We choose to have enough RAM for our system(example: 2048mb)

How to install arch Linux 2


c) We choose to create a new Disc, VDI as a file type, and we give whatever size we need . In this particulare case we choose 40gb capacity with a dynamic size

How to install arch Linux 3




d) We click “create” and we open VMs settings that we just made. We choose as many cores as we want virtualbox to use(for example, if we have 4 cores, we choose all 4).

How to install arch Linux 4



e) We then go to the display menu and we choose 3D acceleration(we’ll use that later for the gnome)

How to install arch Linux 5



f) We chose our VM and we click on start. It will show a window for use to chose the ISO file we downloaded in the first step. After we choose this, it will show the boot screen of Arch Linux. We choose Boot(x86_64) in that case.

How to install arch Linux 6



The rest of the commands are in the Wiki (link at the beginning of the article) so we’ll stop with screenshots and we’ll continue with commands. We must say that it is really important when it comes to installing in VirtualBox so we’ll not going to use any complicated partitioning or anything else non-useful so we can have a simple and working installation.


Step 3

Partitioning. We only make one partition without swap, in MBR and we set it to boot from that.


# parted /dev/sda

(parted) mklabel msdos

(parted) mkpart primary ext4 1MiB 100%

(parted) set 1 boot on

(parted) quit

# mkfs.ext4 /dev/sda1


Step 4

We rename the list of mirrors that we’re not interested for and then we choose mirron in “your country” for a faster download. You can find the list here – be sure that you choose your country.


# cd /etc/pacman.d

# mv mirrorlist mirrorlist-bk

# nano mirrorlist

We write one of the servers of the list. For example:

Server =$repo/os/$arch

We press CTRL-X and we choose to save the file.



Step 5

We mount the partition and we run the installation. We press enter or yes in every question that has to do with “downloading and install packages”.


# mount /dev/sda1 /mnt

# pacstrap -i /mnt base base-devel



Step 6

After all packages are installed, we create the fstab and then we open the OS to customize it. We choose as system language US with UTF-8.


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

# arch-chroot /mnt /bin/bash

# nano /etc/locale.gen
We search for the line:  #en_US.UTF-8 UTF-8

We remove the comment (#) from the beginning of the line.

Control-X and we Save the file.


# locale-gen

# nano /etc/locale.conf
We add the line: LANG=en_US.UTF-8

Control-X and we Save the file.


Step 7

We set our timezone and the wew install GRUB


# ln -s /usr/share/zoneinfo/HERE INSERT YOUR CONTINTENT/YOUR CITY /etc/localtime

# pacman -S grub os-prober

# grub-install --recheck /dev/sda

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


Step 8

We set VMs hostname


# echo arch-vm > /etc/hostname


Step 9

We activate dhcp client so we can have access to internet when we boot


# ip link

We use te interface that is written in the 2nd result and we activate dhcp client

For example: if the result is 2: enp0s3 we write:

# systemctl enable dhcpcd@ enp0s3.service


Step 10

We set password for the root user and we leave chroot

# passwd

# exit





Step 11

WE choose to remove the ISO from VirtualBox and we restart the system



# reboot


Step 12

As soon as our systems boots, it’s going to ask for username and pass. We give username as root and password, the pass we chose some steps ago.





Step 13

We add our user(example: randomusername) and we make a password. We also give him sudo privileges

# useradd -m -G wheel -s /bin/bash randomusername

# passwd randomusername

# nano /etc/sudoers


We find the line that says:

#Uncomment to allow members of group wheel to execute any command

and we remove comment # from the start of the next line so it writes:

% wheel ALL=(ALL) ALL

Control-X and we choose to Save the file.



Step 14

We change user from root to the user we just made and we prepare to install GUI

# exit



Step 15

We install the graphical environment of our choice. For that tutorial we’ll use GNOME and we will use gd, as a Display Manager. We wait for the packages to be downloaded and installed. We activate the Display Manager for the next boot.


# sudo pacman -S gnome gdm

# sudo systemctl enable gdm


Step 16

An important step is to install the guest additions of VirtualBox and to create a file that declares the modules that will be loaded in boot.


# sudo pacman -S virtualbox-guest-utils

# sudo nano /etc/modules-load.d/virtualbox.conf

We add the following lines:




Control-X and  Save the file

# reboot


Final: We’re ready to start with GUI and 3d acceleration.


You can also check out that video in case you need more help



comments powered by Disqus