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.
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.
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.
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.
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?
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
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…