Unraid Image

In the previous post, I have introduced the hardware aspect of my new build. It is arguably overpowered for a development machine, especially one that is not being used daily. However, I am not using the machine for a single purpose, but 3 different machines all roll into 1.

It is …

  • Network Attached Storage ( NAS );
  • Server; and
  • Development Machine

The Experience - “It just works!”

Machine Booting

Booting up a machine is not something anyone would do every day. However, it showed how the NAS and server parts of the system are seamlessly run behind the scene and hidden. Apart from the system taking longer to boot ( 2 minutes ), there are no significant differences between this machine and one with regular Windows installation.

The theme of seamless integration continues with connecting peripherals to the system. Keyboard and mice are connected via built-in USB hub from the monitor, and they are plug and play just like a regular machine would do. Onboard WiFi and Bluetooth connectivity are available in the system as expected and I can connect to wireless headphone without any issues.

Even with 3 hard drives in the system and many applications running in the background. The fan stay quiet and the performance of the development machine is unaffected.

To most people, it is just another regular full tower PC.

Unraid OS 2-core CPU

+-----------------+ +--------------------------------------+ +-----------+  
|                 | |                                      | |           |  
|  Ubuntu Server  | |       Windows / Linux (Dev)          | |   Docker  |  
|                 | |                                      | |           |  
+-----------------+ +--------------------------------------+ +-----------+  
+------------------------------------------------------------------------+  
|                                                                        |  
|                                   Unraid                               |  
+------------------------------------------------------------------------+  

The whole seamless experience was made possible by Unraid. It is a light weight linux OS installed on a USB flash drive. It has support of building large storage array, built-in Docker and Virtual Machine ( VM ).

Tip: Use a new USB flash drive to avoid unexpected failures. A cheap SanDisk USB 3.0 32GB works just fine.

Unraid is not a new product and the “N Workstations, 1 CPU” concept has been proven and demonstrated many times1. However, there are few key events that happened recently that convinced me to try it in 2021.

  1. Unraid 6.9 Release
  2. Official Support of Nvidia GeForce GPU Passthrough for Windows Virtual Machine
  3. Strong Community, such as Spanceinvader One

Unraid is free to try, so you can make sure the software is compatible with the hardware before purchase. At the time of writing, the Pro license with unlimited attached storage is USD$129. I think it is well worth the investment for getting the most out of the machine. If cost is a concern, there are free options available in the market, such as TrueNAS, which apparently a good alternative as well.

As a first time Unraid user, the Unraid OS is very easy to setup too. It was a weekend project for me, but I found it might be even a touch easier for installing Windows, because there is no need to prepare a USB installation disk.

Network Attached Storage ( NAS )

I have been using Synology NAS product for few years now, and purchased a DS1819+ as an upgrade few years ago. Synology DSM is very easy to use, and the device was very compact for an 8-Bay NAS solution. However, it was very expensive to expand with more drives.

With this new machine, it will be a place for archiving completed projects and documents that does not require frequent access. Its low frequent access nature means hard drives can be spin down most of the time.

Tip: I am using a LSI-2008 HBA card which support 8 hard drives, and could easily expanded to 16 hard drives in the future. It is purchased from Art of Server and I highly recommended him.

Unraid has a feature which further help my situation, which first writing data to a cache drive and move to hard drive at scheduled time later.

Tip: Yes: Cache

Hard drive fails regularly, and Unraid provided an easy way to build a reliable storage system. It trades off some capacity, but the data is still available when facing 1 ( or 2 ) drive failure.

Tip: Redundancy is NOT a backup

Docker Service ( Unraid )

Docker

In order to run multiple applications separately in an environment, without a possibility that a single application affecting the whole system. In the past, the problem was generally solved by either building multiple servers, or building a single powerful machine running multiple virtual machines ( VM ) server.

Docker is an OS-level virtualization technology that provide a much elegant solution to this problem. Overheads are minimized, so the hardware is better utilized. Some enthusiastic member, such as linuxserver.io, packages popular applications into Docker containers to help wider adoption.

Unraid has rich Community Apps which runs in Docker, and took a step further to make the installation and upgrade process even easier.

Docker Service ( Ubuntu Server ) 2-core CPU, 8GB Memory

Ubuntu server

For “off the shelf” applications, such as Heimdall dashboard, the embedded Unraid Docker instance was used because of its ease of use. For experimental projects, I created an Ubuntu Server VM instead so I can fail safely without crashing the host OS.

Tip: The Docker instances in Ubuntu and Unraid can be managed together with tools such as Portainer.

The server was allocated with its own 2-core ( 4-threads ) CPU and a separate network IP address, so the general experience would be identical to a standalone physical server. A virtualized (VNC) graphics card was used. The server’s display output can be accessed from a browser, or a SSH client can be used to control the machine. Such as Visual Studio Code for “Remote development”.

Tip: If you are also using Dvorak keyboard layout. Configure normal QWERTY layout in the VM to avoid double remap.

Development Machine 8-core CPU, 32GB Memory

Dev Windows

Tip: Follow this guide to get the GPU vBios. If you cannot start a VM after restart, have a look at this script too.

P.S. When installing new PCI-E hardware ( i.e. Network card ) or update BIOS, try

  1. Stop the VM
  2. Perform the installation, or upgrade
  3. Update the VM configuration, bind VFIO device again if necessary
  4. Start and test the VM
  5. Reboot and check if all post reboot script successfully

Last but not least, it is the development virtual machine.

In my option, this is also the place where the word “virtual” start to become philosophical. In the past, virtual machine usually perform poorly on consumer hardware because it could not access the hardware directly, like native OS would. Fortunately, there has been significant advancement in passing not only CPU, but also peripheral devices, such as GPU, NVMe SSD and USB controllers, to the virtual machine. Everything “just works”.

Note: For the initial test, I have pass-through my existing Linux installation on a NVMe SSD, and the system booted perfectly.

There are some leaky abstractions2 though, where some usb ports cannot pass-through because one of the port being used by Unraid. Thankfully, an Unraid community plugin ( LIBVIRT HOT PLUGIN USB ) make it so that only an additional step is needed after plugging in the USB device.

For the choice of operating systems, I have both Windows and Linux VMs installed, and I can switch between them easily. Because the OS is in a virtual environment, I could add an extra graphics card and have both system running at the same time ( i.e. 4-core CPU, 16GB Memory each ). Alternatively, I could the other half of the resource to spin up 4 mini instances of Ubuntu Server ( 1-core CPU, 8GB Memory ) for learning Kubernetes.

Conclusion

This is my 1st month of using Unraid, and I cannot wait to discover more possibilities in the future.

Modern hardware is getting so powerful today that it seems wasteful to just have the machine running a single OS. The software is also mature enough that it is very easy to setup too. I definitely recommend to consider using Unraid or similar system for software development.

Reference

Spaceinvader One YouTube Tutorials