-
Notifications
You must be signed in to change notification settings - Fork 7
For non‐native (ARM or MIPS)
Note: Non-native virtualization does not support KVM acceleration (Do not use --device /dev/kvm).
$ touch /hdimages/armhf.qcow2
$ docker run -it --rm \
--name qemu-container-arm \
--user="$(id --user):$(id --group)" \
-v /hdimages/armhf.qcow2:/tmp/hda.qcow2 \
-v /bootimages/initrd-debian11-armhf.gz:/tmp/initrd.gz \
-v /bootimages/vmlinuz-debian11-armhf:/tmp/vmlinuz \
-e QEMU_HDA=/tmp/hda.qcow2 \
-e QEMU_HDA_SIZE=20G \
-e QEMU_CPU=1 \
-e QEMU_RAM=1024 \
-v /cdimages/debian-11.1.0-armhf-netinst.iso:/tmp/debian.iso:ro \
-e QEMU_CDROM=/tmp/debian.iso \
-e QEMU_BOOT='order=d' \
-e QEMU_PORTS='2375 2376' \
-e QEMU_ARCH='arm' \
-e QEMU_MACHINE='virt' \
-e QEMU_KERNEL=/tmp/vmlinuz \
-e QEMU_INITRD=/tmp/initrd.gz \
gnh1201/qemu:6.1$ touch /hdimages/mips64el.qcow2
$ docker run -it --rm \
--name qemu-container-mips64el \
--user="$(id --user):$(id --group)" \
-v /hdimages/mips64el.qcow2:/tmp/hda.qcow2 \
-v /bootimages/debian11-mips64el-malta/initrd.gz:/tmp/initrd.gz \
-v /bootimages/debian11-mips64el-malta/vmlinuz-5.10.0-9-5kc-malta:/tmp/vmlinuz \
-e QEMU_HDA=/tmp/hda.qcow2 \
-e QEMU_HDA_SIZE=20G \
-e QEMU_CPU=1 \
-e QEMU_RAM=1024 \
-v /cdimages/debian-11.1.0-mips64el-netinst.iso:/tmp/debian.iso:ro \
-e QEMU_CDROM=/tmp/debian.iso \
-e QEMU_BOOT='order=d' \
-e QEMU_PORTS='2375 2376' \
-e QEMU_ARCH='mips64el' \
-e QEMU_MACHINE='malta' \
-e QEMU_CPUMODEL='5KEc' \
-e QEMU_KERNEL=/tmp/vmlinuz \
-e QEMU_INITRD=/tmp/initrd.gz \
-e QEMU_APPEND='console=ttyS0' \
gnh1201/qemu:6.1If ARM or MIPS is selected, vmlinuz(kernel image) and initrd are required. Please refer to this article and proceed.
When using the non-native (e.g. ARM, MIPS) platform, the bootloader must be extracted manually after the installation is completed.
$ qemu-img convert armhf.qcow2 armhf.raw
$ sudo mkdir /mnt/tmp
$ sudo mount -o loop,offset=$((2048 * 512)) armhf.raw /mnt/tmp
$ cd /mnt/tmp/bootThen, copy the initrd and vmlinuz files to an external directory. And load using QEMU_KERNEL and QEMU_INITRD variables.
When using the non-native (e.g. ARM, MIPS) platform, it was confirmed that the settings were not reflected in /etc/passwd and /etc/shadow. Please refer to the two links below and set them up manually.
This document may contain outdated content. For the latest information, please contact us directly or refer to the webpage below.