Download debian iso
http://cdimage.debian.org/cdimage/release/current/mipsel/iso-cd/debian-9.1.0-mipsel-netinst.iso
Download initrd & vmlinux
Create a new hard disk
$ qemu-img create -f qcow2 hda.qcow 10G
Install debian
$ qemu-system-mipsel -cdrom debian-9.1.0-mipsel-netinst.iso \
-hda hda.qcow \
-M malta \
-kernel vmlinux-4.9.0-3-4kc-malta \
-boot d \
-initrd initrd.gz \
-m 512 \
-nographic \
-append "root=/dev/sda1 nokaslr"
Allow for the installation to complete. When done copy over the vmlinux-4.9.0-3-4kc-malta
file from the Debian VM to the host machine. See references [4] on how to copy vmlinux-4.9.0-3-4kc-malta
from hda.qcow
to your host.
Boot from hda
$ qemu-system-mipsel -hda hda.qcow \
-M malta \
-kernel vmlinux-4.9.0-3-4kc-malta \
-initrd initrd.gz \
-m 512 \
-nographic \
-append "root=/dev/sda1 nokaslr"
Important note: vmlinux-4.9.0-3-4kc-malta
is the file copied from hda.qcow
in the previous step and NOT the original one downloaded from ftp.debian.org. If you use the original file the Debian installer will rerun.
References
I followed the instructions exactly (except that I have to update some URL links to use the latest versions). However, in the last step, "Boot from hda", the system still comes out in installer mode, which is strange. To make sure I'm not crazy, I even deleted iso file, and it still does so. I patently went through the installation again. At the very end, it still reboots to installer screen.
Is there anything I did wrong?