Skip to content

Instantly share code, notes, and snippets.

@rollwagen
Last active August 20, 2023 20:24
Show Gist options
  • Save rollwagen/88cc5a15da1dd7a5ed489d261db4e70d to your computer and use it in GitHub Desktop.
Save rollwagen/88cc5a15da1dd7a5ed489d261db4e70d to your computer and use it in GitHub Desktop.
Arch Linux ARM on ESXi Fling (on Raspberry Pi 4)

arch linux arm on esxi fling (on raspberry pi 4)

  • create / Register VM -> Linux / Other 4.x or Later (64bit) -> ...

    • CD/DVD Drive: use a Linux ISO that can boot into a recue shell e.g 'debian-10.9.0-arm64-netinst.iso'; make sure "Connect at power on" is selected
    • VM Options / Boot options: Firmware "EFI" (should be the default anyways)
  • power On VM -> should see GNU GRUB welcome screen (from debian ISO/cdrom) -> Advanced Options -> Rescue mode

    • go through menu selections (language, keyborad, etc) until you have a shell ('Execute a shell in the intaller environment')
  • partition the disk; see also ArchLinux Wiki Partition the disk

    One partition for the root directory /. For booting in UEFI mode: an EFI system partition.

    • fdisk -l should list your hd; usually /dev/sda

    • using fdisk create boot/EFI parition and root partition e.g.

      fdisk /dev/sda
      g
      p
      n # +300M
      t # 1 'EFI System'
      n # will per default be 'Linux fileystem'
      w # write new GTP partition table to disk
    
    
  • format the partitions and mount the file systems

    • format:
    mkfs.fat /dev/sda1
    mkfs.ext4 /dev/sda2
    • mount the file systems
      • mkdir /mnt/root; mount /dev/sda2 /mnt/root
      • mkdir /mnt/boot; mount /dev/sda1 /mnt/boot
  • still in rescue shell, download generic ArchLinux ARM package; see link

    • cd /tmp; wget http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz
  • Unpack into /mnt/root

    • tar -xzf /tmp/ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/root
    • cd /mnt/root/boot; cp -a * /mnt/boot
  • Reboot system, in GRUB screen, select 'c' (grub command line), and boot ArchLinux:

    grub> ls
    grub> ls (hd0,gpt2)/
    grub> linux (hd0,gpt2/boot/Image.gz root=/dev/sda2
    grub> initrd (hd0,gpt2/boot/initramfs-linux.img
    grub> boot
  • login with root / root

  • If root "/" is mounted as read-only, re-mount re-write

    • mount -o remount,rw /dev/sda2 /
  • Setup pacman (database synche etc)

    pacman-key --init
    pacman-key --populate archlinuxarm
    pacman -Syy`
  • install install helper scripts pacman -S arch-install-script (contains e.g. genfstab)

  • generate fstab, see also ArchLinux Wiki on fstab

     # ensure boot is mounted too, if not
     mv /boot /boot.bak
     mkdir /boot
     mount /dev/sda1 /mnt/boot
    
     genfstab -U / >> /etc/fstab
  • install and setup GRUB (boot manager)

    • update kernel etc with pacman -S linux linux-headers (select "1) linux-aarch64-headers")
    • install grub etc pacman -S grub efibootmgr
  • install GRUB with

    • grub-install --target=arm64-efi --efi-directory=/boot --bootloader-id=GRUB --boot-directory=/boot
  • configure grub, see also ArchLinux Wiki on Grub link

    • NOTE: generally grub-install look for the kernel image name '/boot/vmlinuz-*...', however, the arm kernel image in '/boot' is called 'Image.gz' (compressed) resp. 'Image' (uncompressed). Quick fix / dirty workaround for grub to find the kernel and generate respective grub.cfg is not copy/rename current kernel image to 'vmlinuz-linux' before calling grub-mkconfig
      cd /boot
      cp Image vmlinuz-linux
      grub-mkconfig -o /boot/grub/grub.cfg
  • reboot ! 🤞

  • for remaining steps (e.g. setting hostname etc) see Installion guide and General Recommendations (post install) on ArchLinux Wiki

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