Sponsor Content Created With Microsoft

Set up a safe testing lab with Hyper‑V and Windows Sandbox

Windows 11 virtualization feature
(Image credit: Mauro Huculak)

If you want to test apps, system tweaks, files, or view untrusted web pages on Windows 11, it can introduce unnecessary risk. A safer approach is to create an isolated environment where changes stay contained and can be discarded at any time.

Windows 11 includes built-in tools such as Hyper-V and Windows Sandbox, enabling you to build a secure testing lab without third-party software. Whether you're validating configurations, trying unfamiliar applications, or experimenting with system changes, these features provide a controlled space that protects your main setup.

How to set up Windows Sandbox on Windows 11

If you need a temporary, isolated testing environment, use Windows Sandbox instead of Hyper-V.

Windows Sandbox is a lightweight, disposable desktop environment with a setup footprint of about 100MB, designed for safely testing apps and opening untrusted files or websites without affecting your main system.

You can think of it like a "Private Browsing" or "Incognito" mode for your entire operating system. Once you close the session, everything gets deleted on that virtualization isolation.

Enable Windows Sandbox

To enable Sandbox on Windows 11, use these steps:

  1. Open Settings.
  2. Click on System.
  3. Click the Advanced page on the right side.
  4. Click the Virtual Workspaces setting.

Open Virtual Workspaces

(Image credit: Mauro Huculak)
  1. Turn on the "Windows Sandbox" toggle switch.
  2. Click the Restart now button.

Enable Windows Sandbox

(Image credit: Mauro Huculak)
  1. Click the Restart now button.

Once you complete the steps, the virtualization feature will be installed on your computer, and it'll be availble as a regular application from the Start menu.

Get started with Sandbox

If you want to test an application or script you recently downloaded from the internet, or you have to visit a website you're not sure about, then do this:

  1. Open Start.
  2. Search for Windows Sandbox and click the top result to open the app.

Once in the Sandbox environment, you'll have a desktop experience identical to the one in the operating system.

From the top-right, you can access the main menu (three dots). From there, you can enter full-screen mode and select a folder on your main computer as a location to share files. However, you can always drag and drop files from the main installation into the Windows Sandbox desktop.

Sandbox options

(Image credit: Mauro Huculak)

As part of the settings, you can also access your clipboard history, audio input, and video input from your main installation.

The Windows Sandbox environment works identically to Windows 11. You can install and run untrusted apps without affecting the current installation.

You can also upload and open untrusted files. However, you may need to install the specific application that supports that specific format.

Inside this virtualized environment, you can also use the browser to access an untrusted website.

It's possible to test scripts, but since Windows Sandbox is technically not a full installation of Windows 11, the script may fail even if it's written correctly if it's meant to change something specific in the operating system, for example.

Windows Sandbox close warning

(Image credit: Mauro Huculak)

When you finish closing the app, you will delete the entire virtual machine and anything you have installed.

How to set up Hyper-V on Windows 11

On Windows 11, Hyper-V is a virtualization hypervisor that allows you to create virtual machines to run virtually any operating system (such as Windows 11, Windows 10, Ubuntu, and other Linux distros). While Windows Sandbox is only a quick convenience setup of Windows 11, Hyper-V is a complete lab environment.

You would choose to use Hyper-V when you need a persistent environment. The moment you close a Windows Sandbox session, everything gets deleted. On the other hand, a virtual machine behaves like a real computer. You can shut it down, go to sleep, and resume exactly where you left off tomorrow.

If you are testing complex configurations (such as custom Windows 11 debloating scripts), they often require a system restart to apply changes or proceed to the next phase. A restart is possible in a sandbox, but if it fails, you'll lose everything. On the other hand, a Hyper-V machine can be rebooted as many times as needed.

If you're developing an application and you need a testing environment, or you want to run a different operating system alongside your main installation, a virtual machine may be a better choice.

Enable Hyper-V

To enable Hyper-V on your computer, use these steps:

  1. Open Settings.
  2. Click on System.
  3. Click the Advanced page on the right side.
  4. Click the Virtual Workspaces setting.

Open Virtual Workspaces

(Image credit: Mauro Huculak)
  1. Turn on the "Hyper-V GUI Management Tools" toggle switch.
  2. (Optional) Turn on the "Hyper-V Module for Windows PowerShell" toggle switch.
  3. Turn on the "Hyper-V Hypervisor" toggle switch.

Enable Hyper-V Hypervisor

(Image credit: Mauro Huculak)
  1. Turn on the "Hyper-V Services" toggle switch.
  2. Click the Restart now button.

After you complete the steps, the hypervisor and other components will be added to your current setup. The last step is to create a virtual machine and install your operating system of choice.

Get started with Hyper-V

Before you can start using this virtualization feature, you'll have to create a virtual machine and install the operating system, similar to setting up a physical computer, but using the Hyper-V Manager.

Since the operating system will behave like a physical machine, if you're installing any supported version of Windows, you'll have to provide a product key.

To create a virtual machine with Hyper-V, use these steps:

  1. Open Start.
  2. Search for Hyper-V and click the top result to open the Hyper-V Manager.
  3. Open the Action menu, choose New, and select the Virtual Machine option.

Hyper-V new virtual machine option

