Jump to content

Windows Sandbox - A New Lightweight Desktop Environment for Running Untrusted Apps


Recommended Posts

Posted (edited)

This looks useful, although it's interesting the sandbox feature isn't available for Windows 10 Education given that it is essentially the same as Enterprise. :confused:

 

https://techcommunity.microsoft.com/t5/Windows-Kernel-Internals/Windows-Sandbox/ba-p/301849

 

Windows Sandbox is a new lightweight desktop environment tailored for safely running applications in isolation.

 

How many times have you downloaded an executable file, but were afraid to run it? Have you ever been in a situation which required a clean installation of Windows, but didn’t want to set up a virtual machine?

 

At Microsoft we regularly encounter these situations, so we developed Windows Sandbox: an isolated, temporary, desktop environment where you can run untrusted software without the fear of lasting impact to your PC. Any software installed in Windows Sandbox stays only in the sandbox and cannot affect your host. Once Windows Sandbox is closed, all the software with all its files and state are permanently deleted.

 

Windows Sandbox has the following properties:

 

  • Part of Windows – everything required for this feature ships with Windows 10 Pro and Enterprise. No need to download a VHD!
  • Pristine – every time Windows Sandbox runs, it’s as clean as a brand-new installation of Windows
  • Disposable – nothing persists on the device; everything is discarded after you close the application
  • Secure – uses hardware-based virtualization for kernel isolation, which relies on the Microsoft’s hypervisor to run a separate kernel which isolates Windows Sandbox from the host
  • Efficient – uses integrated kernel scheduler, smart memory management, and virtual GPU

Prerequisites for using the feature

  • Windows 10 Pro or Enterprise build 18305 or later
  • AMD64 architecture
  • Virtualization capabilities enabled in BIOS
  • At least 4GB of RAM (8GB recommended)
  • At least 1 GB of free disk space (SSD recommended)
  • At least 2 CPU cores (4 cores with hyperthreading recommended)

 

Windows Sandbox internals

Since this is the Windows Kernel Internals blog, let’s go under the hood. Windows Sandbox builds on the technologies used within Windows Containers. Windows containers were designed to run in the cloud. We took that technology, added integration with Windows 10, and built features that make it more suitable to run on devices and laptops without requiring the full power of Windows Server.

 

Some of the key enhancements we have made include:

 

Dynamically generated Image

At its core Windows Sandbox is a lightweight virtual machine, so it needs an operating system image to boot from. One of the key enhancements we have made for Windows Sandbox is the ability to use a copy of the Windows 10 installed on your computer, instead of downloading a new VHD image as you would have to do with an ordinary virtual machine.

 

We want to always present a clean environment, but the challenge is that some operating system files can change. Our solution is to construct what we refer to as “dynamic base image”: an operating system image that has clean copies of files that can change, but links to files that cannot change that are in the Windows image that already exists on the host. The majority of the files are links (immutable files) and that's why the small size (~100MB) for a full operating system. We call this instance the “base image” for Windows Sandbox, using Windows Container parlance.

 

Smart memory management

Memory management is another area where we have integrated with the Windows Kernel. Microsoft’s hypervisor allows a single physical machine to be carved up into multiple virtual machines which share the same physical hardware. While that approach works well for traditional server workloads, it isn't as well suited to running devices with more limited resources. We designed Windows Sandbox in such a way that the host can reclaim memory from the Sandbox if needed.

 

Additionally, since Windows Sandbox is basically running the same operating system image as the host we also allow Windows sandbox to use the same physical memory pages as the host for operating system binaries via a technology we refer to as “direct map”. In other words, the same executable pages of ntdll, are mapped into the sandbox as that on the host. We take care to ensure this done in a secure manner and no secrets are shared.

 

Read more...

Edited by Arthur
  • Thanks 2
Posted
I was reading through the details of this today, it looks very interesting. I have a bunch of users that I need to allow onto a network segment and they need to show / load /use some very odd software. It really is a genuine requirement and this may be part of the solution. Was it only mentioned anywhere in detail in the last few days, or has it been around a short while?
  • 5 months later...
Posted
Has anyone determined a means to permanently disable it? The powershell scripts only turn it off and on when a user could just go back in and enable it.
  • 2 weeks later...
Posted
Can you use applocker to block it?

 

Just an FYI for anyone else who tries this. While I can get the appblocker to block systemreset.exe when accessed directly. Windows generally calls the fresh start and system reset function from its Windowssettingsflow call. This circumvents AppLocker. It is impossible to block the settings flow service as it blocks everything in the settings UI.

Posted
Installed this the other day. We use the Education version (not Enterprise) and it's available to us. You have to install it as a Feature so if you dont want it on your new software builds then dont install it.
Posted
We use the Education version (not Enterprise) and it's available to us. You have to install it as a Feature so if you dont want it on your new software builds then dont install it.

It's strange how Microsoft said it was only available for Pro and Enterprise? :confused:

 

I can also confirm it works in with the Education edition. The OS in the sandbox is the Enterprise edition. :p

 

5RTLMA.png

 

Can you disable it how you normally disable system reset?

I thought Windows didn't let you install optional features without admin rights?

 

$WindowsSandbox = "Containers-DisposableClientVM"
if ((Get-WindowsOptionalFeature -Online -FeatureName $WindowsSandbox).State -eq "Disabled") {
   Enable-WindowsOptionalFeature -Online -FeatureName $WindowsSandbox -NoRestart
}

  • Thanks 1
Posted
Users need to be an Administrator on the machine to run Sandbox, no? Certainly asks me for admin credentials, in which case would users even be able to run it? I would hope not.
Posted
Seems so, odd. Maybe they'll add normal user ability later. What's the point of telling people not to run as admin if you need to to use a sandbox?
Posted
I'm a little confused as to why you would install it in the first place if you then disable it or are you wanting to restrict it to just some users?

I agree. You wouldn't install a feature if you don't want users to be able to use it. :)

 

@mecolema. It might be worth starting your own thread about disabling the Windows 10 Reset PC feature. This thread is to do with Windows Sandbox (which is completely different). It's getting a bit confusing with different people talking about different things. :p

Posted (edited)
Does the sandbox have network connectivity?

It does, although you can disable networking through the use of a configuration file.

 

https://techcommunity.microsoft.com/t5/Windows-Kernel-Internals/Windows-Sandbox-Config-Files/ba-p/354902

 

DisableNetwork.wsb

Disable

 

The following blog post contains some other useful things you can do with configuration files.

 

www.systanddeploy.com/2019/05/enable-windows-sandbox-on-1903-with-and.html

Edited by Arthur
  • Thanks 1
Posted
I agree. You wouldn't install a feature if you don't want users to be able to use it. :)

 

@mecolema. It might be worth starting your own thread about disabling the Windows 10 Reset PC feature. This thread is to do with Windows Sandbox (which is completely different). It's getting a bit confusing with different people talking about different things. :p

 

I confused this with another thread I was writing in, apologize about the confusion.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...