Created
December 25, 2022 17:15
-
-
Save vrdhn/7c27ad3fa3be7ac422fc67e97ca3e4de to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qemu-img create -f qcow2 arch-root.qcow2 64G | |
sudo modprobe nbd | |
sudo qemu-nbd -c /dev/nbd0 arch-root.qcow2 | |
sudo cfdisk -z /dev/nbd0 | |
# make dos partition table | |
# make a new partition, make it bootable | |
sudo mkfs.ext4 /dev/nbd0p1 | |
sudo mount /dev/nbd0p1 /mnt/ | |
sudo pacstrap -c /mnt base linux-lts curl openssh dhcpcd grub vim | |
sudo arch-chroot /mnt | |
## edit /etc/mkinitcpio.conf | |
MODULES=(virtio_pci virtio_blk virtio_net virtio_scsi virtio_console ) | |
# | |
mkinitcpio -P | |
systemctl enable dhcpcd | |
systemctl enable sshd | |
mkdir -p -m 700 ~/.ssh | |
curl -o ~/.ssh/authorized_keys https://github.com/vrdhn.keys | |
## just in case ... | |
passwd | |
grub-install --target=i386-pc /dev/nbd0 | |
grub-mkconfig -o /boot/grub/grub.cfg | |
pacman -Scc | |
exit | |
sudo lsof | grep /mnt | |
sudo umount /mnt | |
sudo qemu-nbd -d /dev/nbd0 | |
sudo rmmod nbd | |
qemu-img convert -c -O qcow2 arch-root.qcow2 arch-root-small.qcow2 | |
## Run using virt-manager or virsh | |
virsh -c qemu:///system list | |
virsh -c qemu:///system domifaddr --full --domain <id from above, 1,2 etc> | |
## get the IP | |
ssh [email protected] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment