CHR: Installing on Hyper-V
CHR: Installing on Hyper-V
Section titled “CHR: Installing on Hyper-V”This guide covers deploying RouterOS Cloud Hosted Router (CHR) on Microsoft Hyper-V using the VHDX disk image. CHR is supported on Windows Server 2008 R2, 2012, 2019, and Windows 10/11 Hyper-V.
CHR on Hyper-V supports Generation 1 VMs only. Generation 2 VMs use UEFI secure boot and a different virtual hardware model that is not compatible with CHR.
Prerequisites
Section titled “Prerequisites”- Windows Server with Hyper-V role installed, or Windows 10/11 Pro/Enterprise with Hyper-V feature enabled
- At least 256MB RAM and 128MB disk space available
- VHDX disk image downloaded from MikroTik
Enable Hyper-V (Windows 10/11)
Section titled “Enable Hyper-V (Windows 10/11)”If Hyper-V is not yet enabled:
- Open Control Panel → Programs → Turn Windows features on or off
- Check Hyper-V (both Management Tools and Platform)
- Click OK and restart when prompted
Or enable via PowerShell:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -AllRestart-ComputerDownload the CHR Image
Section titled “Download the CHR Image”- Visit the MikroTik download page
- Select the Cloud Hosted Router section
- Download the Hyper-V disk image (
.vhdxfile)
Create the Virtual Machine
Section titled “Create the Virtual Machine”Using Hyper-V Manager (GUI)
Section titled “Using Hyper-V Manager (GUI)”- Open Hyper-V Manager
- In the Actions panel, click New → Virtual Machine
- Click Next to begin the wizard
Specify Name and Location:
- Enter a name (e.g.,
CHR) - Click Next
Specify Generation:
- Select Generation 1 ← Required for CHR
- Click Next
Assign Memory:
- Set Startup memory to at least
1024 MB - Uncheck Use Dynamic Memory for predictable performance
- Click Next
Configure Networking:
- Select your virtual switch from the dropdown
- Click Next
Connect Virtual Hard Disk:
- Select Use an existing virtual hard disk
- Browse to the downloaded
.vhdxfile - Click Next → Finish
Using PowerShell
Section titled “Using PowerShell”# Variables$VMName = "CHR"$VHDXPath = "C:\Hyper-V\VHDs\chr-7.x.vhdx"$SwitchName = "Default Switch"
# Create the VM (Generation 1)New-VM -Name $VMName ` -MemoryStartupBytes 1GB ` -Generation 1 ` -VHDPath $VHDXPath ` -SwitchName $SwitchName
# Set vCPU countSet-VMProcessor -VMName $VMName -Count 2
# Disable dynamic memory for stabilitySet-VMMemory -VMName $VMName -DynamicMemoryEnabled $false
# Start the VMStart-VM -Name $VMNameNetwork Adapter Configuration
Section titled “Network Adapter Configuration”Hyper-V offers two NIC types for CHR:
| Adapter Type | Performance | Notes |
|---|---|---|
| Network Adapter | Better | Synthetic; requires integration services |
| Legacy Network Adapter | Lower | Emulated; works without integration services |
CHR works with both adapter types. The Network Adapter (synthetic) is preferred for performance. If CHR does not detect interfaces at boot, try switching to Legacy Network Adapter.
The system disk must use the IDE controller. SCSI is supported only for secondary/data disks in Generation 1 VMs.
Adding Multiple NICs (PowerShell)
Section titled “Adding Multiple NICs (PowerShell)”# Add a second network adapterAdd-VMNetworkAdapter -VMName "CHR" -SwitchName "Internal Switch"
# Add a legacy network adapter if neededAdd-VMNetworkAdapter -VMName "CHR" -SwitchName "External Switch" -IsLegacy $trueInitial Login and Configuration
Section titled “Initial Login and Configuration”Open the VM console in Hyper-V Manager (Connect) and log in:
Username: adminPassword: (empty — press Enter)Perform initial setup:
# Set admin password/user set admin password=StrongPassword123!
# Verify interfaces/interface print
# Assign IP address/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
# Configure DNS/ip dns set servers=1.1.1.1,8.8.8.8
# Enable SSH/ip service enable sshVLAN Configuration
Section titled “VLAN Configuration”For VLAN-tagged traffic on Hyper-V, you must enable trunk mode on the virtual switch port via PowerShell. Hyper-V Manager GUI does not expose all VLAN trunking options.
Enable VLAN Trunking on a NIC
Section titled “Enable VLAN Trunking on a NIC”# Allow all VLANs on the adapter (trunk mode)Set-VMNetworkAdapterVlan -VMName "CHR" ` -VMNetworkAdapterName "Network Adapter" ` -Trunk ` -AllowedVlanIdList "1-4094" ` -NativeVlanId 1Inside RouterOS, configure VLAN filtering:
/interface bridge add name=br-trunk vlan-filtering=yes/interface bridge port add bridge=br-trunk interface=ether1/interface bridge vlan add bridge=br-trunk vlan-ids=10 tagged=br-trunk,ether1/interface bridge vlan add bridge=br-trunk vlan-ids=20 tagged=br-trunk,ether1Access Port (Single VLAN)
Section titled “Access Port (Single VLAN)”# Set a specific access VLAN on the adapterSet-VMNetworkAdapterVlan -VMName "CHR" ` -VMNetworkAdapterName "Network Adapter" ` -Access ` -VlanId 10Cloning and Snapshots
Section titled “Cloning and Snapshots”CHR can be cloned from a snapshot or exported/imported. After cloning, generate a new system ID before requesting a license:
/system license generate-new-idClones are aware of any previous trial period on the original. You cannot extend trial time through cloning. Always generate a new ID on cloned instances before licensing.
Troubleshooting
Section titled “Troubleshooting”CHR Does Not Detect Network Interfaces
Section titled “CHR Does Not Detect Network Interfaces”If CHR boots but shows no interfaces:
- Verify the VM is Generation 1
- In Hyper-V Manager, stop the VM
- Remove the Network Adapter and add a Legacy Network Adapter instead
- Restart the VM
VM Fails to Boot from VHDX
Section titled “VM Fails to Boot from VHDX”Ensure the VHDX is attached to an IDE controller in the VM settings:
- In Hyper-V Manager, right-click the VM and select Settings
- Under IDE Controller 0, verify the VHDX is attached
- If attached under SCSI, move it to IDE Controller 0
Poor Network Performance
Section titled “Poor Network Performance”Switch from Legacy Network Adapter to synthetic Network Adapter and ensure the virtual switch has appropriate bandwidth limits removed.