Use a VM instead of a Raspberry Pi?

Again, rather off-topic thing, but I don't know where else to start asking about this.

Many smart home devices and projects out there these days are really just something running on a Raspberry Pi. The DIY crowd is of course really into these little boards and related kits. I admit I on occasion find a project interesting and worth a shot, but it seems it wouldn't be long before you have a room full of the individual little computers, taking up space and clogging up your network ports.

A solution to a newbie like me was to look into virtualization. I have managed to virtualize some things, like an instance of OpenHab, HomeAssistant, and OpenVPN, all running on the same older PC using VMWare Workstation. It seems like it's a much more viable option rather than buying another little RP every time I want to try something out. However, I'm a complete newbie at all of this, and often out of my depth.

A recent specific example concerns the SOMA Smart Blind tilters. They are all Bluetooth devices, which of course require a dedicated hub. However, the hub is little more than an older RP running a very specific image. I was about to update mine to the latest, etching it to the SD card, but the thought occurred to me: why not try creating a virtual hub in VMWare Workstation?

So I've tried, many times, and failed. The resulting VM simply doesn't boot up. I'm unable to determine if it's some boneheaded thing I'm doing with the VM setup, or if I'm trying to accomplish the impossible. I'm reading ARM architecture and x86 are so different, it may not be truly possible to run a VM of a machine meant to be an ARM device using x86 processors, but again, I'm out of my depth.

Has anyone had any luck virtualizing a lot of smart home devices normally intended to be a on a RP, specifically using VMWare? If my assumption on ARM/x86 architecture is correct, and it's not possible, I see there IS a way to run multiple VMs ON a Rasberry Pi, but I want to confirm this before I jump down that particular rabbit hole.

And yes, I'm thoroughly aware I am a moron likely playing with things I should not, but how else will I learn?

You are correct. An ARM image will not run on a different CPU architecture, like x86, even in a virtual machine. The compiled binary code executes CPU architecture specific commands.

There are emulators that allow this to be done. That is how people run Nintendo 64 games on their x86 PC, for example. This usually results in a massive performance penalty versus running on the native CPU architecture, though.

Perhaps this would help?

How to Emulate Raspberry Pi on Windows.

From the above link, this is interesting...

3 Likes

Thank you! That confirms my suspicions.

I may look into this:

I'm likely really jumping into the deep end here, but my latest RP purchase is a newer one and on the beefier side. It appears a solution to keeping from having piles of RPs all over is to run VMware ESXi to manage multiple virtual RPs on one device. Thoughts on that approach?

1 Like

Why not use Docker containers?

3 Likes

I use a dedicated proxmox computer for containers that I used to run raspberry pi software on. If it runs on a raspberry pi using the raspbian os it can run in a container. There's a bunch of turnkey containers for proxmox as well that make it easy to get up and running.

I'm not familiar with Proxmox. Doing a cursory search, it appears it's a virtualization platform, but I don't see any specific hardware chipset required. If you ran it on a non-ARM chipset, can it still run raspberry pi software?

I see several mentions of Rasbian, and I believe I've even managed to get a VM running it on my PC via VMWare. However, I still couldn't get it to run the software for the Soma Connect hub (honestly not sure how to go about it). The specific hub software I'm referring to can be found here:

The instructions made it seem as though it's an all-in-one image, but I'm unsure of how to install it as a VM, or even if it's possible given the machine's chipset architecture.

I would focus on the software that you want to run instead of the underlying OS that it is popularly packaged on. Home assistant, openhab, and almost everything else have builds for x86. Just use those instead of a pre-built raspberry pi images.

I'm a big fan of docker containers for such things. The one thing you have to watch out for is when your software needs dedicated hardware like a Z-Wave, or zigbee antenna. Getting containerized or virtualized software to talk to extra hardware can be done it's just more complicated. That's when dedicated hardware is nice.

4 Likes

Proxmox is pretty easy to set up, its pretty much an OS with a web interface. It runs on any regular PC, you can designate hardware resources to containers/VMs for things like Zwave/zigbee sticks. I run a Windows VM with the Intel GFX passed through and a hard drive passed through for Blue Iris. I also run Debian, Ubuntu Containers. The containers/VMs are all accessible though the web interface. There are a bunch of guides online on how to pass hardware through to containers and VMs. It is also really easy to back up containers and VMs from Proxmox.
Quite a few people like Docker and probably can speak to it better than I can, I just found it to be very limiting and easier to read guides to set up containers.

Proxmox can also do arm emulation (well, the qemu underpinnings can), but the performance sucks.

Even on some pretty beefy hardware I found the performance to be unacceptable for anything other than programming and code check out.

Much better to run arm on arm and x86 on x86.

I use lxc, docker containers, and VMs fairly fluidly depending on what I'm trying to do, what is easiest to deploy, and whether I need High availability/failover.

I use a lot of VMware and hyper-v at work, but won't run anything other than proxmox at home.

1 Like

So lets first clarify how cpu architecture impacts virtualization. To put it simply the architecture impacts how the cpu does work. A Arm CPU vs a risc cpu vs a x86 cpu have different registers and ways of doing certain math. They are optimized in certain ways to handle different types of general purpose tasks that effect performance and energy efficiency for different types of work loads. Generally speaking ARM CPU's are much more power efficient then X86, but just don't give you the overall umph of a x86 or RISC cpu. But they vary so much in how they get work done you just can't go from one to the other.

Even on a given architecture you generally can't take a VM from one system to another by different manufactures without some potential issues. Even with VMware you can have issues going from x86 Intel to x86 AMD. VMWare tends to emulate components other then the CPU. In many cases to maximize performance it does a kind of passthrough of many of the CPU's specific features to the underlying VM's. So it is kind of a halfway emulation.

Now there are also very big differences between Virtualization and Containers. Virtualization is thick and will allow you to provide a whole new OS to ensure compatibility with the underlying software. A container uses the OS of the host and then downloads and runs the just the software components needed for that software to run. It wraps the components in a security layer to isolate them from the host. Both of them depend on the software being written to run on the appropriate architecture. It may be possible to run ARM on x86 with something that emulates the architecture, but it is likely to really have significant performance issues.

You can run VMware on arm by looking up the VMware ESXi Fling at VMware. There is a good tutorial out there on getting it loaded. I have it on two Raspberry Pi's to play with. As Jason just posted it really is about the right type of emulation for the job.

My suggestion is as follows. First look at what they are providing. They should mention what the architecture it is they have written it for. Allot of times you will see multiple images/ISO's/OVAs that list what CPU they are intended for. Install it on the write system based on what they suggest. This means a X86 if that install media is available, or arm type system if that is what they have available only. You also have to consider the install method. At this point VMware gives you the ability to install from a ISO image as install media, or a prebulit VMDK. You may not be able to take a image for a Raspberry pi and drop it in VMware and just boot from it. Once the image is built correctly boot from it and configure the app.

I use a home server OS called Unraid. It is basically a Home NAS solution that also includes Virtualization management and Docker containers. The way i try to install in my setup is

  1. If available first load the software needed in Docker(container) under Unraid
  2. Run Virtual machine under Unraid if i can't run it in a docker, or the docker has limitations that i can get passed with running a VM
  3. Pi if the CPU architecture is a limit or i want something super power efficient.

Don't forget the ARM CPU's on newer Raspberry Pi's or other Arm systems are pretty powerful compared to some older not top end x86 cpu's of the not so distant past. It is very possible to out perform and 6-10 year old cpu on the lower end with a raspberry pi 4. Then you stack ontop of that it is possible to virtualize a Raspberry pi with VMware ESXi with fling, or Docker, and it really is a power platform for it to use.

That said it looks like the folks at SOMA only gave you a Raspberry pi image option. You may be able to convert that image to a VMDK for the VMware Fling, but if not you may need to just run it on a dedicated Pi. Don't forget you need to worry about the connectivity once you get the software running. It is very possible you get the image running, but then can't get it to connect to the Bluetooth module for other reasons..

I hope this all helped. I kind of rambled a bit

2 Likes

If you want this to run under VMware you you will need to convert the provided IMG file to a VMDK. I believe there are tools to do this, but you would need to look up the process. I believe it involves coping the file to the VMware ESXi Host, Logging into the ESXi host with SSH, and then running a VMware tools command to convert it. It will still be a crapshoot as to if it will actually work.

I should also point out this is with the VMware ESXi fling on ARM so you would to load vmware on a pi.