Let's install Debian 9.0 "Stretch" on QEMU MIPS64 under Ubuntu.
sudo apt install qemu-system-mips
wget http://ftp.debian.org/debian/dists/stretch/main/installer-mips64el/current/images/malta/netboot/vmlinux-4.9.0-8-5kc-malta
wget http://ftp.debian.org/debian/dists/stretch/main/installer-mips64el/current/images/malta/netboot/initrd.gz
qemu-img create -f qcow2 hda.qcow 8G
qemu-system-mips64el \
-cpu 5KEf \
-M malta \
-m 512 \
-hda hda.qcow \
-kernel vmlinux-4.9.0-8-5kc-malta \
-initrd initrd.gz \
-append "root=/dev/sda1 nokaslr" \
-nographic
Proceed with the installation to complete.
During installation process, the installer has created a initrd.img that contains all the needed drivers for booting the system. We need to extract this file from the disk. Utility qemu-nbd helps to mount the QEMU disk image.
sudo apt-get install qemu-utils
sudo modprobe nbd max_part=8
sudo qemu-nbd --connect=/dev/nbd0 hda.qcow
sudo mount /dev/nbd0p1 /mnt
cp /mnt/boot/initrd.img-4.9.0-8-5kc-malta .
sudo umount /mnt
qemu-system-mips64el \
-cpu 5KEf \
-M malta \
-m 2048 \
-hda hda.qcow \
-kernel vmlinux-4.9.0-8-5kc-malta \
-initrd initrd.img-4.9.0-8-5kc-malta \
-append "root=/dev/sda1 nokaslr" \
-nographic
See protocol-debian-mips64el for a protocol of booting the resulting system.
See device-tree-mips64el-on-qemu for a device tree.