How to Enable Hyper-V on Windows Server 2022 VPS
Important Note About VPS and Nested Virtualization
If your Windows Server 2022 is running as a VPS (Virtual Private Server), you'll need nested virtualization support from your hosting provider. Nested virtualization allows you to run Hyper-V inside a virtual machine.
Requirements for nested virtualization:
- Your VPS provider must support nested virtualization
- The host server must have it enabled for your VM
- Contact your provider to confirm support before proceeding
Prerequisites
- Windows Server 2022 (Standard, Datacenter, or Core)
- Administrator privileges
- At least 4 GB of RAM (8 GB or more recommended)
- 64-bit processor with virtualization extensions (Intel VT-x or AMD-V)
- Sufficient disk space for virtual machines
Method 1: Install Hyper-V Using Server Manager (GUI)
Step 1: Open Server Manager
- Click on the Start menu
- Select Server Manager (it usually opens automatically on login)
Step 2: Add Roles and Features
- In Server Manager, click Manage in the top right corner
- Select Add Roles and Features
- Click Next on the Before You Begin page
Step 3: Select Installation Type
- Select Role-based or feature-based installation
- Click Next
Step 4: Select Server
- Select your server from the server pool
- Click Next
Step 5: Select Hyper-V Role
- In the Roles list, check the box for Hyper-V
- A popup will appear asking to add required features
- Click Add Features
- Click Next
Step 6: Select Features
- Review the features list (no additional features required)
- Click Next
Step 7: Hyper-V Configuration
- Read the Hyper-V information page
- Click Next
Step 8: Create Virtual Switches
- Select the network adapter(s) you want to use for virtual switches
- Click Next
Step 9: Virtual Machine Migration
- Configure migration settings if needed (optional)
- Click Next
Step 10: Default Stores
- Specify default locations for virtual machines and virtual hard disks
- Click Next
Step 11: Confirm Installation
- Review your selections
- Check Restart the destination server automatically if required
- Click Install
Step 12: Restart
The server will install Hyper-V and restart automatically. After restart, the installation will complete.
Method 2: Install Hyper-V Using PowerShell (Recommended)
PowerShell provides a faster way to install Hyper-V, especially for servers without a GUI.
Step 1: Open PowerShell as Administrator
- Press Windows Key + X
- Select Windows PowerShell (Admin) or Terminal (Admin)
Step 2: Install Hyper-V Role
Run the following command:
Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -Restart
Explanation:
-Name Hyper-V: Specifies the Hyper-V role-IncludeManagementTools: Installs Hyper-V Manager and PowerShell modules-Restart: Automatically restarts the server after installation
The server will restart automatically after installation completes.
Alternative: Install Without Automatic Restart
If you want to restart manually later:
Install-WindowsFeature -Name Hyper-V -IncludeManagementTools
Then restart when ready:
Restart-Computer -Force
Method 3: Install Hyper-V Using DISM (Command Line)
You can also use DISM (Deployment Image Servicing and Management) from Command Prompt:
DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V
Then restart:
shutdown /r /t 0
Verifying Hyper-V Installation
After the server restarts, verify that Hyper-V is installed correctly.
Using PowerShell:
Get-WindowsFeature -Name Hyper-V
Look for Install State: Installed with an X checkbox.
Using Hyper-V Manager:
- Press Windows Key + R
- Type
virtmgmt.mscand press Enter - Hyper-V Manager should open successfully
Special Configuration for VPS (Nested Virtualization)
If your Windows Server 2022 is itself a virtual machine (VPS), your hosting provider must enable nested virtualization. You'll need to contact them to run this command on the host server:
Set-VMProcessor -VMName "YourVMName" -ExposeVirtualizationExtensions $true
Note: You cannot run this command yourself - it must be executed by the hosting provider on their physical host.
Verify Nested Virtualization Support
To check if nested virtualization is enabled, run this in PowerShell on your VPS:
Get-ComputerInfo | Select-Object HyperVRequirementVirtualizationFirmwareEnabled
If it returns True, nested virtualization is supported.
Post-Installation Steps
Create a Virtual Switch
After installing Hyper-V, create a virtual switch for networking:
New-VMSwitch -Name "External Switch" -NetAdapterName "Ethernet" -AllowManagementOS $true
Replace "Ethernet" with your actual network adapter name. To find adapter names:
Get-NetAdapter
Set Default VM Storage Locations
Configure default paths for VMs and virtual hard disks:
Set-VMHost -VirtualHardDiskPath "C:\Hyper-V\Virtual Hard Disks"
Set-VMHost -VirtualMachinePath "C:\Hyper-V\Virtual Machines"
Troubleshooting
Error: "Hyper-V cannot be installed: The processor does not have required virtualization capabilities"
Solution:
- If on a physical server: Enable virtualization (Intel VT-x or AMD-V) in BIOS/UEFI
- If on a VPS: Contact your hosting provider to enable nested virtualization
Error: "Hyper-V cannot be installed: A hypervisor is already running"
Solution: This usually means another virtualization software is installed (VMware, VirtualBox). You must uninstall it first.
Hyper-V Manager Won't Open
Solution:
- Verify installation:
Get-WindowsFeature -Name Hyper-V - Reinstall management tools:
Install-WindowsFeature -Name Hyper-V-Tools - Restart the server
Cannot Create Virtual Machines
Solution:
- Ensure you have sufficient RAM and disk space
- Check that virtualization is enabled in BIOS (physical servers)
- Verify nested virtualization is enabled (VPS)
Creating Your First Virtual Machine
After Hyper-V is installed, you can create VMs using:
Hyper-V Manager (GUI):
- Open Hyper-V Manager
- Right-click your server name
- Select New > Virtual Machine
- Follow the wizard
PowerShell:
New-VM -Name "TestVM" -MemoryStartupBytes 2GB -NewVHDPath "C:\Hyper-V\TestVM.vhdx" -NewVHDSizeBytes 50GB
Uninstalling Hyper-V
If you need to remove Hyper-V:
Uninstall-WindowsFeature -Name Hyper-V -Restart
Warning: This will remove all virtual machines and their data.
Additional Resources
Summary
To install Hyper-V on Windows Server 2022:
PowerShell (fastest):
Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -Restart
Server Manager: Manage > Add Roles and Features > Select Hyper-V > Install
For VPS users: Contact your hosting provider to enable nested virtualization first.


















