Community discussions

MikroTik App
 
Askey307
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 65
Joined: Fri Sep 29, 2017 10:20 am
Location: South Africa
Contact:

CHR/The Dude Server on Raspberry Pi 3B or 4

Sun Aug 23, 2020 7:07 pm

Hi Guys

Is it possible to run CHR on a Pi without having to install any OS like linux to run a VM?
The idea is the have a small foot print of a device in the office for our site monitoring with the Dude.
We're currently running it on an old DDR2 machine and the boss does not want to buy a router specifically for the dude and definitely not a pc.
We have bunch of Pi's laying around not being used.

Regards
 
Sob
Forum Guru
Forum Guru
Posts: 9188
Joined: Mon Apr 20, 2009 9:11 pm

Re: CHR/The Dude Server on Raspberry Pi 3B or 4

Sun Aug 23, 2020 8:17 pm

Hmm, can you run x86 virtual machine on bare metal ARM device? The answer won't surprise you - no.

Maybe it could be possible to run it under RasPi's Linux as VM using some emulator, but I don't know if anything ready to use exists. Even if it does, another problem could be speed.
 
Askey307
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 65
Joined: Fri Sep 29, 2017 10:20 am
Location: South Africa
Contact:

Re: CHR/The Dude Server on Raspberry Pi 3B or 4

Sat Oct 17, 2020 6:54 pm

Managed to get it to work on a RP 4 with Raspbian and VM. No issues yet. Works actually pretty well tbh. Just had heat issues at first but that's sorted.
 
Sob
Forum Guru
Forum Guru
Posts: 9188
Joined: Mon Apr 20, 2009 9:11 pm

Re: CHR/The Dude Server on Raspberry Pi 3B or 4

Sat Oct 17, 2020 8:15 pm

