Skip to content

Instantly share code, notes, and snippets.

@xenobrain
Last active August 29, 2021 17:13
Show Gist options
  • Save xenobrain/343d2aaa4045181f089d4c5661ddd304 to your computer and use it in GitHub Desktop.
Save xenobrain/343d2aaa4045181f089d4c5661ddd304 to your computer and use it in GitHub Desktop.
```bash
# Create (VM has 128G disk)
cgdisk /dev/vda
EFI, 512M as ef00
Root, 115G as 8300
remaining as 8200 (should be around 1.5x larger than RAM for resume)
# Format
mkfs.vfat -F32 /dev/vda1
mkfs.ext4 /dev/vda2
mkswap /dev/vda3
swapon /dev/vda3
# Mount
mount /dev/vda2 /mnt
mkdir /mnt/boot
mount /dev/vda1 /mnt/boot
# Bootstrap
pacstrap /mnt base linux linux-firmware e2fsprogs efibootmgr man-db man-pages texinfo sudo vi nano bash-completion
# Time
ln -sf /usr/share/zoneinfo/US/Pacific /etc/localtime
hwlclock --systohc
# Locale
vi /etc/locale.gen, uncomment en_US.UTF-8 and save
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
# Hosts
vi /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 archvm.localdomain archvm
echo archvm > /etc/hostname
# Set the root password
passwd
# Install EFI entries
blkid
# note PARTUUID of Root Partition and Swap Partition
efibootmgr --disk /dev/vda --part 1 --create --label "Arch Linux" --loader /vmlinuz-linux --unicode 'root=PARTUUID=5e355d9a-fcc6-4a4d-bb1d-99a5628457f7 resume=PARTUUID=64a0e113-8092-46f6-a9a6-134c643b92b6 rw initrd=\initramfs-linux.img' --verbose
# Copy over some network stuff
CTRL+D to back out the chroot
cp /etc/systemd/networkd.conf /mnt/etc/systemd
cp /etc/systemd/resolved.conf /mnt/etc/systemd
cp /etc/systemd/network/20-ethernet.network /mnt/etc/systemd/network
# Reboot & Login
# Start & Enable networking
systemctl enable systemd-networkd
systemctl enable systemd-resolved
systemctl start systemd-networkd
systemctl start systemd-resolved
# Install Xorg LightDM & Awesome and a Terminal
pacman -S xorg-server lightdm lightdm-gtk-greeter awesome xterm
# Set up user
useradd -m -G wheel -s /bin/bash xenobrain
visudo -- uncomment wheel priviliges and save
passwd xenobrain
# Enable and start LightDM
systemctl enable lightdm
systemctl start lightdm
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment