Windows Sandbox

One of the more exciting feature additions to Windows 10 May 2019 Update is Windows Sandbox, which is a containerized version of Windows which runs in a lightweight virtualized environment, and allows you to open a pristine version of Windows every single time. There are many scenarios where this would be useful, and by default the VM is isolated, allowing less than trustworthy applications to be run without having to fire up a new virtual machine to do it. It would also be great for application testing, and many IT functions would benefit from a quick and easy to use VM without having to deal with the complexities and heft of Hyper-V. The VMs are also disposable, so every time you turn open Windows Sandbox you’ll get a new, pristine VM.

Windows Sandbox is an optional component which has to be turned on through the “Turn Windows Features on or off” menu, and it is only available in Windows 10 Pro and Enterprise, so unfortunately home users are out of luck.

There’s actually a lot under the hood that makes Windows Sandbox special. When you think about running a virtualized instance of another operating system, it generally requires hardware dedicated to the machine, such as RAM, and a large footprint for the virtual hard disk, either dedicated up-front as a single large block on your storage, or one that is dynamically increased as the storage is consumed within the virtual machine.

Windows Sandbox doesn’t work like this, although unsurprisingly it is based on Hyper-V. Windows Sandbox leverages technologies used in Windows Containers, meaning it is designed to use the minimal amount of hardware it can.

Windows Sandbox gets a 40 GB virtual hard disk to play in, but Microsoft uses a dynamically generated image for Windows Sandbox that reduces its footprint on the host OS to just 25 MB when compressed, or 100 MB when Windows Sandbox is enabled. Rather than have a unique VHD file that it launches from, Windows Sandbox uses the copy of Windows 10 on the host machine as its base image. It uses clean copies of files that can change, so if you modify some of your Windows files on the host PC the Sandbox version won’t be affected, and the same thing happens in reverse. If Windows files are changed in the Sandbox machine, they don’t write to the original files, but instead to a new copy of the file. Then, when the Sandbox is closed, all of those changed files are discarded, so the next time it is opened it’s a clean version again.

Memory is another key component, but like with the disk, since both the host and guest are running the same operating system, there is plenty of overlap in memory as well, meaning the impacted memory on the host can be dramatically reduced. Since much of the in-memory data will be the same for the same processes, Windows Sandbox can direct map the guest VM to the host VM’s copy of the data to reduce how much memory is required. If one or the other tries to change that same location in memory, a new copy of the new data will be created for whichever one made the request, so the other is not affected. These are typical ways to save memory in a virtualized environment, but when the host and guest are running the same version of an operating system, the RAM savings are dramatic. Running Windows Sandbox with no applications open offers the Sandbox VM 4 GB of memory, but on my test machine it only consumed 237 MB of memory on the host. In addition, the host gets priority if memory is required, so it can reclaim memory from the guest if needed.

That same principle applies to the kernel scheduler. Unlike a full hypervisor, Windows Sandbox uses what Microsoft calls an integrated scheduler to decide when the Sandbox VM gets compute time. If high-priority tasks need to be run on the host, it can pre-empt the Sandbox and jump it in the CPU queue. The major benefit here is that the host remains responsive at all times, even if the Sandbox is using a lot of CPU.

If you’ve used virtualization in the past, you’ll know of the term snapshot, which allows you to save the state of a virtual machine exactly how it is, including the memory state. This is what Sandbox uses to launch. The VM can be loaded as an already booted and logged in version of Windows 10, cutting down on the start-up time required when launching Sandbox. On my machine, launching a new instance of Sandbox takes about ten seconds, and once it’s loaded it’s ready to go, since it’s already logged in to the desktop.

The Sandbox also gets access to some of the other hardware on the host, such as the GPU, which allows for hardware accelerated rendering, and it also is aware of the host battery state, so if you are running this on a laptop, the VM can cut its power usage when on battery just like a normal version of Windows.

You will also be able to customize the Sandbox experience with Config files soon, allowing you to launch the Sandbox with a specific configuration. Sandbox uses XML configuration files with the .wsb extension, and allow you to control whether or not the Sandbox gets access to the virtualized GPU, networking, shared folders with the host computer, and a startup script so you can have it automatically launch an application or run a script.

Windows Sandbox, in my eyes, is one of the most exciting features to come to Windows in a while, and is something that I will likely use quite often. Having an always pristine version of Windows to do application testing on, while being able to easily control its access to files and folders on the host, is going to be valuable for many, I think. The implementation is very well thought out, and leans heavily on the serious work done on Windows Containers for cloud computing. It’s great to see a feature that was targeted at Azure trickling down into consumer-level Windows 10. The small footprint it takes up means that even if you rarely use Windows Sandbox, having it enabled is almost zero cost, with it only consuming about 100 MB of space for its VHD.

