Skip to content

CHR: Installing on KVM

This guide covers deploying RouterOS Cloud Hosted Router (CHR) on KVM/QEMU using the RAW disk image. KVM is the recommended hypervisor for Linux hosts and provides the best performance via Virtio paravirtualized drivers.

  • Linux host with KVM support (grep -E 'vmx|svm' /proc/cpuinfo must return output)
  • qemu-kvm, libvirt, and virt-manager or virsh installed
  • At least 256MB RAM and 128MB disk available for the CHR VM
  • Root or libvirt group membership
  1. Visit the MikroTik download page
  2. Select the Cloud Hosted Router section
  3. Download the RAW disk image (.img file) for your desired RouterOS version
Terminal window
# Example: download and decompress CHR image
wget https://download.mikrotik.com/routeros/7.x/chr-7.x.img.zip
unzip chr-7.x.img.zip

Move the image to a libvirt storage pool:

Terminal window
sudo mv chr-7.x.img /var/lib/libvirt/images/chr.img
Terminal window
sudo virt-install \
--name chr \
--memory 1024 \
--vcpus 2 \
--disk /var/lib/libvirt/images/chr.img,format=raw,bus=virtio \
--network network=default,model=virtio \
--os-variant linux2022 \
--import \
--noautoconsole

Key parameters:

ParameterValueReason
--disk bus=virtiovirtioBest performance; CHR supports Virtio disk
--network model=virtiovirtioBest performance; enables Fast Path in v7
--importUses existing disk image, no ISO installer
--os-variant linux2022linuxClosest match for CHR guest type
  1. Open Virtual Machine Manager
  2. Click File → New Virtual Machine
  3. Select Import existing disk image
  4. Browse to the .img file
  5. Set OS type to Generic Linux
  6. Allocate RAM (1024MB recommended) and CPU count
  7. Before finishing, check Customize configuration before install
  8. In NIC settings, change model to virtio
  9. In Disk settings, verify bus is VirtIO
  10. Click Begin Installation

For multiple network interfaces, add additional NICs using virsh after VM creation:

Terminal window
# Add a second virtio NIC to the default network
sudo virsh attach-interface chr --type network --source default \
--model virtio --config --live

Inside RouterOS, interfaces appear as etherN in order of MAC address:

/interface print

Connect to the VM console:

Terminal window
sudo virsh console chr

Log in with the default credentials:

Username: admin
Password: (empty — press Enter)

Perform initial configuration:

# Set admin password
/user set admin password=StrongPassword123!
# Assign IP address to first interface
/ip address add address=192.168.88.1/24 interface=ether1
# Add default route
/ip route add dst-address=0.0.0.0/0 gateway=192.168.88.254
# Set DNS servers
/ip dns set servers=1.1.1.1,8.8.8.8
# Enable SSH
/ip service enable ssh

CHR supports the QEMU guest agent for host-guest integration on KVM:

Terminal window
# Add virtio-serial device and guest agent channel when creating the VM
sudo virt-install \
--name chr \
--memory 1024 \
--vcpus 2 \
--disk /var/lib/libvirt/images/chr.img,format=raw,bus=virtio \
--network network=default,model=virtio \
--channel unix,target_type=virtio,name=org.qemu.guest_agent.0 \
--os-variant linux2022 \
--import \
--noautoconsole

With the guest agent active, the host can:

  • Execute scripts inside the guest: virsh qemu-agent-command chr '{"execute":"guest-exec",...}'
  • Transfer files: guest-file-open, guest-file-write, guest-file-close
  • Retrieve network interface info: guest-network-get-interfaces

For production deployments:

Terminal window
# Use multiple vCPUs for higher interface counts
# RAM formula: 256 + [8 × CPU_COUNT × (INTERFACE_COUNT - 1)] MB
# Example: 2 CPUs, 4 interfaces → 256 + [8 × 2 × 3] = 304MB minimum

If using Linux bridge (virbr0 or custom bridge), ensure VLAN pass-through is enabled:

Terminal window
# Disable IGMP snooping if IPv6 multicast issues occur
echo -n 0 > /sys/class/net/virbr0/bridge/multicast_snooping

In RouterOS, configure bridge VLAN filtering for trunk interfaces:

/interface bridge add name=br1 vlan-filtering=yes
/interface bridge port add bridge=br1 interface=ether1
/interface bridge vlan add bridge=br1 vlan-ids=10,20 tagged=br1,ether1

Verify KVM is available:

Terminal window
sudo kvm-ok
# Should output: KVM acceleration can be used

Check for CPU virtualization support:

Terminal window
grep -E 'vmx|svm' /proc/cpuinfo | head -1

Verify the libvirt default network is active:

Terminal window
sudo virsh net-list --all
sudo virsh net-start default
sudo virsh net-autostart default

Check interface driver inside RouterOS:

/interface ethernet print detail

If the driver shows e1000 instead of virtio, shut down the VM and change the NIC model in virt-manager or using virsh edit chr.