Openhab in Container or in VM?

Hi, is there a list of things, which i can’t do, when i install openhab in a Container? Maybe installing in a VM would be the bettet way?

What about:

  • Execute Linux scripts (bash) like restart, apt get Update/Upgrade, curl
  • use USB conneczed Devices like dongles, USB Readers,…

Can someone explain me, which things will not be able with openhab with a Container?

What container technology are you considering?

Nothing I assume, since you can expose whatever folder or file from the host inside the container, and Linux sees devices as files anyway……

I guess the biggest difference is the runtime environment. On a VM you are basically running openhab on its own PC. A container uses the ressources of the host.

From the perspective of connectivity, the network concetps of VMs and containers are very different. Containers are in isolated networks that usually are restricted in terms of ipv6 capability, exposed ports and broadcast/multicasts.

Nope, that should be possible. You could probably configure it to enable that but if this is a requirement you may as well run on a VM or on hard metal.

Yes, you can pass through serial devices into the container.

The biggest problem I’ve had is getting bluetooth available inside the container and eventually abandoned that using a Python script outside the container to handle those.

There are limitations. You have to pass devices a special way so the locks work. Also, you cannot pass a symbolic link into a container, only hard links.

A better question is why you want to head this direction. Do you have a specific problem you are trying to solve? Do you want to learn these technologies for their own sake?

VMs and containers are not equivalent and address different problems. I personally run openHAB in a Docker container on a VM. The VM solves some of my problems, Docker solves others. This isn’t an either/or proposition.

But if you don’t have a specific reason to use a VM or a container in the first place, you are adding complexity for no reason. Everything is a tradeoff.