Virtual Machines

 Figured I'd add on to my last post with a brief rundown of what virtual machines I run in Unraid. I wouldn't have thought having the ability to make and use VMs would have been so useful as much as it has been (What is a Virtual Machine?).

 I've always thought about using VMs just for fun but I never had a server before and didn't want to add more stress to any of the main computers I've had over the years. While I have used software in the past such as VMware and Parallels but have always either had a second or third computer laying around or ran multiple boot options. Those are decent options but not very practical since you're using more power, having individual computers or having more boot options means switching between operating systems can be a pain. Multi booting also can lead to ruining your Master Boot Record or corrupting your data if you're constantly trying out different OSes like I did, it happened many times (queue times when I tried building Gentoo from source or changing Distros three times in a week).

 This is where Unraid comes in handy with how straightforward and easy they make creating VMs. Some do require a little more configuration but after reading some documentations you'll be on your way.

Virtual Machines

 As you can see above there are an insane amount of options here to choose from and so far I've only made Ubuntu and Windows 10 VMs but the setup is pretty much the same overall. Now while the initial VM setup is easy there can be more variables than you'd think with the options you're given which also leads to some post creation issues. Overall Unraid still makes it easy to set up any VM you'd like.

VM Options

 Here is the setup page of an Ubuntu VM. Starting with basic things such as naming, server CPU, memory allocation, and CPU pinning. You're allowed to give a VM any amount of memory that is available in your system but obviously you wouldn't do that, so I just keep it to around 8-12GB per VM depending on usage. The cool thing to me here is the ability to pin CPU cores and threads which makes the VM only be able to use only the ones you pin but are still available for any of your other services on your server. Let's say I pin two cores and two threads (as shown above), the VM acts as if it has four whole cores making the most out of your server's CPU. Now you can set up CPU isolation through the use of IOMMU which removes cores from being used by Unraid but the VM has full use of those. I'd most likely use isolation if I had something more than a six core i5, so for now pinning is the way to go. One last thing about pinning, it is common practice to not use core 0 and its thread as that is exclusively used by Unraid. While you can choose it, it can impact your performance.

 There are also options for BIOS settings given for selected uses depending on which OS you plan on installing (I won't go into detail about these but will include a link to a full tutorial at the end of this post). Next you would input your install.iso of your OS and the drive size of your VM (this uses your cache drive and not your array). The last major option is your GPU selection, giving you the ability to use GPU passthrough. For most basic VMs, VNC is just fine but if you want or need to use any graphical intensive program I'd recommend passthrough. This is perfect for making a VM for cloud gaming but you also lose the selected GPU to be used for anything else on your server whenever that VM is running (the reason why I have two in my server).

 Now let's run through my three VMs that I use, Windows 10, Pop OS Linux, and Mac OS Big Sur.

My Virtual Machines

 Up first is Pop OS (Ubuntu based Distro), while it's not one that I use often since it's what my laptop runs. I built it for my girlfriend to have a Linux environment for her data science school work as getting docker and hyper-v setup on her Windows PC was a little more involved than I liked it to be. It also gives her a constant setup she can use anywhere and on any machine while storing all her files on the server all without having to alter anything with her PC.

Pop OS

 Set up with all the software she needs like Anaconda3, R Studio, Docker, and Portainer. I opted for Portainer as a replacement for Docker Desktop which her school recommended for use on Windows. Pretty basic setup as you can see, for this I only pinned two cores and two threads with 8GB of RAM and a 150GB virtual disk.

 Next up is my Windows 10 VM which I mainly setup for Cloud Gaming. As I talked about setting this VM up for retro gaming in my "Building a Server" post with Steam and RetroArch. Installing Windows 10 in a VM was a little more involved than Pop OS was since you have to download a set of VirtIO drivers, your installed GPU BIOS.rom and configure the correct settings. Again, since this is all done through Unraid, the amount of documentation is abundant for installing and troubleshooting VMs. After a few howto searches, it wasn't long before I was able to get it up and running.

Windows 10

 Now you can see I have pinned three cores and three threads, giving me six cores in total for the VM, along with 12GB of RAM and a virtual disk of 80GB (enough for basic programs as games are installed on the array). The one thing you'll notice differently compared to the Pop OS VM is the GPU section. While Pop OS is using VNC, Windows has my GTX 1650 setup as passthrough giving me more than enough power to run RetroArch as well as being able to play modern games.

 Running a VM to run RetroArch means I play any older console games from anywhere without the need of having my gaming PC on all the time. As of now I plug my laptop into my living room TV so I can play on my couch with the use of Steam Link. I plan in the future to build a Raspberry PI computer so I'll have a nice clean setup ready to go at any moment without the need to plug in my laptop every time I want to play. The great thing with Steam Link is I can turn on my VPN and easily play remotely from my phone, which by the way, is still insane to me. The other day I took my Mom to the doctor, while I waited I sat and played F-Zero for the SNES, if someone told me this when I was a child my brain would have exploded.

 I figured at this point that's all I needed to use this VM for but I found out I can use it as a streaming PC for when I stream on Twitch. There is a NDI plugin for OBS Studio which outputs the OBS running on my gaming PC to the OBS running on the Windows VM, taking the load of encoding for Twitch off of my gaming PC and putting it on the VM. This is a massive help with game performance and any stream interruptions if I end up having issues with the gaming PC. On top of running Steam Link and OBS it's just nice to have a Windows environment I can remote into from Pop OS on my laptop.

 Lastly, I have recently set up a Mac OS Big Sur VM just to mess around since the office computers at work are Macs and I'm the goto computer guy at work. I haven't used Mac OS since Leopard back in the day. I'm a little out of touch when troubleshooting Mac issues or even just the menu layouts and this will help out with that.

Mac OS

 Setting up Mac OS was way more involved than all the others since installing it on anything other than an actual Mac is a big no no to Apple. You can't just make this through Unraid's VM manager but there is a Docker container that inserts one called Macinabox. Basically you run the container with your basic information, run some user scripts to trick Mac OS, boot it up, and install Big Sur like you would as if it was a regular Mac. OK so you're done right? Kind of, now you have to download and run a program called OpenCore Configurator. This is where you edit the EFI partition with all your system information and hardware that you want to use. It's magic really, you're constantly tricking Mac OS to think it's where it wants to be, it's not perfect but it runs decent enough to play around in but I wouldn't go running any resource heavy programs. There are options to get GPU passthrough to work but I haven't successfully been able to yet.

 All these virtual machines have been a huge benefit on top of all the other things Unraid has brought to my life. While I don't think I'll have much need for any more VMs than what I share with you here, I might set up one for Windows XP just for nostalgia purposes. Virtual machines have unlimited potential for everyday use even if you don't use a computer every day for work like myself.

 Thank you for reading my journey so far with virtual machines and if you'd like to see some more in-depth guides on setting these VMs up yourself in Unraid, here are some helpful links that I used.

Ubuntu
Windows 10
Mac OS