High DPI Updates Application Updates
Comments Locked

71 Comments

View All Comments

  • Brett Howse - Saturday, May 25, 2019 - link

    If you want persistent you'd have to use full Hyper-V which is available on Pro. Docker also works if you'd prefer small footprint.
  • chipped - Saturday, May 25, 2019 - link

    Windows devs are shit, pretty much every app I have on macOS has HighDPI and works perfectly with per monitor awareness.

    I use my 15” rMBP with a FullHD external side by side.

    My colleague has a 4K windows laptop with a FullHD external and he has a horrible experience. He has to change the laptop screen to FullHD so things scale properly.

    It’s been 3 years that’s he’s had this setup, I laugh every time.
  • GlossGhost - Saturday, May 25, 2019 - link

    Indeed, they should first fix all the issues that the DWM imposes with varying refresh rate monitors, like crawling back and crippling the higher refresh rate monitors whenever something hardware accelerated is being shown on the lower refresh rate ones. It's really disturbing but luckily it's mostly an issue when playing games, where if you're running with V-Sync off, the high refresh rate monitor doesn't get affected. And that's the culprit, running a wide desktop area over multiple monitors and sharing the same V-Sync on it, not per-monitor.

    Now to follow up on what you said, I also have an issue with Windows not being able to scale dynamically back and forth properly. It seems like they use pixel-based position and scaling on the elements and the tabs in the apps. Let's say an app that uses Windows Forms, scales by default well, putting it up on the DPI slider, makes it so that you need to extend tabs and fields and resize everything in it, so that it looks alright. Well guess what, when you scale back to standard everything needs to be resized and readjusted again. Tray icons still get blurry after multiple re-scales and resolution adjustments as well. Also, restarting explorer doesn't even show all the active apps in the tray.

    Nobody seems to care about those things though.
  • leexgx - Saturday, May 25, 2019 - link

    I'll guess I'll check what's changed in six months

    all PCs use pro with none targeted to delay feature upgrades for business use (witch is norm 2-3 months after ms has trashed a bunch of PCs) +100 days on feature upgrades +15 days on security updates as you can't trust ms any more to release a security update correctly any more
  • HStewart - Sunday, May 26, 2019 - link

    Wow, Windows Sandbox is by far worth it. Awesome new punctuality.
    From now on my browsing is done in sandbox
  • Koenig168 - Sunday, May 26, 2019 - link

    Good article with a lot of useful information. I'll probably update to this version if there are no major bugs uncovered over the next few weeks.
  • B3an - Sunday, May 26, 2019 - link

    This isn't at all a bad article or anything, but with every single article Anandtech posts on these Win 10 updates, you always miss out a ton of new features/changes.

    I'm not saying to cover literally everything, but i wish you'd at least show more of the new stuff and went in to detail on each. It's always hard to find anywhere that covers all or most of the new features in proper detail (like you did with the Windows Sandbox feature for example)
  • Kamus - Sunday, May 26, 2019 - link

    "Arguably the biggest feature that most people will see is the new Light Theme. Theming is something that is personal, so either you’ll like it or you won’t, but I think it looks clean and refreshing."

    I see this as a regression. The dark theme should be the default for *any* emissive display. The white background on black text has been a terrible idea since the first day some one thought of it.

    "Oh, let's just emulate a white sheet and black ink!" Except, emissive displays aren't a sheet of reflective paper, you are basically staring at a light bulb.

    With that said, I'm a fan of dark themes, not full black back grounds with a 100% paper white text. Those just look horrible because they often lack a lot of context. I think that dark gray backgrounds, combined with white text is the best way to do dark themes.

    Some people advocate for complete darkness on backgrounds for the sake of battery life on OLED panels, but it's a horrible idea:

    Not only does it look bad in the first place, but it will also cause black smear, and the battery savings are already in place with dark backgrounds anyway.
  • zamroni - Tuesday, May 28, 2019 - link

    For peace of mind, postpone the feature update as long as possible (365 days). I stay with 1803 for now.
  • Flunk - Thursday, June 6, 2019 - link

    That "new" search interface looks exactly like the interface you see if you forcibly disable Cortana. This is a real improvement for people who don't know how to hack the registry to get what they want.

Log in

Don't have an account? Sign up now