Created
February 28, 2026 01:28
-
-
Save CarlFK/4a8d96b22daa0535e92d89d7dac6adfd 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
| #!/bin/bash | |
| set -ex | |
| dev="/dev/sda" | |
| # sudo apt install qemu qemu-utils qemu-system ovmf | |
| qemu() { | |
| qemu-system-x86_64 \ | |
| -m 512 \ | |
| -machine q35,accel=kvm \ | |
| -cpu host \ | |
| -drive file=${dev},if=none,format=raw,id=dev \ | |
| -usb \ | |
| -device usb-storage,drive=dev \ | |
| -boot menu=on | |
| } | |
| # get the installer, write to usb | |
| wget -N http://deb.debian.org/debian/dists/trixie/main/installer-amd64/current/images/hd-media/boot.img.gz | |
| gunzip --keep --force boot.img.gz | |
| sudo dd status=progress if=boot.img of=${dev} | |
| # boots to installer (close qemu window to exit) | |
| qemu | |
| fatresize --progress --verbose --size 2G ${dev} | |
| # boot error: | |
| qemu | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment