When there are dual GPUs, it will be helpful to disable one.
It works for me in a notebook with a Intel GPU and a Nvidia GPU.
The following script is to disable Intel GPU and then start the Windows sandbox.
It will be necessary to modify the GPU brand name in the script, when your built-in GPU is AMD.
run_sandbox.ps1
# ==========================================
# 1. Force Admin UAC Prompt
# ==========================================
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Start-Process powershell.exe -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
exit
}
# ==========================================
# 2. Core Logic (Run as Admin)
# ==========================================
# Find Intel GPU
$IntelDevice = Get-PnpDevice -FriendlyName "*Intel*Graphics*" -ErrorAction SilentlyContinue
if ($null -eq $IntelDevice) {
Write-Error "Cannot find Intel Graphics Device. Please check names."
Pause
exit
}
$IntelID = $IntelDevice.InstanceId
# Execution
Write-Host "[1/3] Disabling Intel GPU temporarily..." -ForegroundColor Yellow
pnputil /disable-device $IntelID
# 🛠️ FIXED: Changed from "windowssandbox:" protocol to direct .exe path
Write-Host "[2/3] Launching Windows Sandbox Exe..." -ForegroundColor Green
Start-Process "C:\Windows\System32\WindowsSandbox.exe"
# Wait for sandbox initialization
Write-Host "Waiting for Sandbox initialization (5s)..." -ForegroundColor Cyan
Start-Sleep -Seconds 5
Write-Host "[3/3] Re-enabling Intel GPU..." -ForegroundColor Green
pnputil /enable-device $IntelID
Write-Host "All done! Script exiting in 2 seconds." -ForegroundColor Cyan
Start-Sleep -Seconds 2