Arch Linux is a distribution of Linux favored by enthusiasts and users who want the most fine-grained control over every aspect of their system. Arch lets the user control almost everything, so it's also a great way to learn about Linux and the operation of computers in general. This website will guide you through installing Arch on a virtual machine. A virtual machine (VM) runs like a program on your computer—you'll still have access to all your other programs and data (in particular, this website!), but you will be able to run Arch Linux in a window as if it were it's own computer within your current operating system.
You'll find this guide easiest to follow if you have some previous experience with using a terminal on a Linux or OSX system. If you don't have that experience, some parts of the guide may be confusing, but you'll still get through with patience and perseverance.
Before you start following this guide, you'll need to download and install VirtualBox. VirtualBox is the software that will handle running the VM for you. It's available to run on Windows, OS X, and Linux. Download and install VirtualBox like you would for any other program on your computer.
Throughout this guide, there are offset blocks indicating commands to type or lines to enter in files.
Note the # character at the beginning of the line. That's to show the start of the line, and it will match what you see on your terminal while installing Arch. You should not type this character when entering the commands.
Many of the commands are exactly the same for every installation. Some commands will include a piece of information particular to you or your installation, like a username you choose. When this information is included in a command, it will be italicized to tell you to replace it with the correct value for you.
Given the above command, I would run replace anne.
Finally, some commands or tools require the enter key to be pressed at various points. When this is the case, presses of the enter key are indicated inside the output with the ↵ symbol.
In this section, we will go over setting up a new VirtualBox VM for installing and using Arch Linux.
Several partitions will be necessary on the VM's file system, to prepare for Arch installation. The boot partition will contain files necessary for the computer's startup process, allowing the computer to transfer control over to your operating system. The swap partition provides extra memory for the operating system, in the case that their is insufficient random access memory available. Finally, the root partition will contain your operating system and all of your files.
We will create these partitions using the command line tool gdisk.
/dev/sda is Linux's name for your hard drive. This command should open the following prompt for gdisk
Create the boot partition:
These commands create a new partition, starting at the beginning of the disk, of size 512 megabytes, of a EFI System filesystem (hex code EF00 in gdisk).
Now create the swap partition:
These commands create a new partition, starting immediately after the boot partition, of size 2 gigabytes, of a Linux swap filesystem (hex code 8200 in gdisk).
Finally, create the root partition:
These commands create a new partition, starting immediately after the swap partition, filling the rest of the disk, of a Linux filesystem (hex code 8300 in gdisk).
We now have to write these changes to the disk. gdisk has merely been drafting the changes, and has not actually written anything to the disk yet. To do so, enter the w command.
The last step is to properly format the boot partition for use as an EFI System Partition (ESP).
We now need to mount these three partitions to the correct directories.
Create the requisite directory for the boot partition, then mount it.
The swap partition will automatically be detected when creating the fstab
The pacstrap script will automatically install the base package group.
In this section, we will make some basic configurations to our Arch installation and make our system defaults more consistent with our daily usage.
fstab will determine how your disk partitions from the previous step are mounted outside this installation process. Each time your computer starts, it needs to know how to properly mount the partitions so that you can access your files without hassle.
chroot changes your apparent root directory. This readies your environment for the following instructions.
Next, you need to enter information about your timezone so that your system knows how to determine your local time. This command will display available timezones on your system:
Setting locale information makes your system follow your preferred language formats (temperature, currency, grammar conventions, etc.). Fire up the nano editor (preinstalled in every system) and edit /etc/locale.gen with the command:
A hostname is a unique identifier for your system.
You will need to configure a hostname in order for other
computers on your network to recognize and remember you.
You have full freedom to determine what your hostname should be.
We recommend picking something creative and easy to remember.
To do this, you will need to first create the file /etc/hostname with the touch command:
Since your Arch installation is running in a virtual machine, your networking is already properly configured. However, you will still need to set up the DHCP service, so that network discovery is enabled every time you boot up Arch. To do this, run the following command:
Your new system has a user called root that has full privileges to everything on your system. Hence, it is important to set up a password for root so that other remote users cannot maliciously obtain root access and modify your computer. To do this, run
Since root has full access to everything on your system,
it is not a good idea to log in as root for daily tasks, as you may
damage your system by accident due to typos and other mistakes.
Hence, it is a good idea to create a more restricted account for yourself.
To do this:
First pick a username you like.
Then, add the username to the system with:
Before we leave the installation environment, we need to add files so our computer can boot to the operating system. To do this, we will use the grub bootloader with the ESP we created earlier.
First, install the grub and efibootmgr packages, then run the grub-install.
Finally, create the config file for the bootloader.
At this point you can reboot and continue the process from the operation system itself.
On reboot, log in as root, with the root password that was set previously.
The X11 window manager allows creation of basic graphical windows by programs. It is a prerequisite for any graphical desktop environment in most Linux distros.
Install the xorg-server package as well as some utilities from the xorg-server-utils package.
Gnome provides a full desktop environment so you can quickly get started using Arch Linux easily.
Install the gnome and gnome-extra packages to enable the full Gnome experience.
To customize Gnome, you need to install Gnome Tweak Tool.
By now, your new Arch system should set up with all the basic features you need. For further reading, questions, and troubleshooting issues, these resources will likely come in handy:
Guide by Dhruv Khurana, Anne Kohlbrenner, Clifford Ressel, and Haoxuan Yue. Formatting and design completed with Bootstrap 3.0.