Interesting, could you share any more details? I don't mean step by step guide, although I suppose someone would appreciate that. Just some pointers for start, like what do you use? I most likely won't be trying it myself, I'm just curious. I keep finding some software named ExaGear, but it seems dead now. Then there's even ESXi for ARM that can run on RasPi (I didn't expect that), but doesn't support running x86 code. I guess QEMU should be able to do it, but I'd expect to find more info about that than I'm finding so far, which is none (well, I'm not trying too hard, but still..).
 
Askey307
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 65
Joined: Fri Sep 29, 2017 10:20 am
Location: South Africa
Contact:

Re: CHR/The Dude Server on Raspberry Pi 3B or 4

Thu Oct 22, 2020 9:12 pm

Interesting, could you share any more details? I don't mean step by step guide, although I suppose someone would appreciate that. Just some pointers for start, like what do you use? I most likely won't be trying it myself, I'm just curious. I keep finding some software named ExaGear, but it seems dead now. Then there's even ESXi for ARM that can run on RasPi (I didn't expect that), but doesn't support running x86 code. I guess QEMU should be able to do it, but I'd expect to find more info about that than I'm finding so far, which is none (well, I'm not trying too hard, but still..).
After a lot of playing I found a nice combo. I use Void Linux for Pi and Qemu. Both super low system requirements and works like a charm. If you know Debian based basics; you'll able to config no issues. Puppy Linux and Tiny Core also worked. Puppy was bit unstable so I couldn't trust it. Tiny for some reason froze from time to time. I run Void now stable for the past week. CHR really does not require much. I've even tested with my Pi 3B and it worked well. Memory was constantly between 450-600mb usage. Haven't seen once where it used more than 800 out of the 1GB available. So my Pi4 is a little bit overkill in this scenario as I only use the CHR for The Dude Server so nothing major at all. I'll be migrating it to the Pi3 permanently as it's more than enough for the job so I can use the Pi4 elsewhere.

I've seen Exagear pop up from time to time under my security labs etc. Haven't tried it.

A guide....Mmmm that might actually be a darn good idea. Once done, I'll link it under this post.
 
BitFaktur
just joined
Posts: 11
Joined: Thu May 11, 2017 4:51 pm

Re: CHR/The Dude Server on Raspberry Pi 3B or 4

Sat Dec 26, 2020 3:53 pm

After a lot of playing I found a nice combo. I use Void Linux for Pi and Qemu. Both super low system requirements and works like a charm.
Nice, could you post your kvm line your starting the vm with?

It should look something like this:
qemu-system-x86_64 -hda vm-chr-6.48-disk-1.qcow2 -m 512 
The VM starts on my machine but i can only access it trought MAC (Layer 2) and not its IP (Layer 3)
Do i need to specify network or forwarding parameters?

Thanks in advance!
 
jebz
Member
Member
Posts: 367
Joined: Sun May 01, 2011 12:03 pm
Location: Australia

Re: CHR/The Dude Server on Raspberry Pi 3B or 4

Sun Jan 31, 2021 10:45 am

After a lot of playing I found a nice combo. I use Void Linux for Pi and Qemu. Both super low system requirements and works like a charm. If you know Debian based basics; you'll able to config no issues. Puppy Linux and Tiny Core also worked. Puppy was bit unstable so I couldn't trust it. Tiny for some reason froze from time to time. I run Void now stable for the past week. CHR really does not require much. I've even tested with my Pi 3B and it worked well. Memory was constantly between 450-600mb usage. Haven't seen once where it used more than 800 out of the 1GB available. So my Pi4 is a little bit overkill in this scenario as I only use the CHR for The Dude Server so nothing major at all. I'll be migrating it to the Pi3 permanently as it's more than enough for the job so I can use the Pi4 elsewhere.

I've seen Exagear pop up from time to time under my security labs etc. Haven't tried it.

A guide....Mmmm that might actually be a darn good idea. Once done, I'll link it under this post.
Have you thought any more about contributing a guide on running CHR on a Raspberry Pi?
 
BitFaktur
just joined
Posts: 11
Joined: Thu May 11, 2017 4:51 pm

Re: CHR/The Dude Server on Raspberry Pi 3B or 4

Sun Jan 31, 2021 1:15 pm

2nd that and i am also still interested @Askey307
 
ssalonen
just joined
Posts: 6
Joined: Sun Mar 01, 2020 7:43 pm

Re: CHR/The Dude Server on Raspberry Pi 3B or 4

Thu Apr 08, 2021 10:57 pm

This is what worked for me, assuming we want to use eth0 interface of raspberry pi.

Install pre-requisites
apt-get install qemu-system-x86
Preparing tap interface for bridged networking for qemu
(from https://wiki.qemu.org/Documentation/Net ... s_on_Linux)

Setup bridge br0 and let it bridge over newly created tap interface and eth0.
modprobe tun tap                  # unnecessary if tun/tap is built-in
ip link add br0 type bridge
ip tuntap add dev tap0 mode tap
ip link set dev tap0 master br0   # set br0 as the target bridge for tap0
ip link set dev eth0 master br0   # set br0 as the target bridge for eth0
ip link set dev br0 up
 
# staitc ip for bridge
PREFIX=192.168.1.5/24
# gateway
ROUTE=192.168.1.11

ip address add $PREFIX dev br0
ip route add default via $ROUTE dev br0
Prepare and run qemu
1. Download CHR router raw disk image
wget https://download.mikrotik.com/routeros/6.48.6/chr-6.48.6.img.zip
2. Unzip
gunzip -c chr-*.img.zip > chr.img

3. Convert img to qcow:
qemu-img convert chr.img -O qcow2 chr.qcow2
3. Launch in x86_64 qemu:
sudo qemu-system-x86_64 -vnc :0 -nographic  -hda chr.qcow2 -nic tap
(open up vnc at port 1900 for remote display, listening to 127.0.0.1. Network is bridged with host)

I find this quite convenient way to remotely utilize CHR's built-in mac-telnet tool. It was my saviour since I had raspberry pi in the same L2 network....

Who is online

Users browsing this forum: No registered users and 2 guests