Docker vs Virtualbox

Hello everybody,

I am using openHAB1 since 2015 on a dedicated PC on top of Ubuntu 14.04 Server edition. The bindings I use are:

  • mqtt
  • pushover
  • astro
  • networkhealth
  • weather
  • persistence

I use the “executeCommandLine” function a lot in my rules.

I’d like to migrate to openHAB2 and virtualize the installation while I’m on it… I see a lot of comments about Docker but I am much more familiar with Virtualbox. The PC running the Virtualbox host would be powerful enough to handle the overhead.

Is it a bad idea to install openhab2 in a Virtualbox guest (the guest OS would be Ubuntu 16.04 Server edition)?? I am asking because it doesn’t look like a popular setup here.

Thanks for any help!

I had it running on Hyper-V for about 6 months. Only moved off it as I wanted native USB support (for a zwave controller).

I don’t see why it’d be a bad idea.

Docker != virtualization

Comparing Docker to Virtualbox is an apples to oranges comparison.

And since you use executeCommandLine a lot you have already been forced down the path of Virtualization rather than containerization so choose Virtualbox.

If you can make it so Virtualbox will start the VM as a service I see no reason why it would be a bad idea. It isn’t mentioned much around here as most who decide to virtualize it go all the way and install ESXi or Xen as the host OS.

Docker is great to get most of the isolation you get from virtualization and is in fact how I run my OH; a VM running Ubuntu Server running on ESXi 6.5 with OH running in Docker,. As you can see, it isn’t an either or situation. But the Docker images tend to be vastly stripped down bare bones operating systems so common commands and utilities simply won’t be available (e.g. you won’t have ping let alone python) and the networking can be isolated pretty thoroughly as well so that features like the Network binding’s dhcplisten feature won’t work. Thus executeCommandLine and Exec binding become almost useless. I get around this by setting up a python script that I already have running on some RPis for remote sensors that can receive an MQTT command and execute stuff for me.

As for your bindings:

  • mqtt will still work and be configured like you are used to
  • I don’t know much about pushover
  • astro is vastly different but still provides all the functionality you are use to
  • networkhealth is replaced with the Network binding which has a lot more capabilities, though some of those require running OH as root
  • people have no end of trouble with the Weather binding, I’ve personally switched to HTTP binding and parse out the info I need from wunderground’s API
  • which persistence? Regardless it should work the same unless you are using db4o in which case you will need to switch to something else

Be sure to follow the Migration Tutorial. It will get you setup with your current bindings and configs running on OH 2 and then provide advice for how to move those bindings you want and can to the 2.0 versions and take advantage of the new features of OH 2 in the process.

1 Like

If you are interested in BSD, OH2 works well in FreeBSD jail.

I’ve gone down the Virtual Box path running a Ubuntu 1604 host and installing Openhabian Debian version as my OpenHAB guest.

If you want to run it headless, be sure to check out phpvirtualbox.

Having the ability to snapshot the VM before applying updates has saved me from disaster once already. Best to shutdown the VM before snap shoting.

Running Aeon Labs Z Stick Gen 5 via USB works fine once configured in the VM settings correctly.

Binding used so far:

Phillips Hue

Hope this helps.

Thank you all for your great answers! I will move a Virtualbox environment then.

On a general note: if a post was helpful or provided a solution, please mark it as such. Thanks.