Activate VT-x for VMs in Virtualization Station 3

This tutorial will show how to activate VT-x for VMs in Virtualization Station 3.

Configuration

Connect to your QNAP via SSH and become root.

Then find your QKVM install path

/sbin/getcfg QKVM Install_Path -f /etc/config/qpkg.conf

It should be something like “/share/ZFS530_DATA/.qpkg/QKVM”

Inside that folder, edit the module.

vim <YOURINSTALLPATH>/usr/etc/qvsd.d/44-preload/01-module

eg.: 
vim /share/ZFS530_DATA/.qpkg/QKVM/usr/etc/qvsd.d/44-preload/01-module

Find the following block

load_kvm()
{
    ___load_module kvm.ko ignore_msrs=1
    check_ret
    echo 1 > /sys/module/kvm/parameters/ignore_msrs
    echo 0 > /sys/module/kvm/parameters/report_ignored_msrs

    # load kvm module
    if [ $VMX_FEATURE -ne 0 ]; then
        ___load_module kvm-intel.ko "nested=0 enable_apicv=0"
        check_ret
    elif [ $SVM_FEATURE -ne 0 ]; then
        ___load_module kvm-amd.ko nested=0
        check_ret
    else
        elog "Platform not support KVM"
        exit 1
    fi
}

Change the “VMX” line from

___load_module kvm-intel.ko "nested=0 enable_apicv=0"
to
___load_module kvm-intel.ko "nested=1 enable_apicv=0"

I've seen this line in other variations, for example without “apicv”, just make sure to edit “nested” if you line looks different.

Restarting your QNAP will change this configuration.

If you want to enable it without rebooting, execute the following.

Look up your active modules for “kvm-intel”

modprobe -l | grep kvm-intel
> kvm-intel.ko

Then find its path

find / -name "kvm-intel.ko"

You should find something like “/lib/modules/KVM/kvm-intel.ko”. This is a symlink pointing to the version of the module, just use this.

Stop all VMs, then remove the module.

rmmod kvm-intel.ko

Activate the module with the new set parameter (if you have “apicv” in your line I suggest setting the parameter as well)

insmod /lib/modules/KVM/kvm-intel.ko nested=1

Look it up once again

modprobe -l | grep kvm-intel
> kvm-intel.ko

And check if your parameters are set

 
cat /sys/module/kvm_intel/parameters/nested
Y
cat /sys/module/kvm_intel/parameters/ept
Y

To activate VT-x in for your VMs, you have to set the CPU to passthrough.

lscpu should now show VT-x as a feature

lscpu
...
Virtualization features:
  Virtualization:        VT-x
  Hypervisor vendor:     KVM
  Virtualization type:   full
...

For Windows, check the “Performance” tab in the Taskmanager or check via PowerShell

Get-WmiObject -Class Win32_Processor | Select-Object -ExpandProperty VirtualizationFirmwareEnabled