(Image credit: Mauro Huculak)
  1. Click the Next button.
  2. Confirm the name of the virtual machine.
  3. Click the Next button.
  4. Choose the Generation 2 option.

Hyper-V Generation 2 option

(Image credit: Mauro Huculak)
  1. Click the Next button.
  2. Set the 4096 (megabytes) or more for the "Startup memory" settings, depending on the operating system you're about to install.

Hyper-V startup memory

(Image credit: Mauro Huculak)
  1. Click the Next button.
  2. Select the Default Switch option in the "Connection" setting.

Hyper-V default switch connection

(Image credit: Mauro Huculak)
  1. Click the Next button.
  2. Select the "Create a virtual hard disk" option.
  3. Complete the virtual hard disk settings, depending on the operating system you're installing.

Hyper-V create virtual hard disk

(Image credit: Mauro Huculak)
  1. Click the Next button.
  2. Select the "Install an operating system from a bootable image file" option.

Hyper-V mount ISO file

(Image credit: Mauro Huculak)
  1. Click the Browse button.
  2. Select the ISO file for the operating system to install. For example, Windows 11 ISO.
  1. Click the Open button.
  2. Click the Next button.
  3. Click the Finish button.
  4. Right-click the virtual machine and choose the Settings option.
  • Quick note: You're only required to enable the TPM emulation if you plan to install Windows 11 or another operating system that requires this feature. Otherwise, you can skip it.
  1. Click on Security (TPM enabled) from the left pane.
  2. Check the "Enable Trusted Platform Module" option.

Enable TPM on Hyper-V

(Image credit: Mauro Huculak)
  1. (Optional) Check the "Encrypt state and virtual machine migration traffic" option.
  2. Click the Apply button.
  3. Click the OK button.
  4. Right-click the newly created virtual machine and select the Start option.

Hyper-V start virtual machine

(Image credit: Mauro Huculak)
  1. Quickly right-click the virtual machine and choose the Connect option.
  2. Click inside the virtual machine and press any key to continue with the setup.
  3. Continue installing Windows 11 as usual.

Hyper-V install Windows 11

(Image credit: Mauro Huculak)

Once you complete the steps, you'll have a setup identical to the one on a physical machine.

Hyper-V VM running Windows 11

(Image credit: Mauro Huculak)

After the installation, you can install and test applications, run scripts using PowerShell or Command Prompt, or test custom configurations. You can also open untrusted files or open untrusted web pages, all without affecting your main installation.

When you're done, you can use the controls in the virtual machine to shut down, pause, or save the entire system to resume later.

If you no longer need the virtual machine, you can right-click the machine and choose the "Delete" option.

How to enable hardware virtualization

Although most modern computers already have hardware virtualization enabled in their firmware, you may still need to perform another step before enabling Windows Sandbox or Hyper-V.

Enabling virtualization in the firmware will depend on the brand and model of the computer, but these are general steps:

  1. Open Settings.
  2. Click on System.
  3. Click on Recovery.
  4. Click the Restart now button for the "Advanced startup" setting.

Windows 11 Advanced startup

(Image credit: Mauro Huculak)
  1. Click the Restart now button one more time.
  2. Click on Troubleshoot.
  3. Click on Advanced options.
  4. Click the "UEFI Firmware Settings" option.

WinRE UEFI firmware settings

(Image credit: Mauro Huculak)
  1. Click the Restart button.
  2. Open the Configuration, Security, or Advanced page.
  3. Select the "Virtualization Technology," "Intel Virtual Technology," or "SVM Mode" option.
  4. Turn on the virtualization option.
  5. Save the firmware settings.

Once you complete the steps, restart the computer, and then continue with the steps to enable Windows Sandbox or Hyper-V on your computer.

Windows Central's Take

If you're still testing apps or viewing untrusted files and web pages directly on your primary Windows 11 setup, you're taking unnecessary risks that can leave your system unstable or compromised.

That's why Hyper-V and Windows Sandbox are not just nice-to-have features. They are essential. Sandbox nails the quick testing scenario. It launches quickly, requires almost no setup, and wipes everything when you close it. For opening unknown files or verifying a suspicious app, it's arguably one of the most underrated security features available on Windows 11.

Hyper-V, on the other hand, is where things get serious. If you're testing scripts, tweaking system configurations, or validating deployment scenarios, Sandbox quickly hits its limits. A proper virtual machine gives you persistence and the ability to simulate real-world environments. It's closer to a full lab than a disposable container.

The bigger picture here is that Microsoft already gives you everything you need to build a safe testing environment, no third-party tools required. The problem isn't availability, it's awareness. A lot of users either don't know these features exist or assume they're too complex to use.

Once you start using these tools, your workflow will change. You no longer have to worry about breaking your setup. You can test freely, reset everything instantly, and try more advanced configurations without risking your main system.

Do you use Hyper-V or Sandbox on Windows 11? Let me know in the comments.

Mauro Huculak
Windows How-To Expert

Mauro Huculak has been a Windows How-To Expert contributor for WindowsCentral.com for nearly a decade and has over 22 years of combined experience in IT and technical writing. He holds various professional certifications from Microsoft, Cisco, VMware, and CompTIA and has been recognized as a Microsoft MVP for many years.