[index] [home]

Tweet

Installing an Arch Linux box as QEMU-host

This is a walkthrough of what I did to get Arch Linux 2014.12.01 as QEMU-host onto a Core2Duo (32-bit) PC with 140 GB disk and 2 GB of mem, around 2015-01-20.

Disclaimer

From what I can tell, Arch Linux comes with brilliant documentation in the form of a Wiki. The document you are reading is therefore not leading; it merely describes what I did, for better or worse.

Arch documentation used in this text:

Summary and goals

My goal is to run multiple QEMU-guests, each fit for running at least 1 application very well, where the guest's OS of choice is the one that runs that application best/easiest.

Goals in terms of installed software:

Actions

Actions are listed below in order of execution, starting from install-media and a clean PC.

Installing Arch Linux

This section closely follows the Installation guide, and uses details from Partitioning, Swap, and Systemd.

  1. burn installation ISO-image (Dutch mirror) to CD
  2. insert installation-media into PC, and boot 32-bit Arch Linux until a root-prompt appears
  3. fdisk /dev/sda, and setup partitions as follows:
  4. mkswap /dev/sda1
  5. swapon /dev/sda1
  6. mkfs.ext4 /dev/sda2
  7. mount /dev/sda2 /mnt
  8. (DHCP-client should be running; try ping www.google.com to verify you have network connectivity at this point)
  9. pacstrap /mnt base
  10. genfstab -p /mnt >> /mnt/etc/fstab
  11. arch-chroot /mnt
  12. echo my-computer-name > /etc/hostname
  13. ln -sf /usr/share/zoneinfo/CET /etc/localtime
  14. in /etc/locale.gen: uncomment en_US.UTF-8 UTF-8 (I have no idea how useful this actually is)
  15. locale-gen (I have no idea what to fill in in /etc/locale.conf or $HOME/.config/locale.conf)
  16. mkinitcpio -p linux
  17. passwd root, and set new password
  18. choose syslinux as bootloader
  19. syslinux nor pacman are available yet, so run...
  20. in /boot/syslinux/syslinux.cfg: change 'sda3' to 'sda2' (bug?)
  21. syslinux-install_update -i -a -m
  22. exit chroot (Ctrl-D)
  23. reboot, remove CD, choose 'Arch Linux' from boot-menu
  24. pacman -S openssh
  25. systemctl enable dhcpcd (use systemctl list-unit-files to see which units are started or enabled to run at boot)
  26. systemctl start dhcpcd (verify by pinging 'google.com')
  27. systemctl start sshd
  28. systemctl enable sshd
  29. test SSH: ssh localhost, login as root; also test SSH access from LAN
  30. useradd -m michai
  31. passwd michai, and set new password (can su root per default; see /etc/group)

You now have a SSH-accessible box booting Arch Linux, getting an IP-address through DHCP.


Delivered to you by Vim, GNU Make, MultiMarkdown, bozohttpd, NetBSD, and 1 human.