Skip to content

Instantly share code, notes, and snippets.

@tlatsas
Last active March 27, 2020 18:26
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tlatsas/5005963 to your computer and use it in GitHub Desktop.
Save tlatsas/5005963 to your computer and use it in GitHub Desktop.
archlinux kvm guest install cheatsheet
  • partitions
    • use the tool of your choice (fdiks/gdisks/parted)
  • filesystems
    • mkfs -t <fs-type> /dev/<partition>
  • mount partitions on /mnt
  • setup network
    • ip address add <IP>/<CIDR> dev eth0
    • ip route add default via <GW>
    • add dns in /etc/resolve.conf
  • select pacman mirror
    • /etc/pacman.d/mirrorlist
  • select repositories
    • /etc/pacman.conf
  • pacman -Syy
  • pacstrap /mnt base base-devel
  • genfstab -U -p /mnt >> /mnt/etc/fstab
  • check/edit the generated fstab
  • install GRUB
    • arch-chroot /mnt pacman -S grub-bios
  • chroot arch-chroot /mnt /bin/bash
  • set locale
    • edit /etc/locale.gen
    • run locale-gen
  • edit basic system properties
    • /etc/locale.conf
    • /etc/vconsole.conf
    • /etc/hostname
    • ln -s /usr/share/zoneinfo/<Zone>/<SubZone> /etc/localtime
    • edit /etc/mkinitcpio.conf and add the required KVM modules
      • MODULES="virtio virtio_blk virtio_pci virtio_net"
  • rebuild image
    • run mkinitcpio -p linux
  • users setup
    • set root password with passwd
    • create new user
      • useradd -m -g users -s /bin/bash <username>
      • passwd <username>
  • configure GRUB 2:
    • modprobe dm-mod
    • grub-install --target=i386-pc --grub-setup=/bin/true --recheck --debug /dev/vda
    • mkdir -p /boot/grub/locale
    • cp /usr/share/locale/en@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo
    • grub-mkconfig -o /boot/grub/grub.cfg
    • check/edit grub.cfg
  • reboot
@ameeno
Copy link

ameeno commented Feb 11, 2020

how about qxl?

@jpnadas
Copy link

jpnadas commented Mar 27, 2020

Awesome... Just a tip, since 2019-10-06 it's required to install a kernel besides installing the base package. Thus, pacman -S linux must be run before being able to run mkinitcpio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment