Skip to content

Instantly share code, notes, and snippets.

@xkou
Created September 6, 2023 13:18
Show Gist options
  • Save xkou/5a5f301a5760817bf32d2871147e5b8b to your computer and use it in GitHub Desktop.
Save xkou/5a5f301a5760817bf32d2871147e5b8b to your computer and use it in GitHub Desktop.
start openwrt vm
[ -e zImage ] || wget https://downloads.openwrt.org/releases/18.06.1/targets/armvirt/32/openwrt-18.06.1-armvirt-32-zImage -O zImage
[ -e root.ext4.gz ] || wget https://downloads.openwrt.org/releases/18.06.1/targets/armvirt/32/openwrt-18.06.1-armvirt-32-root.ext4.gz -O root.ext4.gz
[ -e root.ext4 ] || gunzip root.ext4.gz
# /etc/init.d/firewall stop
qemu-system-arm -M virt-2.9 \
-kernel zImage -no-reboot -nographic \
-device virtio-net-pci -netdev user,id=net1,hostfwd=tcp::2222-:22 -device virtio-net-pci,netdev=net1 \
-drive file=root.ext4,if=virtio,format=raw \
-append "root=/dev/vda"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment