Should You Run Your Home Automation Server in a Virtual Machine?

Thumbnail image of Jason Bauer
Jason Bauer
November 30, 2022 (Last Updated: ) | Reading Time: 9 minutes

Virtual machines are a powerful addition to any home automation server. Being able to run any operating system as a container on your host server solves many problems for home automation.

You can run your home automation server in a virtual machine if you want.
You can run your home automation server in a virtual machine if you want.

For instance, if you run a Linux home automation server, but you really want to run a piece of Windows software that does not have a Linux version, then a VM may be your solution. You can easily virtualize Windows and run that software in a Windows VM on your Linux server. Some problems are easier to solve by simply running it in a VM. This is especially true if you are running a Linux server and want to run a Windows application.

Take that concept far enough, and you might start to wonder if you should virtualize your entire home automation server. It's an interesting concept, and one that we should definitely think about before setting up a new home automation server. After all, if virtualization is the future, then we should be thinking about how to use it to our advantage.

Virtualization vs Bare-Metal Servers

The opposite of a virtualized installation is frequently called a bare-metal installation. The term bare-metal implies that the operating system is running directly on the hardware, without any virtualization software in the way.

Bare-metal installations have the advantage of being able to directly control the hardware that they are running on. This can be important for IO devices, RAID controllers, and graphics cards. It can also be important for performance, as virtualization software can add a small amount of overhead to the system. A bare-metal installation of an operating system has the most direct access to the hardware, and therefore the best performance.

Virtualized operating systems only have access to the hardware that is passed through to them by the host operating system. This is excellent for fine-grained control of your hardware, but it can be a challenge with some devices.

Before you can decide if you should virtualize your home server installation, you need to decide which server software you want to run for your home server. Be sure to read Unraid vs Proxmox vs Ubuntu - Which Server Software is Best for You before you decide which server software to use.

VMs Have Layered Access to Your Storage Devices

When designing your VM vs Bare-Metal server strategy, keep in mind that most (if not all) of your disk storage is accessible on the host operating system. Any hard disks plugged in to your server will show up in your host operating system. This means that sharing those storage devices with your network is the easiest through your host operating system.

For instance, if you are running a VM as a file sharing server, then you will need to share those storage devices through the VM, which can be a bit more complicated, and adds a layer of software.

If your server's primary function is a NAS or other type of file sharing, then virtualizing your server's installation is probably not the best idea. You will need to share your storage devices through the VM, which can be a bit more complicated, and adds a layer of software.

This is the way that Proxmox works by default. There are no file shares on the Proxmox host, but you can share storage devices through the VMs, and then share those files on your network from inside the VM.

Should You Run Unraid in a Virtual Machine?

If you have decided that Unraid is the home server software that you are going to use, then you might be wondering if you should install it in a virtual machine.

Unless you have a compelling reason otherwise, you should not install Unraid in a VM as your primary home automation server. Unraid is a bare-metal server operating system, and it is designed to run directly on the hardware. It is not designed to run in a VM.

You can test Unraid in a VM, but you will have to pass all of your storage through to the VM, and you will not be able to use the Unraid software to manage your storage. You will have to use the VM software to manage your storage. This makes using Unraid almost pointless.

Unraid makes an excellent Docker and virtualization host, and should be installed bare-metal on your server hardware.

Should You Run Proxmox in a Virtual Machine?

You should definitely not run Proxmox in a virtual machine. Proxmox is designed to be bare-metal installed. It is an excellent hypervisor that can host all of your other VMs, though. Like Unraid above, you can run Proxmox in a virtual machine, but there are few compelling reasons to do so.

Proxmox offers a backup server called Proxmox Backup Server or simply PBS that works exceptionally well in a VM on your host.

When you run Proxmox for your home automation server, you will need to provide at least one virtual machine to host your Dockers and your file shares. I recommend Ubuntu Server for both your Docker host and your file sharing host.

Remember that when you host your file sharing server in a virtual machine, you have to pass all of your storage through to your VM. This extra layer of file systems can slow down your file sharing performance.

Should You Run Ubuntu in a Virtual Machine?

