Installing Hyper-V, WSL2, Docker Desktop or Windows Sandbox on a Windows VPS often fails with "virtualization is not enabled" or similar errors. These tools are hypervisors themselves, so the VPS needs nested virtualization. This guide explains how to run Hyper-V inside a Windows VPS on KVM and what to do if you cannot.
Before you start
- Administrator access to the Windows VPS.
- For the host-side steps, access to the KVM host. On a rented VPS, ask the provider whether nested virtualization is available.
Why it fails
Hyper-V, WSL2 (which uses a Hyper-V utility VM), Docker Desktop's WSL2 backend and Windows Sandbox need VT-x/AMD-V inside the guest. By default KVM does not expose those CPU features to VMs. Check in the VPS: Task Manager → Performance → CPU shows Virtualization: Not capable, or systeminfo lists Hyper-V requirements as "No".
Host side: enable nested virtualization
- Enable nested KVM on the host; see nested virtualization on KVM.
- Give the VM a CPU model that exposes vmx/svm, typically
host-passthrough. - Keep Hyper-V enlightenments on, and on Intel hosts ensure the
vmxfeature is not disabled in the CPU definition. - Fully power off and start the VM.
Guest side: enable the features
Hyper-V on Windows Server:
Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -RestartWSL2 (Windows Server 2022 and later, or Windows 10/11 desktops):
wsl --installSee enable Hyper-V and WSL2 explained.
Performance expectations
- Nested guests are slower, especially for disk and network I/O.
- Fine for development, testing and light containers; not ideal for production workloads.
Alternatives without nested virtualization
- Docker: run Linux containers on a Linux VPS instead; see Docker on Linux.
- Windows containers: process-isolated Windows containers on Windows Server do not need Hyper-V isolation.
- Separate VMs: rent separate VPSs instead of nesting VMs inside one.
- Dedicated server: run Hyper-V directly on hardware.
Troubleshooting
- "A hypervisor has been detected. Features required for Hyper-V will not be displayed": this is normal inside a VM; check whether installation still succeeds.
- WSL2 error 0x80370102: virtualization not exposed; nested virtualization is off.
- VM crashes after enabling Hyper-V: outdated host QEMU/kernel; update the host.
Frequently asked questions
Can I enable this from inside the VPS?
No, it is a host CPU setting.
Does WSL1 work without nesting?
Yes, WSL1 does not use a VM, though compatibility is lower.
Is nested virtualization safe for providers?
It adds host attack surface, which is why many providers leave it off by default.
