(408) 943-4100               V   Commercial Support

Basic Management

  6 minute read.

Last Modified 2021-04-02 11:24 EDT
This feature is only supported by the TrueNAS CORE community.

A Virtual Machine (VM) is an environment on a host computer that can be used as if it were a separate physical computer. VMs can be used to run multiple operating systems simultaneously on a single computer. Operating systems running inside a VM see emulated virtual hardware rather than the actual hardware of the host computer. This provides more isolation than Jails, but a VM will consume more system resources.

A portion of system RAM and a new zvol is assigned to each VM. While a VM is running, these resources are not available to the host computer or other VMs.

TrueNAS VMs use the bhyve virtual machine software. This type of virtualization requires an Intel processor with Extended Page Tables (EPT) or an AMD processor with Rapid Virtualization Indexing (RVI) or Nested Page Tables (NPT). VMs cannot be created unless the host system supports these features.

To verify that an Intel processor has the required features, open the Shell and run grep VT-x /var/run/dmesg.boot. If the EPT and UG features are shown, this processor can be used with bhyve.

To verify that an AMD processor has the required features, open the Shell and run grep POPCNT /var/run/dmesg.boot. If the output shows the POPCNT feature, this processor can be used with bhyve. Note that AMD K10 “Kuma” processors include POPCNT but do not support NRIS, which is required for use with bhyve. Production of these processors ceased in 2012-2013.

Creating a Virtual Machine

Before creating the virtual machine, you will need an installer .iso or image file for the operating system you intend to install and a storage pool available for both the virtual disk and operating system install file.

To create a new VM, go to Virtual Machines and click Add. Configure each category of the VM according to your specifications, starting with the Operating System.

VMAddOperatingSystem

Operating System

NameDescription
Guest Operating SystemChoose the VM operating system type.
NameEnter an alphanumeric name for the virtual machine.
DescriptionDescription (optional).
System Clock *VM system time. Default is Local.
Boot MethodSelect UEFI for newer operating systems or UEFI-CSM (Compatibility Support Mode) for older operating systems that only support BIOS booting. Grub is not recommended but can be used when the other options do not work.
Shutdown TimeoutThe time in seconds the system waits for the VM to cleanly shut down. During system shutdown, the system initiates poweroff for the VM after the shutdown timeout has expired.
Start on BootSet to start this VM when the system boots.
Enable VNCEnable a VNC (Virtual Network Computing) remote connection. Requires UEFI booting.
Delay VM Boot Until VNC ConnectsWait to start VM until VNC client connects.
BindVNC network interface IP address. The primary interface IP address is the default. A different interface IP address can be chosen.

CPU and Memory

NameDescription
Virtual CPUsNumber of virtual CPUs to allocate to the virtual machine. The maximum is 16, or fewer if the host CPU limits the maximum. The VM operating system might also have operational or licensing restrictions on the number of CPUs.
CoresSpecify the number of cores per virtual CPU socket. The product of vCPUs, cores, and threads must not exceed 16.
ThreadsSpecify the number of threads per core. The product of vCPUs, cores, and threads must not exceed 16.
Memory SizeAllocate RAM for the VM. Minimum value is 256 MiB. This field accepts human-readable input (Ex. 50 GiB, 500M, 2 TB). If units are not specified, the value defaults to bytes.

Disks

NameDescription
Create new disk imageSelect Create new disk image to create a new zvol on an existing dataset. This is used as a virtual hard drive for the VM. Select Use existing disk image to use an existing zvol or file for the VM.
Select Disk TypeSelect desired disk type.
Zvol LocationSelect a dataset for the new zvol.
SizeAllocate space for the new zvol. (Examples: 500 KiB, 500M, 2 TB) MiB. Units smaller than MiB are not allowed.

Network Interface

NameDescription
Adapter TypeIntel e82545 (e1000) emulates the same Intel Ethernet card. This provides compatibility with most operating systems. VirtIO provides better performance when the operating system installed in the VM supports VirtIO paravirtualized network drivers.
Mac AddressEnter the desired address into the field to override the randomized MAC address.
Attach NICSelect the physical interface to associate with the VM.

Installation Media

NameDescription
Choose Installation Media ImageBrowse to the operating system installer image file.
Upload an Installer Image FileSet to display image upload options.

Additional notes:

  • The Grub Boot Method is not supported by Windows guest operating systems.
  • Compare the recommended specifications for your guest operating system with the available host system resources when allocating Virtual CPUs, Cores, Threads, and Memory Size.
  • Avoid allocating too much memory to a VM. Activating a VM that has all available memory allocated to it can slow the host system or prevent other VMs from starting.
  • AHCI is the recommended Disk Type for Windows VMs.
  • The VirtIO Network Interface requires that the chosen guest operating system support VirtIO paravirtualized network drivers.

Adding and Removing Devices

After the VM is created, add and remove virtual devices by expanding the VM entry in Virtual Machines and clicking .

VMDevices

Device notes:

  • The virtual machine attempts to boot from devices according to the Device Order, starting with 1000, then ascending.
  • CD-ROM devices allowing booting a VM from a CD-ROM image like an installation CD. The CD image must be available in the system storage.

Managing the Virtual Machine

After creating the VM and configuring any devices for it, manage the VM by expanding its entry in Virtual Machines.

VMOptions

Options for or connections are available after activating the VM. If the VNC connection screen appears garbled, try adjusting the VNC device resolution.

Using the State toggle or clicking follows a standard shut down procedure to cleanly shut down the running VM. Clicking immediately halts and deactivates the VM, similar to unplugging a computer.

If the VM you created has no Guest OS installed, The VM State toggle and button might not function as expected. These buttons try to send an ACPI power down command to the VM operating system, but since no OS is installed, the commands time out. Use the POWER OFF button instead.