This page was archived on 2020-02-21. It's still mostly relevant for pre-UEFI systems, but will no longer be updated.
cfdisk /dev/sda
(DOS table, one partition, bootable.)
mkfs.ext4 /dev/sda1
mount /dev/sda1 /mnt
pacstrap /mnt base base-devel htop tmux sudo wget grub elinks
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
echo hostname > /etc/hostname
(You should probably add it to /etc/hosts too)
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
systemctl enable netctl
netctl enable enet
useradd -m -G wheel -s /bin/bash user
echo %wheel ALL=\(ALL\) ALL >> /etc/sudoers
grub-install --target=i386-pc /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
systemctl enable sshd
systemctl enable vmtoolsd
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.
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
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.
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.