Table of Contents
This page was archived on 2020-02-21. It's still mostly relevant for pre-UEFI systems, but will no longer be updated.
Installing
- Enable ssh: ip addr , passwd , systemctl start sshd , ssh into VM
- Partition drive:
cfdisk /dev/sda
(DOS table, one partition, bootable.)
- Format:
mkfs.ext4 /dev/sda1
- Mount root:
mount /dev/sda1 /mnt
- Install:
pacstrap /mnt base base-devel htop tmux sudo wget grub elinks
- Generate fstab:
genfstab -Up /mnt >> /mnt/etc/fstab
- chroot:
arch-chroot /mnt /bin/bash
- set locale:
echo en_US.UTF-8 UTF-8 > /etc/locale.gen ; locale-gen
- Set time zone
ln -s /usr/share/zoneinfo/America/New_York /etc/localtime
- set hostname:
echo hostname > /etc/hostname
(You should probably add it to /etc/hosts too)
- create netctl profile:
echo -e "Interface=ens32\nConnection=ethernet\nIP=static\nAddress='10.0.0.15/8'\nGateway='10.0.0.1'\nDNS='10.0.0.1'" > /etc/netctl/enet
- if DHCP is required, edit /etc/netctl/examples/ethernet-dhcp instead
- enable netctl:
systemctl enable netctl
- enable profile:
netctl enable enet
- set root passwd
- create user
useradd -m -G wheel -s /bin/bash user
- set user passwd
- configure sudo
echo %wheel ALL=\(ALL\) ALL >> /etc/sudoers
- install bootloader
grub-install --target=i386-pc /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
- enable ssh:
systemctl enable sshd
- enable vmtools:
systemctl enable vmtoolsd
- exit chroot
- umount /mnt
- sync
- reboot & disconnect ISO
Other Options
As with everything else linux related, there are many different ways to go about this. Listed below are a few alternatives to the above steps.
Partitioning
A very quick way to create one partition with fdisk can be to echo keystrokes to it:
echo -e "o\nn\n\n\n\n\nw" | fdisk /dev/sda
This can be done even faster when combined directly with mkfs & mounting:
echo -e "o\nn\n\n\n\n\nw" | fdisk /dev/sda; mkfs.btrfs /dev/sda1; mount /dev/sda1 /mnt
Mirror
Ctrl-K-ing all of the mirrorlist can take some time, and is unnecessary.
echo Server = http:\/\/10.0.0.35\/archlinux\/\$repo\/os\/\$arch > /etc/pacman.d/mirrorlist
Note: This will wipe ALL of the mirrors from the mirrorlist.
The Whole Kaboodle
If you really wanted to, you could do it all in one fell swoop. I've added in a few extras.
dd if=/dev/zero of=/dev/sda count=100000; echo -e "o\nn\n\n\n\n\nw" | fdisk /dev/sda; mkfs.btrfs /dev/sda1; mount /dev/sda1 /mnt; echo Server = http:\/\/10.0.0.35\/archlinux\/\$repo\/os\/\$arch > /etc/pacman.d/mirrorlist; pacstrap /mnt base base-devel syslinux openssh tmux open-vm-tools sudo wget; genfstab -Up /mnt >> /mnt/etc/fstab; arch-chroot /mnt /bin/bash; echo en_US.UTF-8 UTF-8 > /etc/locale.gen; locale-gen; ln -s /usr/share/zoneinfo/America/New_York /etc/localtime; hwclock --systohc --utc; echo hostname > /etc/hostname; echo -e "Interface=ens32\nConnection=ethernet\nIP=static\nAddress='10.0.0.x/8'\nGateway='10.0.0.1'\nDNS='10.0.0.1'" > /etc/netctl/enet; netctl enable enet; systemctl enable netctl; systemctl enable vmtoolsd; systemctl enable sshd; useradd -m -G wheel -s /bin/bash user; echo %wheel ALL=\(ALL\) ALL >> /etc/sudoers; syslinux-install_update -iam
This does not include setting passwords for root or the new user, or changing /dev/sda3 to /dev/sda1 in syslinux.cfg. Chroot can be exited and /mnt umounted after this is done.