I'm trying to run an existing debian img with QEMU, edit it by installing custom packages and adding various configs, verify that it works and then write it to an sd card so I can boot it from a single board computer.
I'm using fedora as my main distro. The debian image I want to install is debian 12 and my single board computer is a rock64 armv8.
The main issues I'm facing are:
- I dont know if the qemu command below will edit my image after I complete the installation, does anyone know how can I verify with qemu that the installation was successful and the img was written, without booting the installation steps again?
- When I'm on the debian shell during or after the installation steps, I dont have access to commands like
apt, I cant use
su(commands not found) and also the
homedirectory is missing (although it was created through the installation steps) and that beats the purpose of the whole attempt.
Some minor annoyances:
- Extremely slow installation (every attempt it takes me 2-3+ hours), is this normal?
ddcommand is very slow (1 hour+), is this normal?
ctrl+cwhen inside the emulation exits qemu (I've done this many times when I'm on shell to cancel commands and resulted on having to do the installation again)
- The colors contrast of the emulation is poor and same for the viewport (adding a
-vga stddid not help)
The steps I'm following are:
- Download the debian image from: https://deb.debian.org/debian/dists/bookworm/main/installer-arm64/current/images/netboot/SD-card-images/
- download the kernel from: https://deb.debian.org/debian/dists/bookworm/main/installer-arm64/current/images/netboot/debian-installer/arm64/
- increase the size of the image by 4 giga bytes so it will have additional space to write our changes:
qemu-img resize debian-installer.img 4G
- Run qemu:
-kernel installer-linux \
-cpu cortex-a53 \
-m 1024 \
-M virt \
-no-reboot -serial stdio \
-append "rw root=/dev/mmcblk0p1 panic=0" \
-initrd installer-initrd.gz \
- Go through the installation (this is extremely slow - it usually takes 2-3 hours and I did it more than 10 times the last days, as Im trying to figure things out)
- before completing the installation and rebooting, I go to the shell and try to install new packages and also add some configs for the users I created
If the above succeeds, I want to:
- Write the img to the sd card:
dd if=debian-installer.img of=/dev/mmcblk0
- Boot the image to the single board computer