Things you need:
- Hyper-V (Windows Pro Versions, Server Editions, Enterprise)
- Windows 2022 Server ISO or Windows 2025 Server ISO
- https://gist.github.com/neggles/e35793da476095beac716c16ffba1d23 (GPU Driver Gathering Script)
Steps:
- Go into Hyper-V and Make a Virtual Switch (Can use your Ethernet)
- Go into the extracted folder you downloaded from Neggles - Hyper-V GPU Virtualization
- There will be 2 .ps1 files and 1 readme.md
- Right click and edit ‘New-GPUVirtualMachine.ps1’
- Change VMName, VMMemory, VMCore to whatever you like and save
- Run powershell as administration and run the command
Set-ExecutionPolicy bypass-
and select
YYes and then close powershell -
Right click in the folder and open Terminal
-
Type
lsto check if the 3 files are showing which would indicate you are in the right folder- (
New-GPUVirtualMachine.ps1, New-GPUDriverPackage.ps1, readme.md)
- (
-
Type
.\New-GPUVirtualMachine.ps1in Terminal or alternatively you can just write ‘./’ and press tab until you get the file -
This file creates your vm in Hyper-V
-
Check your virtual machine that you created and change these settings going forward
- Check Processor count in your virtual machine as it may have not saved and it might be using the default value (1).
- Add the Virtual Switch that you created in the Network Adapter Tab
- Go to “SCSI Controller” and add a DVD Drive
- Choose Image File and select your Windows ISO that you want to install and select Apply
- This time select ‘Hard Drive’ and click Add
- Select Virtual Hard Disk and click New
- Choose Fixed Size if you are planning on playing games
- Name your Hard Disk
- Choose an appropriate location for all your virtual disks. Note, this location must have good amount of storage as all your virtual drives will be here
- Select the size you want for your Virtual Hard Disk (Default 127GB is plenty, adjust accordingly to how many games you plan to install)
- Do note that Windows Server 2025 and 2022 take approx. 15GB storage
- Once all the drives are made go into Firmware and change the boot order. It should be in this following order:
→ DVD Drive (Boot Drive)
→ Virtual Hard Drive(s)
→ Network Adapter
-
Now double click your VM and start the installation for your Windows
-
DISCLAIMER: IF YOU GET AN ERROR WHEN STARTING YOUR VM FOLLOW THIS —
In my case, the error was somewhere along the lines of:GPU Partition (Instance ID 69E7E377-A066-41D6-A03B-E610AC30DAA6): Failed to Power on with Error ’.‘.Insufficient system resources exist to complete the requested service
‘WS22PLEX’ failed to start. (Virtual machine ID CAED9896-6895-4541-AC43-B25856D3B385)
‘WS22PLEX’ GPU Partition (Instance ID 69E7E377-A066-41D6-A03B-E610AC30DAA6): Failed to Power on with Error
’Insufficient system resources exist to complete the requested service.’ (0x800705AA). (Virtual machine ID
`CAED9896-6895-4541-AC43-B25856D3B385)Could not allocate a GPU partition as no GPU devices are compliant with currently set group policy. See
HyperV\RequireSecureDeviceAssignment and HyperV\RequireSupportedDeviceAssignment for more details.To get around this, you need to create 2 keys in Reg edit.
HKLM:\SOFTWARE\Policies\Microsoft\Windows\HyperV" -Name "RequireSecureDeviceAssignment" -Type DWORD -Value 0HKLM:\SOFTWARE\Policies\Microsoft\Windows\HyperV" -Name "RequireSupportedDeviceAssignment" -Type DWORD -Value 0I closed off MMC.exe from Task Manager before attempting to run the VM again.
Try to launch the VM again by running the following command in Powershell: Start-VM Server123
(Replace “Server123” with your recently created guest server name).Your server should now boot up with no error. I installed drivers in the guest and tested by running a 4K youtube video, and watched the resource spike up on the host machine’s task manager.
Notes:
• Make sure that you install GPU drivers on the host machine before doing any of the above.
• Make sure to install GPU drivers on the guest VM when after creation and booting into it.
• Normally, GPU resources are not visible in the guest VM.
-
-
While your windows is downloading, now run the second .ps1 file in the same terminal
- This file will make a zip file of the GPU Drivers in the location of the .ps1 file
- Transfer this zip file onto the VM either through swisstransfer or a cloud drive like onedrive
- Extract the zip file and paste the contents into C:\Windows\
- Now Shut Down the VM
-
Open Powershell as Administrator on Host System
- Type [Set-VMProcessor -VMName YourVMName -ExposeVirtualizationExtensions $true]
- You wont get any outputs for this
- Once this is done open your VM
-
In your VM go to Apps and Features and Enable Hyper-V
- If you are on Windows Server go to Server Manager → Add Roles or Features → Hyper-V
- Restart VM
- Nested Virtualization Enabled
To check if you successfully passed your GPU
- Go to Device Manager → Display Adapters
- You should be able to see your GPU if you have done the steps right
- Sometimes GPU shows on the Task Manager on some windows versions
Things you need in order to play games on your VM without latency:
- Parsec
- Virtual Display Driver
- https://github.com/VirtualDrivers/Virtual-Display-Driver/releases-usbipd-win
- https://github.com/dorssel/usbipd-win-usbipd-win2
- https://github.com/vadimgrn/usbip-win2
- Ideally two mouse
SETUP →
- Install ‘usbipd-win’ on host computer and install ‘usbipd-win2’ on VM
- Install ‘Virtual Display Driver’ on VM
- Open Powershell as Administrator and write [usbipd list]
This will show a list of your connected USB devices
Find the mouse that you want to use in the VM to play games and note its BUSID - Write [usbipd bind —busid 1-8 —force], here I have written my busid for my mouse which is [1-8] you write whatever yours is
- Depending on your mouse it will ask to reboot your host machine
NOTE: In order to unshare or unbind the mouse → [usbipd unbind —busid 1-8] on your host machine - TIP: Enable Mouse Trails by going Mouse Settings → Additional Mouse Settings → Pointer Options → Display Mouse Trails → Check and select the shortest option
- When using mouse through usbipd-win and usbipd-win2, even though mouse is connected, most often its not seen by the user. This allows the user to see the mouse when connected through Parsec
PARSEC →
- Install Parsec on both host machine and VM and sign in to the same account
- From host machine try to connect to your VM
NOTE: If you want to connect to Parsec on VM Boot ensure you select “Per Computer” while installing Parsec instead of “Per User” - Launch USBIPD.exe and type the IP Address of your host machine. (Open CMD and type ‘ipconfig’ and select the IP of your ethernet or wifi adapter)
- Click connect and the mouse should show up
- Attach the mouse
- Your mouse should be working in Parsec but not in Host machine
TROUBLESHOOTING
- If your mouse does not show on USBIPD on your VM here are a few things to keep in mind
- IPv4 Must be disabled on your main Realtek ethernet driver on host computer and enable on your network switch for your VM
- If something does not work you can try these steps:
- Disable Network Switch for VM
- Disable Main Network adapter for PC
- Disable IPv4 for Main Network Adapter
EVERYTHING IS NOW DONE, YOU CAN INSTALL AND PLAY YOUR GAMES ON YOUR VM
LEAGUE OF LEGENDS SPECIFIC
- In order to play league and bypass Vanguard completely all you need is a small script which runs while you have league running
- All this script does is the moment League of Legends.exe is launched, which is the actual game .exe, it quits out of it → Restarts Vanguard Service → Relaunch the Client
- Copy the script below and type it in a text document
- save text document as auto-restart-vanguard.ps1
- Launch this whenever you want to play league of legends and its done
Script for League of legends
— CONFIG ---
$vgcServiceName = "vgc" $riotClientPath = "C:\Riot Games\Riot Client\RiotClientServices.exe"
$riotClientArgs = "--launch-product=league_of_legends --launch-patchline=live"
function Restart-Vanguard {
Write-Output "Restarting Vanguard service..."
Stop-Service -Name $vgcServiceName -Force -ErrorAction SilentlyContinue
Start-Sleep -Seconds 3
Start-Service -Name $vgcServiceName
}
function Wait-For-Vanguard {
Write-Output "Waiting for Vanguard to fully initialize..."
$maxWait = 10
$waited = 0
while ((Get-Service -Name $vgcServiceName).Status -ne 'Running' -and $waited -lt $maxWait) {
Start-Sleep -Seconds 1
$waited++
}
if ((Get-Service -Name $vgcServiceName).Status -ne 'Running') {
Write-Error "Vanguard failed to start."
exit 1
}
}
function Kill-LeagueClient {
Write-Output "Closing LeagueClient.exe..."
Get-Process -Name "LeagueClient" -ErrorAction SilentlyContinue | Stop-Process -Force
}
function Launch-League {
Write-Output "Launching League via Riot Client..."
Start-Process -FilePath $riotClientPath -ArgumentList $riotClientArgs
}
function Wait-For-GameStart {
Write-Output "Waiting for game start..."
while ($true) {
$game = Get-Process -Name "League of Legends" -ErrorAction SilentlyContinue if ($game) {
Write-Output "`n>>> Game detected!"
return
}
Start-Sleep -Seconds 2
}
}
function Wait-For-GameEnd {
Write-Output "Waiting for game to finish..."
while ($true) {
$game = Get-Process -Name "League of Legends" -ErrorAction SilentlyContinue
if (-not $game) {
Write-Output "Game ended."
return
}
Start-Sleep -Seconds 5
}
}
# --- LOOP ---
while ($true) {
Wait-For-GameStart
Kill-LeagueClient
Restart-Vanguard
Wait-For-Vanguard
Launch-League
Wait-For-GameEnd
Write-Output "`nReady for next game..."
}Back References: