Virtual machines (VMs) offer a risk-free way to access new operating systems without actually installing them on your system. If you're using a PC, setting up VMs is quite straightforward: all you need to do is enable virtualization in the BIOS, install a hypervisor, and launch a virtual machine using the ISO file of an operating system.
But if you want to access your VMs from any device connected to your network, it's a good idea to launch them on a network-attached storage (NAS) device. Unfortunately, the procedure is vastly different from how you install VMs on a PC. Here’s a step-by-step guide to help you create, configure, and access virtual machines on a NAS.
Before you begin
Unlike the typical NAS workload of transferring and storing data files, you’ll need a lot more headroom to run VMs without experiencing slowdowns. Since the virtual machine will need to run on top of TrueNAS SCALE, your NAS specs should be better than the minimum requirements of the VM’s operating system. For this reason, I recommend using a NAS with at least an Intel Core/Xeon or an AMD Ryzen processor that was released in the past five years, alongside a minimum of 8GBs of DDR4 memory.
How to create a virtual machine on TrueNAS SCALE
Assuming you’ve already installed TrueNAS SCALE and created a dataset, you can log in to the NAS on another system and initiate the setup procedure for your VMs.
- From the main Dashboard, head to the Virtualization tab and select Add Virtual Machines.
- Pick the Guest Operating System of your choice and give the virtual machine a name. If you want, you can also modify the Boot method, System clock, Display, and other settings. Be sure to tap Next afterwards.
- Allocate the number of CPU cores, threads, and memory to the VM before hitting Next.
- Pick the dataset of your choice as the Zvol location, enter the amount of storage you’re willing to allocate to the virtual machine under Size, and click Next.
- Add the Adapter Type, MAC Address, and NIC on the Network Interface menu and click Next.
- Choose the operating system you want to use with the VM, and click Next.
- TrueNAS prompts you to pick the graphics card for displaying the output. If you don’t have extra GPUs, don’t worry. Just enable the checkbox next to Enable Display Device, and click Next.
- Finally, click Save.
How to access the virtual machine on TrueNAS SCALE
Once you’ve created the virtual machine, it’s time to access it using Virtual Network Computing (VNC).
- Power up the virtual machine by clicking the toggle in the State column. You can also configure it to start automatically when you boot the NAS by selecting the checkbox under Autostart.
- Expand the options by clicking the Down arrow, and select Display.
- VNC displays the output of the virtual machine on a separate tab.
(Optional) How to add devices to virtual machines on TrueNAS SCALE
If you’re a power-user, you might want to enable certain functionalities like disks and PCIe passthrough. To do so:
- Choose the Devices option on the expanded menu.
- Click Add.
- Pick the type of device and configure its parameters before clicking Save.
(Optional) How to reallocate resources to virtual machines on TrueNAS SCALE
If you encounter slowdowns, you might want to allocate more resources to the VM after its initial setup. To modify the CPU and memory parameters:
- Click the Edit option under the virtual machine.
- Scroll down until the CPUs and Memory header becomes visible.
- After you modify the resources allocated to the VM, click Save.
Running virtual machines on a NAS
That’s it! If you’ve followed the steps correctly, your VM will boot up, and you can use it pretty much the same way you would on a hypervisor. Unless you’re using a low-power device like the Raspberry Pi as a NAS, you shouldn’t encounter many performance hiccups when using the virtual machine.
But if your workload requires you to run multiple virtual machines in tandem, you might need to upgrade to a beefier NAS with better specs. Be sure to check out our list of the best NAS devices if you need help picking out the enclosure.
