How to Install MikroTik CHR on VirtualBox for Practice

Aisyah Aldina

Illustration of an open box for a guide on how to install MikroTik CHR on VirtualBox

Hi everyone, in this post I want to show you how to install MikroTik CHR on VirtualBox so you can practice. This article kicks off the MikroTik with Winbox learning series on Mamang Digital, so every hands on exercise in the next articles will use the lab we build here. You do not need to buy a MikroTik router first, a laptop or PC with VirtualBox installed is enough.

CHR (Cloud Hosted Router) is the official virtual machine version of RouterOS made by MikroTik. It runs the same real RouterOS you find on a RouterBOARD, so the Winbox menus, terminal commands, firewall, queues, and even VPN can all be practiced as they are. If you have learned networking before through a simulator, for example with router and switch configuration in Cisco Packet Tracer, CHR will feel familiar, except that what runs here is a real router operating system.

In this article I tested everything directly with RouterOS 7.25.2 (Stable channel) and VirtualBox 7. We will create a VM with two network adapters, one for the internet connection and one for the Winbox connection from your laptop, then test it until the router can ping the internet.

Note: CHR uses the Free license by default. According to the official MikroTik documentation, the Free license can be used with no time limit and has an upload limit of 1 Mbps per interface. This limit does not get in the way of configuration practice, only speed test results will look small.

Preparation Before Installing MikroTik CHR

Get VirtualBox 7 installed, an internet connection, and about 512 MB of free RAM for the CHR VM. The MikroTik documentation says RouterOS 7 on VirtualBox needs at least 512 MB of RAM, so that is the number I use.

Download the MikroTik CHR VDI file

The MikroTik download page with the CHR tab, Stable channel 7.25.2, and the VDI link for VirtualBox

Open the mikrotik.com/download page, then click the CHR tab. Choose the Stable channel, make sure the version shown is the latest one (here it is 7.25.2), then click VDI in the Install Images section. VDI is the native VirtualBox disk format, so there is no need to convert it.

The download is a zip file named chr-7.25.2.vdi.zip. Extract it to a folder that is easy to find, any folder name works. On my computer the extracted file is chr-7.25.2.vdi and it is about 52 MB.

Warning: Do not use the ISO from the RouterOS tab (mikrotik-7.25.2.iso). That ISO is for installing on a physical x86 PC and uses a different license. MikroTik does not provide an ISO for CHR, instead you use a disk image such as VDI, VMDK, VHDX, or OVA.

Creating the MikroTik CHR VM in VirtualBox

Open File and then Preferences

The File menu and Preferences in VirtualBox Manager

Open VirtualBox, click the File menu and choose Preferences. This step turns on Expert mode, because the network adapter type option we need later only shows up in Expert mode.

Choose the Expert tab and click OK

The Expert tab in the VirtualBox Preferences window, then click OK

Click the Expert tab in the top left corner, then click OK. The VM creation wizard will also change into a single, more compact page.

Click New

The New button in VirtualBox Manager to create the MikroTik CHR VM

Back in VirtualBox Manager, click the New button to create a new virtual machine.

Fill in the VM name and OS type

Filling in the VM Name MikroTik CHR with OS Other and OS Version Other Unknown 64-bit

Fill in VM Name with MikroTik CHR or any other name you like. Leave the ISO Image field empty. For OS choose Other, then for OS Version choose Other/Unknown (64-bit) because CHR is a 64 bit system.

Set the RAM to 512 MB

Base Memory 512 MB and 1 CPU in the Specify virtual hardware section

Open the Specify virtual hardware section, then change Base Memory to 512 MB. One CPU in Number of CPUs is enough, and you do not need to tick Use EFI.

Choose Use an Existing Virtual Hard Disk File

Choosing Use an Existing Virtual Hard Disk File and clicking the folder icon

Open the Specify virtual hard disk section, choose Use an Existing Virtual Hard Disk File, then click the small folder icon on the right. We do not create a new disk because RouterOS is already installed inside the VDI file we downloaded earlier.

Click Add in the Hard Disk Selector

The Add button in the VirtualBox Hard Disk Selector window

A Hard Disk Selector window will appear with a list of existing VM disks. Click Add in the top left corner.

Choose the chr-7.25.2.vdi file

Choosing the extracted chr-7.25.2.vdi file and clicking Open

Go to the folder where you extracted the file, choose chr-7.25.2.vdi, then click Open.

Select the CHR disk and click Choose

The chr-7.25.2.vdi file listed under Not Attached, then click Choose

The chr-7.25.2.vdi file shows up in the Not Attached group with a virtual size of 128 MB. Click the file, then click Choose in the bottom right corner.

Click Finish

The 128 MB chr-7.25.2.vdi disk selected, then click Finish

Make sure the field under Use an Existing Virtual Hard Disk File now shows chr-7.25.2.vdi (Normal, 128,00 MB), then click Finish. The MikroTik CHR VM will appear in the VirtualBox Manager list.

Setting Up the Network Adapters

This is the part other tutorials most often skip. We need two adapters. Adapter 1 in NAT mode becomes ether1 and acts like the cable from your ISP, so the router can reach the internet. Adapter 2 in Host-only mode becomes ether2, which is the link between the router and your laptop for logging in with Winbox in the next article.

Select the VM and click Settings

Selecting the MikroTik CHR VM and clicking Settings in VirtualBox Manager

Click the MikroTik CHR VM in the list on the left, then click Settings.

Change the Adapter Type to virtio-net

