.gitignore | ||
README.md |
openwrt-virtualization
Documents a practical means of setting up a virtual OpenWrt device.
Targeting OpenWrt 24.10.1, for testing purposes.
Other docs
https://openwrt.org/docs/guide-user/virtualization/qemu#openwrt_in_qemu_arm
Setup
Assumes Fedora.
sudo dnf install -y qemu-system-aarch64 make
Running
# There are other files here: https://downloads.openwrt.org/snapshots/targets/armsr/armv8/
wget https://downloads.openwrt.org/releases/24.10.1/targets/armsr/armv8/openwrt-24.10.1-armsr-armv8-generic-squashfs-combined-efi.img.gz
# Unpack.
gunzip -c openwrt-*armsr-armv8-generic-squashfs-combined-efi.img.gz > openwrt-arm-64.img
# Get, and stash, u-boot.
mkdir u-boot-qemu_armv8/
wget -O u-boot-qemu_armv8/u-boot.bin https://downloads.openwrt.org/releases/24.10.1/targets/armsr/armv8/u-boot-qemu_armv8/u-boot.bin
# Start!
qemu-system-aarch64 -nographic \
-cpu cortex-a53 -machine virt \
-bios u-boot-qemu_armv8/u-boot.bin \
-smp 1 -m 1024 \
-device virtio-rng-pci \
-drive file=openwrt-arm-64.img,format=raw,index=0,media=disk \
-netdev user,id=testlan -net nic,netdev=testlan \
-netdev user,id=testwan -net nic,netdev=testwan
# from https://github.com/dineshloganathan395/dineshloganathan395.github.io/blob/main/_posts/2025-03-19-build-openwrt-for-armsr.adoc#running-openwrt-using-qemu-with-generated-images.
# You can use Ctrl-a x to terminate QEMU, or Ctrl-a c to get a QEMU
# command prompt, similarly to how Ctrl-a : gives you a command prompt
# in Screen. ... see https://superuser.com/a/1211516 for other QEMUisms.