There are many reasons that you might want to virtualize Ubuntu as a home automation server. No matter which bare-metal server operating system you choose, you can run Ubuntu in a virtual machine on top of it.

In fact, you can even run Ubuntu in a VM on top of Ubuntu. This is actually a good idea if you choose to do it. Consider the bottom layer of Ubuntu your host, or hyper-visor, and the top level of Ubuntu can be used for anything else that you want.

One reason that you might run Ubuntu as a VM on top of your host operating system is to keep your host operating system as clean as possible. You can take greater risks in your virtual operating system, and you can easily restore it if something goes wrong. You can also run multiple copies of Ubuntu at the same time, perhaps for compatibility testing, or for testing different versions of Ubuntu.

If you are just starting out with home automation, and you don't want to pay for Unraid, then running Ubuntu as a host operating system is a fantastic option. Simply install Docker, Portainer, and perhaps Cockpit, and you will have a great home automation server. You can add virtualized instances of Ubuntu later for playing around and testing.

You may want to read about Unraid vs. Proxmox vs. Ubuntu to help you make your decision.

Should You Run a Windows Server in a Virtual Machine?

If you have decided that a Windows installation is the best choice for your home automation server, then virtualizing it is a very good choice. Windows works well in a virtual environment. The VM helps make backing up the server easier, and it also makes it easier to move the server to a new machine if you ever need to.

If you are running your home automation server on Windows because you like the way that Windows shares files, then you should think twice about that decision. Windows file sharing, known as SMB, or Samba, is a consistent source of frustration for many home automation users. Sharing files over SMB can be much more reliable if you use a Linux server instead of a Windows server, even if that server is running the Windows native file sharing protocol.

Any resources that the VM needs to access, such as USB devices, can be passed through to the VM. This means that you can run a VM on a Windows server that has access to your USB Zigbee stick, or your USB Z-Wave stick, or your USB serial port adapter.

You also have to pass any storage through to the Windows VM. If you are interested in hardware or software RAID, then you should run that on the host operating system, and then pass the storage through to the VM.

Pros and Cons of Virtualizing Your Home Server

Let's talk briefly about the pros and cons of virtualizing your home automation server.

Pros Cons
It's possible to backup and restore your entire server. More difficult to set up.
It is easy to migrate your entire server to new hardware. You have to pass all storage through to your server instance.
Rebooting your server is lightning fast. Managing data pools needs to be done in the host operating system.
You can run multiple servers on the same hardware. Any devices that your server needs have to be passed through.
Your server can run double-duty as a desktop. Requires more hardware.
Experimenting with server virtualization is a great learning experience. CPU must support virtualization and IO pass-through.

Virtualization and Disk Storage

The vast majority of home automation tools are available as Docker containers, which means that no matter what you choose, you are probably going to run these tools in their own containers. That decision is pretty much already made for you.

The decision about virtualizing your home automation server really comes down to what you are going to do with your storage. When your server has a lot of storage, or a complex storage solution such as RAID or ZFS, you are probably best-off installing it bare-metal.

Since most home automation servers run double-duty as a file server or a media server, then the vast majority of home automation servers have a lot of storage. This means that they are probably better-off running bare-metal instead of in a VM.

Should You Virtualize Your Home Automation Server?

There are many good reasons to virtualize your home automation server, and there are also an equal number of good reasons not to. The best way to decide is to try it out. If you have a spare computer, then you can install a virtualization host on it, and then install a virtual server on top of it. You can then try out different operating systems, and see which one you like best. Ubuntu on Ubuntu is a great way to start.

Even if you choose to install your home automation server bare-metal, you can still run a virtual machine on top of it. You can use that virtual machine to test out different operating systems, or to run a different version of the same operating system.

If all of this seems overly complicated or confusing, then you should probably install your home automation server bare-metal. Most server operating systems do an excellent job of installing updates in-place, so you don't have to worry about reinstalling your server every time there is an update. Keep a VM or two around for testing and experimenting, and you won't have to worry about breaking your primary server installation.

Leave a reply

Thank you! Your comment has been successfully submitted. It will be approved as soon as possible.

More from Efundies