Cristian Livadaru's Blog

Cristian Livadaru's Blog

My personal view on things




Install Mikrotik CHR on a XEN dom0

If you want to play around with mikrotik or a need a mikrotik CHR, you can install it on XEN and run it without any issues.

Cristian LivadaruCristian Livadaru

Download CHR

Download the mikrotik CHR raw image and unzip it

wget ''

create the LVM

Craete a new LVM and copy the data from the image

lvcreate -L 1G -n chr vg0
dd if=chr-6.43.2.img of=/dev/vg0/

Create XEN configuration

Craete a file /etc/xen/chr.cfg with the xen config

builder = 'hvm'
name = 'chr'
memory = 512
maxmem = 512
vcpus = 1
pae = 1
acpi = 1
viridian = 0
apic = 1
device_model = '/bin/true'
boot = 'cd'
sdl = 0
usb = 1
usbdevice = 'tablet'
vnc = 1
vnclisten = ''
serial = 'pty'
vif = [ 'type=ioemu, bridge=xenbr0, ip=, mac=some:mac:address:here']
disk = [ 'phy:/dev/vg0/chr,hda,w']
on_poweroff = 'preserve'
on_reboot = 'restart'
on_crash = 'restart'

replace the ip and mac address, you can use this Random MAC Address Generator to generate a new random MAC Address for the vm.

Start it

now you can start the mikrotik CHR and connect to it via VNC

xl craete /etc/xen/chr.cfg


XEN script is based on this post on the mikrotik forum from maznu