Install Arch Linux on VirtualBox


Ah, the ultimate OS for Level 110 Necromancers, or so they say. They say it’s best prodded from afar before taking the plunge. They say a lot of things.

It could be my past six years of LAMP development experience in a corporate environment, but I don’t think Arch lives up to its hyped difficulty.

I initially took the plunge and installed Arch right on my hard drive next to Windows, using their beginner’s guide. Most of the installation time is spent learning its glorious innards.

However, I recently had to install Arch Linux on VirtualBox to help reproduce and debug an issue I reported for the Lollypop music player. I have compiled the meat of its actual installation process just to prove it’s not the monster people think it is:

Pregaming

  1. Download and install VirtualBox, and get the Arch ISO
  2. Create a new VDI in VirtualBox, boot it, select the Arch .iso as the startup disk

Within five seconds, a root shell is born. Beware: When you gaze long into the root shell, the root shell also gazes also into you!

Installation

Initial Preparation (5 min)

  1. Verify Internet Connection: $ ping google.com
  2. Update System Clock: $ timedatectl set-ntp true
  3. Identify the “hard drive”: $ lsblk
  4. Open “hard drive” in Parted: $ parted /dev/sda
  5. Assign a Label: $ (parted) mklabel msdos
  6. Create Partition: $ (parted) mkpart primary ext4 1M 100%
  7. Set Boot Flag: $ (parted) set 1 boot on
  8. Verify Partition: $ (parted) print
  9. Exit Parted: $ ctrl+C
  10. Format Partition: $ mkfs.ext4 /dev/sda1
  11. Mount Partition: $ mount /dev/sda1 /mnt

Package Installation (5 min of waiting)

  1. Install Base Packages: $ pacstrap -i /mnt base base-devel
  2. Hit enter, enter, Y

Configuration (5 min)

  1. Generate fstab: $ genfstab -U /mnt > /mnt/etc/fstab
  2. Change to Root in New System: $ arch-chroot /mnt /bin/bash
  3. Set Locale: $ echo "LANG=en_US.UTF-8" > /etc/local.conf
  4. Download Boot Loader: $ pacman -S grub os-prober
  5. Install Boot Loader: $ grub-install --target=i386-pc --recheck /dev/sda
  6. Generate Boot Config: $ grub-mkconfig -o /boot/grub/grub.cfg
  7. Set Some Hostname: $ echo "myhostname" > /etc/hostname
  8. Get NIC Name: $ ip link
  9. Autostart Internet Connectivity: $ systemctl enable dhcpcd@xxx.service
  10. where xxx is the NIC name from $ ip link
  11. Set Root Password: $ passwd
  12. Exit New System: $ exit
  13. Reboot: $ reboot
  14. Select option 3 “Boot existing OS” to boot into Arch
  15. Login as root

GUI (10 min, mostly waiting)

  1. Install OpenGL Drivers
    1. Enable Multilib
      1. # vi /etc/pacman.conf
      2. Uncomment the two multilib lines:
        #[multilib]
        #Include = /etc/pacman.d/mirrorlist

        To:

        #[multilib]
        #Include = /etc/pacman.d/mirrorlist
    2. Update Pacman: # pacman -Syu
    3. Install OpenGL: # pacman -S mesa-libgl
    4. Install 32 bit OpenGL: # pacman -S lib32-mesa-libgl
    5. </ol>
    6. Install VirtualBox Guest Utilities: # pacman -S virtualbox-guest-utils
    7. Install Gnome: # pacman -S gnome gnome-extra
      1. Hit enter enter enter enter Y
    8. Enable GDM: # systemctl enable gdm.service
    9. Install Gnome Tweak Tool: # pacman -S gnome-tweak-tool
    10. The Final Reboot Before Things Become Civilized: # reboot
    And that's all there is to it.
comments powered by Disqus