Adapter 1 NAT with the Adapter Type option Paravirtualized Network virtio-net

Click Network in the left menu, make sure you are on the Adapter 1 tab and Attached to is set to NAT. Click the Adapter Type option, then choose Paravirtualized Network (virtio-net). The MikroTik documentation says virtio gives the best performance in VirtualBox.

Make sure Adapter 1 is NAT and virtio-net

MikroTik CHR Adapter 1 using NAT and Paravirtualized Network virtio-net

Adapter 1 now uses NAT with the Adapter Type Paravirtualized Network (virtio-net).

Enable Adapter 2 as a Host-only Adapter

Adapter 2 enabled as a Host-only Adapter with the virtio-net type, then click OK

Click the Adapter 2 tab, tick Enable Network Adapter, then change Attached to to Host-only Adapter. The Name field is filled in automatically with VirtualBox Host-Only Ethernet Adapter. Also change the Adapter Type to Paravirtualized Network (virtio-net), then click OK.

My experience: When I first created the VM, VirtualBox automatically set the Adapter Type to PCnet-FAST III. That type is not on the list of adapters supported in the CHR documentation, which mentions E1000, RTL8139, and virtio. So do not forget to change it, especially since this option is not even visible in Basic mode.

Starting and Logging In to MikroTik CHR

Click Start

The MikroTik CHR VM ready to run with the Start button

In VirtualBox Manager you can see the MikroTik CHR VM with the chr-7.25.2.vdi disk and two Paravirtualized Network adapters. Click Start to power on the router.

Wait until CHR Login appears

MikroTik 7.25.2 with the CHR Login prompt after the VM boots

Within a few seconds the VM window shows MikroTik 7.25.2 and CHR Login. Click inside the VM window so the keyboard is captured by the VM.

Log in as admin with no password

Logging in to MikroTik CHR with the admin user and an empty password

Type admin and press Enter. When asked for the Password, just press Enter because the default CHR password is still empty.

Answer the software license question

The Do you want to see the software license question at first login

The MikroTik logo appears along with the question Do you want to see the software license. Type n and press Enter if you do not want to read the license.

Create a new password

RouterOS 7 asking for a new password at first login

RouterOS 7 immediately asks for a new password with the text Change your password. Type a new password, press Enter, then type it again at repeat new password. The characters you type are not shown and only appear as asterisks. Write this password down because you will use it to log in with Winbox.

Login successful

The Password changed message and the admin@CHR prompt showing a successful login

The message Password changed and the prompt [admin@CHR] > appear, which means we are now inside the RouterOS terminal.

Testing MikroTik CHR

Check the ethernet interfaces

The interface ethernet print command showing ether1 and ether2 as running
/interface ethernet print

You can see there are two interfaces, ether1 and ether2, both with the R flag, which means running. ether1 is Adapter 1 (NAT) and ether2 is Adapter 2 (Host-only), the order follows the adapter numbers in VirtualBox.

Check the DHCP client on ether1

The DHCP client on ether1 with the status bound and IP 10.0.2.15
/ip dhcp-client print

On the CHR 7.25.2 I used, ether1 already had a DHCP client from the very first boot, with the status bound and the address 10.0.2.15/24 from VirtualBox NAT. If the list is empty on your version, add a DHCP client manually.

/ip dhcp-client add interface=ether1

Check the IP address

The ip address print command showing the dynamic IP 10.0.2.15 on ether1
/ip address print

The IP 10.0.2.15/24 shows up with the D (dynamic) flag on ether1, which means the IP was obtained automatically from DHCP.

Ping the internet

A successful ping to 8.8.8.8 from MikroTik CHR with 0 percent packet loss
/ping 8.8.8.8 count=4

The result is sent=4 received=4 packet-loss=0%, which means MikroTik CHR can now reach the internet through ether1.

Check the CHR license

The system license print command showing the free level on MikroTik CHR
/system license print

The level free means CHR is running with the free license. For learning configuration, this license is all you need.

Common Problems and How to Fix Them

The VM shows No bootable medium found

This usually happens because the VM was created with the Create a New Virtual Hard Disk option, so what is attached is an empty disk instead of the CHR file. On my first attempt I used Basic mode, and the wizard went straight to creating an empty 2 GB disk without offering the option to use an existing one, which is why I turn on Expert mode right from the start. Open Settings, then Storage, and replace the disk on IDE Primary Device 0 with chr-7.25.2.vdi.

ether1 does not get an IP and ping fails

Make sure Adapter 1 is in NAT mode and Virtual Cable Connected is ticked. Also check the output of /ip dhcp-client print. If it is empty, add a DHCP client on ether1 with the command above, then wait a few seconds until the status is bound.

An error appears when choosing the disk file

A message like Cannot register the hard disk because of a duplicate UUID appears if the same VDI file has already been registered to another VM. Delete the old VM or extract the zip file again into a different folder, then choose that new file.

Keyboard and mouse are stuck inside the VM

Press the right Ctrl key (the VirtualBox Host key) to release the keyboard and mouse from the VM window.

Forgot the admin password

Since this is a lab, the quickest way is to shut down the VM, replace the disk with a freshly extracted chr-7.25.2.vdi from the zip, then log in again as admin with no password.

That is it, MikroTik CHR is now running on VirtualBox, it can reach the internet through ether1, and ether2 is ready to be used for Winbox. In the next article we will download Winbox and connect it to this router. If you run into a different error during the install, just leave it in the comments below.

Leave a Comment