- Create a new virtual machine.
- Go to System tab, change architecture to `ARM64 (aarch64)' and increase memory as needed.
- Download Alpine Linux LiveCD:
mirror=https://dl-cdn.alpinelinux.org/alpine
curl -o alpine-virt-latest-aarch64.iso "$mirror/latest-stable/releases/aarch64/$(curl "$mirror/latest-stable/releases/aarch64/latest-releases.yaml" | /usr/bin/grep -E 'file: alpine-virt-[0-9\.]+-aarch64\.iso' | head -n 1 | sed 's/ //g' | sed 's/\t//g' | sed 's/^file://')"
- Go to Drives tab, New Drive, set size to 20GiB or larger, then Inport Drive, choose the file you just downloaded.
- Go to Display tab, change Type to Console Only to enable pasting.
- Save the settings.
- Start the VM.
- Login as root.
setup-alpine
Leave all fileds empty (including password) until selecting a mirror. You might want to use a mirror, and then select `none' for ssh server and everything left.
- Paste these commands:
alpineMirror=ALPIN_MIRROR
archlinuxARMMirror=ARCH_ARM_MIRROR
hostname=YOUR_HOSTNAME
username=YOUR_USER_NAME
echo "$alpineMirror"'/edge/main
'"$alpineMirror"'/edge/community' >/etc/apk/repositories
apk add arch-install-scripts pacman-makepkg gptfdisk btrfs-progs
mkdir /etc/pacman.d
cat >/etc/pacman.conf <<END
[options]
HoldPkg = pacman glibc
SigLevel = Required DatabaseOptional
Architecture = aarch64
Color
CheckSpace
ParallelDownloads = 8
LocalFileSigLevel = Optional
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist
[alarm]
Include = /etc/pacman.d/mirrorlist
[aur]
Include = /etc/pacman.d/mirrorlist
END
echo 'Server = '"$archlinuxARMMirror"'/$arch/$repo' >/etc/pacman.d/mirrorlist
mkdir /tmp/pacmaninit
cd /tmp/pacmaninit
pacman -Sydd pacman-mirrorlist archlinuxarm-keyring --noconfirm
rm /var/cache/pacman/pkg/*.sig
tar -xf /var/cache/pacman/pkg/pacman-mirrorlist-*.pkg.tar.*
tar -xf /var/cache/pacman/pkg/archlinuxarm-keyring-*.pkg.tar.*
cat etc/pacman.d/mirrorlist >>/etc/pacman.d/mirrorlist
mkdir /usr/share/pacman/keyrings
cp usr/share/pacman/keyrings/archlinuxarm.gpg /usr/share/pacman/keyrings/
echo '02922214DE8981D14DC2ACABBC704E86B823CD25:4:' >>/usr/share/pacman/keyrings/archlinuxarm-trusted
echo '9D22B7BB678DC056B1F7723CB55C5315DCD9EE1A:4:' >>/usr/share/pacman/keyrings/archlinuxarm-trusted
echo '69DD6C8FD314223E14362848BF7EEF7A9C6B5765:4:' >>/usr/share/pacman/keyrings/archlinuxarm-trusted
touch /usr/share/pacman/keyrings/archlinuxarm-revoked
pacman-key --init
pacman-key --populate archlinuxarm
pacman -Sdd archlinuxarm-keyring --noconfirm --overwrite '*'
pacman-key --init
pacman-key --populate archlinuxarm
echo -e 'n\n\n\n+1G\nef00\np\nn\n\n\n\n8300\nw\ny\n' | gdisk /dev/vda
mkfs.vfat /dev/vda1
mkfs.btrfs /dev/vda2
mount -t btrfs /dev/vda2 /mnt
mkdir -p /mnt/boot/efi
mount -t vfat /dev/vda1 /mnt/boot/efi
pacstrap /mnt base linux linux-firmware grub btrfs-progs sudo dhcpcd busybox
if [ ! -e /mnt/boot/Image ]; then
ln -s Image /mnt/boot/vmlinuz-linux
fi
genfstab -U /mnt >> /mnt/etc/fstab
cat >/mnt/.__init <<END
grub-install --removable
grub-mkconfig -o /boot/grub/grub.cfg
echo "\$hostname" >> /etc/hostname
echo -e "127.0.0.1\tlocalhost" >> /etc/hosts
echo -e "::1\t\t\tlocalhost" >> /etc/hosts
echo -e "127.0.0.1\t\$hostname" >> /etc/hosts
chmod +w /etc/sudoers
echo 'Defaults env_reset' >>/etc/sudoers
sed -i 's|# Defaults secure_path="|Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/bin"\n# Defaults secure_path="|' /etc/sudoers
sed -i 's/# \%sudo\tALL/\%sudo\tALL/' /etc/sudoers
chmod -w /etc/sudoers
sed -i 's/proc:x:26:/proc:x:26:\nsudo:x:27:'"\$username"'/' /etc/group
useradd "\$username" -m -U
passwd -d "\$username"
systemctl enable dhcpcd
systemctl set-default multi-user.target
END
export username hostname
arch-chroot /mnt bash /.__init
rm /mnt/.__init
chroot /mnt /bin/passwd "$username"
to change your passwd.poweroff
- Open VM settings panel, switch to Display tab, change display type back to full graphics and chang scaling algorithm to nearst neighbor.
- Go to Drivers and remove Alpine Linux LiveCD.
- Save config, power on and install a graphic user interface.
Evidently, you aren't familiar with Arch Linux. Since there is no Aarch64 boot iso for Arch Linux, these instructions get you started with a bootable Alpine Linux image, essentially as a rescue disk, but from there you configure pacman and use pacstrap to install the Arch "base" and "linux" parts of Arch to the virtual disk, you are literally installing Arch. Once you eject the Alpine rescue image and boot from the disk image, you're running Arch. Please delete your confusing and misguided comment.