There are many Linux distributions out there. Arch Linux is our choice. Start by reading a little bit about it:
Download and install VirtualBox
archlinux-YYYY.MM.DD-dual.iso from Arch Linux Downloads
Create a new VM in VirtualBox
Once the VM boots successfully into the Arch Live CD image, you are ready to install Arch onto your virtual hard disk. Follow the Arch Linux Beginners’ Guide carefully step-by-step. You can start at Section 2, Installation.
The Guide is very detailed and comprehensive, but sometimes it’s a bit confusing. Here are some additional info and directions on some of the trickier sections of the Beginners’ Guide:
2.2 Establish an internet connection
Assuming you have an Internet connection on your host, your guest should have it as well, so you can skip this section.
2.3 Prepare the storage drive
Create a single MBR partition which fills up the entire hard disk. You
can follow the example in the Guide titled, “Using fdisk to create MBR
partitions”, except that you should simply press
Enter at the “Last
sector” prompt in order to create a single big partition instead of two
After creating the partition /dev/sda1, run
mkfs.ext4 /dev/sda1 to
format it in
Note that we do not create a swap partition because a swap file can be added later if necessary.
2.5 Select a mirror
You should put the Columbia University mirror site at the top of the list.
2.8 Chroot and configure the base system
You should carefully follow this section to configure your new system.
/etc/vconsole.conf, which will make the console look much nicer.
2.9 Configure the network
For our setup, we follow “Wired / Dynamic IP” setup, which means that
all you need to do is to run
systemctl enable dhcpcd.service.
2.12 Install and configure a bootloader
Follow the Guide for the “For BIOS motherboards / GRUB” setup.
3.1 User management
Pick a name for a non-root user and add the user. For example:
useradd -m -g users -s /bin/bash archie passwd archie
At this point, you can make the non-root user a “sudoer”. A sudoer can
run a command as root by passing it through the
First, install sudo:
pacman -S sudo
Then, add the following lines to
/etc/sudoers (you can omit the
comments of course, and replace archie with your user name):
# The basic structure of a user spec looks like this: # who where = (as_whom) how: what archie ALL=(ALL) NOPASSWD: ALL
3.2 Package management
Please make sure you go through the pacman documentations linked from this section.
This is also a good time to install some essential packages:
pacman -S net-tools pkgfile base-devel
And perhaps your favorite editors:
pacman -S vim emacs
You can also try running a full system upgrade to see if any of your installed packages have new versions:
At this point, please take a snapshot of your VM from VirtualBox so that you can come back to this point if something goes wrong in the subsequent steps.
3.5.2 Install a video driver
We will be installing VirtualBox Guest Additions later, but for now,
vesa driver by running
pacman -S xf86-video-vesa. This
will let you test X window system when you don’t have VirtualBox Guest
Additions installed yet.
3.5.7 Choose and install a graphical interface
Linux offers a dizzying array of choices when it comes to graphical desktop environments. You can use whatever you like.
Xfce is what I use. Here is how to install it:
pacman -S xfce4 xfce4-goodies
You can also install a GUI version of your editor and a web browser:
pacman -S gvim firefox
Before you start your Xfce4 desktop, log in as the non-root user. You
can switch to the 2nd virtual console by pressing
you log in as a non-root user, you can type the following to start your
Now you should install VirtualBox Guest Additions inside the VM. The Guest Additions will enable very useful features like dynamically resizing the VM window, copy & paste between guest and host, time sync between guest & host, and accessing the host file system from the guest.
sudo pacman -S virtualbox-guest-utils sudo pacman -S virtualbox-guest-modules sudo pacman -S virtualbox-guest-modules-lts sudo pacman -S virtualbox-guest-dkms
/etc/modules-load.d/virtualbox.conf which contains the
following three lines:
vboxguest vboxsf vboxvideo
In order to synchronize time with the host machine, type the following:
sudo systemctl enable vboxservice.service
Enable “Bidirectional” Shared Clipboard from VirtualBox Manager’s Settings / General / Advanced menu.
Reboot the VM and type
ps ax | grep -i vbox. You should see an output
139 ? Ssl 0:00 /usr/bin/VBoxService -f 402 ? Sl 0:00 /usr/bin/VBoxClient --clipboard 414 ? Sl 0:00 /usr/bin/VBoxClient --display 420 ? Sl 0:00 /usr/bin/VBoxClient --seamless 425 ? Sl 0:00 /usr/bin/VBoxClient --draganddrop
Try copy & paste between host and guest.
You can look through Arch’s documentation on VirtualBox for more detailed info.
The stock kernel of Arch Linux stays pretty close to the bleeding edge, so
it gets updated very frequently. Arch offers a more stable alternative
based on a kernel version designated as a Long-Term Support (LTS) version.
linux package in Arch is the stock kernel and the
is the LTS kernel. We are going to use the LTS kernel.
Install the LTS kernel package and update the boot menu to include the new kernel:
sudo pacman -S linux-lts linux-lts-headers sudo grub-mkconfig -o /boot/grub/grub.cfg
Verify that the new kernel works correctly:
uname -rto see the current kernel version you’re running
uname -ragain to see the new LTS kernel version.
Make your VM boot to LTS by default by editing
GRUB_DEFAULT=2 (assuming that the LTS
kernel was the 3rd entry in the boot menu). Update the boot menu and
sudo grub-mkconfig -o /boot/grub/grub.cfg sudo reboot
Better terminal font
Install the Terminus font, which makes a very nice terminal font:
pacman -S terminus-font
You will probably work in your Xfce desktop most of the time, but sometimes you find yourself working in the virtual console–during the frequent kernel-compile and reboot cycles for example. It’s nice to have a console a little bit bigger than 80x25. You can change the framebuffer resolution.
Customize your environment
The following ArchWiki pages have tons of tips on how to customize your working environment. (But be careful. You can spend infinite amount of time tweaking your working environment instead of, um, actually working.)
Congratulations! You have successfully installed and configured an Arch Linux system. Hopefully this is the beginning of a long-term relationship between Linux and you.
Last updated: 2014–01–18