routeros-qemu-chr
Run MikroTik RouterOS CHR in QEMU
MikroTik RouterOS CHR provides a full-featured virtual router for testing and development, but setup requires navigating QEMU options, VirtIO drivers, and firmware configurations. This skill provides complete guidance for running CHR with acceleration, proper VirtIO setup, and REST API integration.
Download the skill ZIP
Upload in Claude
Go to Settings → Capabilities → Skills → Upload skill
Toggle on and start using
Test it
Using "routeros-qemu-chr". Boot CHR with KVM acceleration and REST API on port 9180
Expected outcome:
QEMU launches with hardware acceleration. RouterOS boots in ~5 seconds. HTTP 200 response from http://127.0.0.1:9180/ confirms readiness. REST API accessible at http://127.0.0.1:9180/rest/ with admin credentials.
Using "routeros-qemu-chr". Enable KVM on GitHub Actions Ubuntu runner
Expected outcome:
udev rule created at /etc/udev/rules.d/99-kvm4all.rules. KVM device permissions updated to 0666. QEMU successfully opens /dev/kvm for hardware acceleration. Boot time reduced from ~30s to ~5s.
Using "routeros-qemu-chr". Configure port forwarding for RouterOS services
Expected outcome:
Host ports mapped: 9180→80 (REST API), 9122→22 (SSH), 9728→8728 (API), 9729→8729 (API-SSL), 9291→8291 (WinBox). Services accessible from host via localhost ports.
Security Audit
Low RiskDocumentation and reference skill for running RouterOS CHR in QEMU. Static analysis flagged 343 patterns, but evaluation reveals these are false positives: shell backtick notation in markdown code examples (not execution), sudo in GitHub Actions CI (expected), MD5 references in kernel history docs (not actual usage), and legitimate acceleration detection commands. All network access targets MikroTik infrastructure for downloading CHR images. Risk level set to LOW due to external command patterns in documentation examples, but no actual malicious code present.
High Risk Issues (4)
Medium Risk Issues (3)
Low Risk Issues (2)
Risk Factors
⚙️ External commands (3)
🌐 Network access (2)
📁 Filesystem access (2)
Quality Score
What You Can Build
Automated RouterOS REST API Testing in CI
Run RouterOS CHR as a CI test fixture to validate REST API calls, generate RAML schemas, and test /app YAML configurations without manual router setup.
Development and Learning Environment
Boot a free-license CHR instance to explore RouterOS features, test firewall rules, experiment with bridging, and learn networking concepts without production hardware.
Multi-Architecture Testing
Test RouterOS configurations across both x86_64 and aarch64 architectures using QEMU with appropriate firmware (SeaBIOS for x86, UEFI for ARM) and acceleration options.
Try These Prompts
Help me set up RouterOS CHR in QEMU. I need to download the latest stable image and boot it with KVM acceleration and port 9180 for the REST API.
Write a GitHub Actions workflow that downloads RouterOS CHR, boots it with KVM if available (falls back to TCG), waits for boot, then runs REST API tests.
Configure QEMU to boot RouterOS CHR aarch64 on macOS Apple Silicon. Include the UEFI pflash setup and explicit virtio-blk-pci device configuration.
RouterOS CHR fails to boot with a blank screen. The disk image uses if=virtio on aarch64. What might be wrong and how do I fix it?
Best Practices
- Use explicit -device virtio-blk-pci instead of if=virtio shorthand on aarch64 to avoid the MMIO trap that causes silent boot failures
- Check /dev/kvm writability (not just existence) before enabling KVM, and always fall back to TCG gracefully in case KVM is unavailable
- Use port forwarding patterns like tcp::9180-:80 instead of hardcoding localhost IPs to make the configuration portable and reusable
Avoid
- Do not use if=virtio on aarch64 architecture - this resolves to MMIO which RouterOS does not support, causing silent boot failures
- Do not skip the KVM permission check - /dev/kvm may exist but be unreadable, and QEMU does not silently fall back to TCG on permission errors
- Do not use git pull && git push in concurrent CI builds - use the retry-with-rebase pattern to avoid push rejections from race conditions