Skip to content

Latest commit

 

History

History
125 lines (104 loc) · 5 KB

File metadata and controls

125 lines (104 loc) · 5 KB

Arch Linux Installation Guide for Virtual Machines & WSL2

For testing, development, or container hosting, virtualized environments let you run Arch Linux inside Windows or macOS without modifying partition schemes. This guide explains how to install Arch in a Virtual Machine (VirtualBox/VMware) and Windows Subsystem for Linux (WSL2).


Part 1: Virtual Machines (VirtualBox & VMware Player)

Virtual machines isolate the guest OS. Arch Linux installs identically in a VM, but requires some hardware settings adjustments and guest utilities to optimize graphical performance.

1. VM Hardware Configuration

When creating a new Virtual Machine, use the following settings for the best experience:

  • OS Type: Linux / Arch Linux (64-bit).
  • System/Motherboard: Check Enable EFI (highly recommended; standard BIOS is legacy).
  • RAM: At least 2 GB / 2048 MB (4 GB recommended if using a heavy desktop environment).
  • CPU: Allocate at least 2 Cores (prevents high latency inside desktop interfaces).
  • Display: Set video memory to 128 MB (maximum) and check Enable 3D Acceleration (crucial for smooth performance on modern UI shells).

2. Follow Standard Installation

Mount your downloaded Arch Linux standard ISO inside the virtual optical drive and boot. Follow the standard Windows/PC installation guide to partition, format, and pacstrap the system.

3. Post-Install VM Integration (Guest Additions)

Once you boot into your freshly installed Arch Linux machine, you must install the specific VM integration drivers.

For Oracle VirtualBox

These drivers enable shared folder access, copy/paste clipboard sharing, and automatic screen resizing.

  1. Run this inside your Arch VM terminal:
    sudo pacman -S virtualbox-guest-utils xf86-video-vmware
  2. Enable and start the background guest synchronization service:
    sudo systemctl enable vboxservice.service
    sudo systemctl start vboxservice.service

For VMware Workstation / Player

These utilities manage mouse movement, screen scaling, and copy-paste.

  1. Run this inside your Arch VM:
    sudo pacman -S open-vm-tools xf86-video-vmware xf86-input-vmmouse
  2. Enable and start the VM synchronization service:
    sudo systemctl enable vmtoolsd.service
    sudo systemctl start vmtoolsd.service

Part 2: WSL2 (Windows Subsystem for Linux)

Running Arch Linux natively in Windows with full systemd integration and high file-system speeds. We will use the popular, open-source ArchWSL wrapper project.

1. Prerequisites (In Windows Terminal)

Ensure WSL2 is active on your Windows machine:

  1. Open PowerShell as Administrator and run:
    wsl --install
  2. Make sure you are using WSL2 as the default architecture version:
    wsl --set-default-version 2

2. Download and Initialize ArchWSL

  1. Go to the ArchWSL GitHub Releases page and download the latest zip file (e.g., Arch2.zip).
  2. Extract the contents of the zip file into a permanent directory on your drive (e.g., C:\WSL\Arch). Do not place it in temporary download directories.
  3. Inside your extracted folder, locate Arch.exe, right-click it, and select Run as administrator.
  4. A console window will pop up and register the Arch distribution. This takes under a minute.

3. Core Arch Setup inside WSL

Once the registration completes, press any key to open the Arch command shell.

Initialize Pacman Keyring

Since WSL images do not have a live boot entropy system, you must initialize keys manually:

pacman-key --init
pacman-key --populate archlinux
pacman -Sy archlinux-keyring
pacman -Syu

Set Up Standard User Account

Create your primary user account, configure their shell, and give them administrator privileges.

# Add new user:
useradd -m -G wheel -s /bin/bash username
passwd username

# Set password for root:
passwd root

Give the new user access to sudo:

# Uncomment '%wheel ALL=(ALL:ALL) ALL' inside visudo
EDITOR=nano visudo

Set Default WSL User

Exit the Arch console. Back in Windows PowerShell, navigate to your extraction folder and set the newly created user as the default login handle:

.\Arch.exe config --default-user username

4. Enable Systemd Support

By default, WSL does not launch systemd as system manager. Let's toggle it:

  1. Inside your ArchWSL terminal, create the WSL configuration file:
    sudo nano /etc/wsl.conf
  2. Insert the following lines to enable systemd and auto-mount Windows drives:
    [boot]
    systemd=true
    
    [automount]
    options = "metadata"
  3. Save and close the file.
  4. Back in Windows PowerShell, restart WSL to reload settings:
    wsl --shutdown
  5. Relaunch your Arch terminal. You can now use systemctl to start database servers, Docker services, and local scripts!