Adding and Managing VMs
8 minute read.Last Modified 2023-05-26 11:36 EDT
A virtual machine (VM) is an environment on a host computer that you can use as if it is a separate, physical computer. Users can use VMs to run multiple operating systems simultaneously on a single computer. Operating systems running inside a VM see emulated virtual hardware rather than the host computer physical hardware. VMs provide more isolation than Jails but also consume more system resources.
TrueNAS assigns a portion of system RAM and a new zvol to each VM. While a VM is running, these resources are not available to the host computer or other VMs.
TrueNAS VMs use the KVM virtual machine software. This type of virtualization requires an x86 machine running a recent Linux kernel on an Intel processor with VT (virtualization technology) extensions or an AMD processor with SVM extensions (also called AMD-V). Users cannot create VMs unless the host system supports these features.
To verify that you have Intel VT or AMD-V, open the Shell and run
egrep '^flags.*(vmx|svm)' /proc/cpuinfo.
If device information appears, your system has VT. You can also check the processor model name (in
/proc/cpuinfo) on the vendor’s website.
Before creating a VM, you need an installer
To create a new VM, go to Virtualization and click Add to open the Create Virtual Machine configuration screen. If you have not yet added a virtual machine to your system you can click Add Virtual Machines to open the same screen.
Select the operating system you want to use from the Guest Operating System dropdown list.
Compare the recommended specifications for the guest operating system with your available host system resources when allocating virtual CPUs, cores, threads, and memory size.
Change other Operating System settings per your use case.
Select UTC as the VM system time from the System Clock dropdown if you do not want to use the default Local setting.
Select the virtual console option from the Display Type dropdown. VNC is the most widely used option with the best display but is slower than SPICE. SPICE has faster data transfer speed but a lower quality display, and is not as secure as VNC.
Change the default IP address in Bind if you want use a specific address as the primary network interface, otherwise leave it set to 0.0.0.0.
Enter the CPU and memory settings for your VM.
If you selected Windows as the Guest Operating System, the Virtual CPUs field displays a default value of 2. The VM operating system might have operational or licensing restrictions on the number of CPUs.
Do not allocate too much memory to a VM. Activating a VM with all available memory allocated to it can slow the host system or prevent other VMs from starting.
Leave CPU Mode set to Custom if you want to select a CPU model.
Specify the amount of RAM you want for the VM if you want to use more or less than the default. We recommend increasing this value, but your configuration depends on the resources available for your VM.
Configure disk settings.
Select Create new disk image to create a new zvol on an existing dataset.
Select Use existing disk image to use an existing zvol for the VM.
Select either AHCI or VirtIO from the Select Disk Type dropdown list. We recommend using AHCI or Windows VMs.
Select the location for the new zvol from the Zvol Location dropdown list.
Enter a value in Size (Examples: 500KiB, 500M, and 2TB) to indicate the amount of space to allocate for the new zvol.
Cofigure the network interface.
Select the network interface type from the Adapter Type dropdown list. Select Intel e82585 (e1000) as it offers a higher level of compatibility with most operating systems, or select VirtIO if the guest operating system supports para-virtualized network drivers.
Select the network interface card to use from the Attach NIC dropdown list.
Upload installation media for the operating system you selected.
You can create the VM without an OS installed. To add it either type the path or browse to the location and select it.
To upload an
isoselect Upload an installer image file and either enter the path or browse to the location of the file.
Click Upload to begin the upload process. After the upload finishes, click Next.
Specify a GPU.
The VirtIO network interface requires a guest OS that supports VirtIO para-virtualized network drivers.iXsystems does not have a list of approved GPUs at this time but does have drivers and basic support for the list of nvidia Supported Products.
Confirm your VM settings, then click Save.
After creating the VM, you can add or remove virtual devices.
Expand the VM entry on the Virtual Machines screen and click device_hub Devices.
- A virtual machine attempts to boot from devices according to the Device Order, starting with 1000, then ascending.
- A CD-ROM device allow booting a VM from a CD-ROM image like an installation CD. The CD image must be available in the system storage.
After creating the VM and configuring devices for it, manage the VM by expanding the entry on the Virtual Machines screen.
An active VM displays options for settings_ethernet Display and keyboard_arrow_right Serial Shell connections.
If the display connection screen appears distorted, try adjusting the display device resolution.
Use the State toggle or click stop Stop to follow a standard procedure to do a clean shutdown of the running VM. Click power_settings_new Power Off to halt and deactivate the VM, which is similar to unplugging a computer.
If the VM you created has no Guest OS installed, The VM State toggle and stop Stop button might not function as expected. The State toggle and stop Stop button send an ACPI power down command to the VM operating system, but since an OS is not installed, these commands time out. Use the Power Off button instead.
When the VM is configured in TrueNAS and has an OS
Some operating systems can require specific settings to function properly in a virtual machine. For example, vanilla Debian can require advanced partitioning when installing the OS. Refer to the documentation for your chosen operating system for tips and configuration instructions.
Upload the Debian
Click Virtualization, then ADD to use the VM wizard.
Wizard Screen Setting Description Operating System: Guest Operating System Linux Name debianVM Description Debian VM CPU and Memory: Memory Size 1024 MiB Disks: Create new disk image Selected Zvol Location Select pool. Size 30 GiB Network Interface: Attach NIC Select the physical interface to associate with the VM. Installation Media: Installation ISO is uploaded to
If the ISO is ot uploaded, select Upload an installer image file.
Select a dataset to store the ISO, click Choose file, then click Upload. Wait for the upload to complete.
GPU: Leave the default values. Confirm Options Verify the information is correct and then click Save.
After creating the VM, start it. Expand the VM entry and click Start.
Click Display to open a virtual monitor to the VM and see the Debian Graphical Installation screens.
Debian Graphical Install
- Press Return to start the Debian Graphical Install.
- Language: English
- Location: United States
- Keymap: American English
- Continue if the network configuration fails.
- Do not configure the network at this time.
- Enter a name in Hostname.
- Enter the root password and re-enter the root password.
- Enter a name in New User.
- Select the username for your account (it should already be filled in).
- Enter and re-enter the password for the user account.
- Choose the time zone, Eastern in this case.
Disk detection begins
- Partition disks: select Guided - use entire disk.
- Select the available disk.
- Select All files in one partition (recommended for new users).
- Select Finish partitioning and write changes to disk.
- Select Yes to Write the changes to disks?.
Installing the base system begins
- Select No to the question Scan extra installation media.
- Select Yes when asked Continue without a network mirror.
Installing software begins
- Select No when asked Participate in the package usage survey.
- Select Standard system utilities.
- Click Continue when the installation finishes.
After the Debian installation finishes, close the display window.
Remove the device. In the expanded section for the VM, click Power Off to stop the new VM.
a. Click Devices. b. Remove the CD-ROM from the devices by clicking the and selecting Delete. Click Delete Device.
Return to the Virtual Machines screen and expand the new VM again.
The grub file does not run when you start the VM, you can do this manually after each start. At the shell prompt:
To ensure it starts automatically, you create the startup.nsh file at the root directory on the vm. To create the file:
Go to the Shell.
At the shell prompt type
In the editor type:
- Use the Control+s keys (Command+s for Mac OS) then Return.
- Use the Control+q keys to quit.
Close the display window
To test if it now boots up on startup:
- Power off the VM.
- Click Start.
- Click Display.
- Log into your Debian VM.