Can OpenWrt x86 be run inside QEMU?

QEMU emulates several types of hardware. Most operating systems have a lot of bundled drivers and usually have support for the virtual hardware. OpenWrt x86, however, is approximately 7MiB in size. I highly doubt it has enough drivers for zillions of x86 hardware, including those emulated by QEMU.

Currently, QEMU is able to emulate the following:
MACHINE TYPE

  • Intel i440FX northbridge + PIIX3 southbridge
  • Intel Q35 northbridge + ICH9 southbridge

FIRMWARE

  • SeaBIOS (BIOS)
  • OVMF (UEFI)

STORAGE CONTROLLER

  • IDE
  • SATA
  • SCSI / VirtIO SCSI
  • VirtIO Block (most Linux distros have support for virtio driver for virtual machine)

NETWORK

  • Intel E1000 Gigabit network card
  • VirtIO paravirtualized NIC
  • Realtek 8139 Fast Ethernet network card
  • vmxnet3

DISPLAY

  • std
  • cirrus
  • vmware
  • qxl

CPU
Well, many many types of CPU from the oldest i486 to the newest ones.

Which one does OpenWrt support? And which should I choose for best performance/compatibility possible?

GNOME Boxes or Virt-Manager usually provide reasonable defaults.
However, you should typically prefer VirtIO devices when possible.
BIOS/EFI - depends on the firmware image type.
Display - no need in general, or use the default/QXL for recovery tasks.

3 Likes