Hack Forums
Enable windows sandbox without restarting Win10 - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45)
+--- Forum: Grayhat • Purple Team • Hybrid Security (https://hackforums.net/forumdisplay.php?fid=449)
+---- Forum: Beginner Hacking (https://hackforums.net/forumdisplay.php?fid=4)
+----- Forum: Hacking Tutorials (https://hackforums.net/forumdisplay.php?fid=47)
+----- Thread: Enable windows sandbox without restarting Win10 (/showthread.php?tid=6281412)



Enable windows sandbox without restarting Win10 - Clumsy - Oct 4, 2024

Hello every today I am going to be sharing a PowerShell script that I wrote that works that will allow you to enable
Windows Sandbox and HyperV without restarting your pc.

1. Open PowerShell as admin you can also do Windows key +r PowerShell.exe or Windows key +x then select PowerShell

2. Once you are in PowerShell paste the following script into your console you can ctrl +a then ctrl +v this and hit enter then you are done enjoy.

Code
# Check if running as Administrator
if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
    Write-Host "This script needs to be run as Administrator." -ForegroundColor Red
    exit
}

# Enable Windows Sandbox
Write-Host "Enabling Windows Sandbox feature..." -ForegroundColor Green
Enable-WindowsOptionalFeature -FeatureName "Containers-DisposableClientVM" -All -NoRestart -Online

# Enable Hyper-V (required for Windows Sandbox)
Write-Host "Enabling Hyper-V feature..." -ForegroundColor Green
Enable-WindowsOptionalFeature -FeatureName "Microsoft-Hyper-V-All" -All -NoRestart -Online

# Enable Virtual Machine Platform (required for Windows Sandbox)
Write-Host "Enabling Virtual Machine Platform..." -ForegroundColor Green
Enable-WindowsOptionalFeature -FeatureName "VirtualMachinePlatform" -All -NoRestart -Online

Write-Host "Made By ClumsyLulz / SleepTheGod"

Write-Host "Windows Sandbox and related features have been enabled. You may need to manually restart your computer for changes to fully take effect." -ForegroundColor Yellow

Hope this helps have fun and stay safe.


RE: Enable windows sandbox without restarting Win10 - Aeowulf - Oct 4, 2024

Simple, but effective. Nifty, thanks for sharing.


RE: Enable windows sandbox without restarting Win10 - preddt - Nov 25, 2024

Very interesting, thanks for the info.