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

  • abufrejoval - Friday, May 24, 2019 - link

    Perhaps it is because I was already an adult when the Personal Computer launched in 1981 and a programmer, who’d been using Fortran and Cobol before and trying to find out what BASIC on a PC could do for me.

    PCs were very expensive tools, about the same price as a brand-new premium car: I got myself lots of bleeding edge PCs over the decades, because they were the base of my career. Never bought a new car in my life.

    My PCs were and are my shop, my studio, my office. I depend on them, so I keep them in the best possible state: The notion that somebody else might be managing parts of that space, other than by a very conscious act of delegation, is anywhere from unacceptable to abhorrent.

    So imagine my horror, when I saw Candy Crush tiles flipping on the screen after upgrading a Windows 7 system: This is blasphemy, rape, war, ad-extortion!

    Classic Shell came to the rescue and eventually I learned how to tame even Windows 10 to the point where it wouldn’t phone home on every click or tock. Unfortunately, the wonderful, wonderful person who developed and maintained it for years, eventually changed priorities, but so far, it just continues to work as it should, giving a Windows 7 like experience to whatever Microsoft wrongly believed they could do better afterwards.

    I read reports lately, that you could actually hijack tiles on the start menu, because of a combination of an “Internet first” design and gross negligence by Microsoft…. Why does that not surprise me?

    Designing an “operating system” as a theme park is an Apple invention, and I only wish Steve Jobs were still alive to enforce nobody duplicating that nonsense on Personal Computers.

    The 1903 update gave me a scare, because it reported that an “administrative guideline” had blocked the Classic Shell reconfiguration. Now, who but me is the administrator on my Personal Computers and I certainly didn’t block Classic Shell from taking over!

    Re-ran the command in an Admin shell and that spooky message went away. But somehow I think that the 1909 release will finish off Classic Shell for once and forever… I don’t know what I’ll do, but Candy Crunch is enough of a threat to get out the big guns: Been testing Linux desktops since Linus started shaving and Proton is getting better: Yes, I do *also* game on my PCs. I even watch movies or “streams”.

    It still doesn’t mean I mistake them for Disney Land or that anyone but me should be God on them.
  • Alexvrb - Friday, May 24, 2019 - link

    That's a big wall of text to just say "I'm a stodgey pre-internet drama queen". :P You know you can uninstall pretty much anything on there. What games do you play... Solitaire? You can still download the classic solitaire that released in the early days of Windows, relax. I love old hardware as much as the next aging nerd (mostly consoles to be honest) but that doesn't mean I want them to go backwards. Windows 7 now feels downright old and clunky, if I want nostalgia I'll just install ReactOS.
  • abufrejoval - Friday, May 24, 2019 - link

    "drama queen", well that's a first.

    "wall of text": I use an original IBM PS/2 keyboard from March 1990 these days, a Steinway in a world of e-pianos or less: Had to replace the AT-style keyboards I really liked best, because I needed the curly braces for C/C++ and those were hard to come by on the AT keyboard in German.

    These keyboards did cost more than a good laptop these days, but they make text just roll off your fingers... Guess it shows and I sure couldn't do it with one of these newer and lesser variants or squinting and dabbling on a mobile screen.

    Uninstall: Why should I have to kill rats in a brand new house? Good thing the company is paying for the MSDN because if it was my bucks for the OS, I'd truly rant.

    Games: ARK Survial Evolved mostly, on a GTX 2080ti at 42" 4K screen using an 18-Core Xeon with 128GB of DDR4 ECC RAM: Really old style, I'll admit.

    Also Doom and testing both with Steam/Proton on CentOS and Ubuntu, but also via KVM GPU pass-through on a Window 10 VM with the Linux host.

    ReactOS is all wrong: Who would want an NT undercarriage, when Linux delivers so much more horsepower? It's the Windows applications that make Windows attractive as a platform, not the OS itself: That's a pile of crap, ever since David Cutler got sidelined.
  • Agent Smith - Saturday, May 25, 2019 - link

    There’s a huge difference between ‘posting a comment’ people will actually read and your version, ‘Post a Book’.
  • abufrejoval - Friday, May 24, 2019 - link

    Started to run the update on the dozen or so Windows machines I have running, for work and for fun.

    A brand new Lenovo S730 i7 with 1TB of NVMe, took hours to go from 1803 to 1809, but only one hour to take the next step to 1903.

    But that's were things started going down hill: Most other machines just took a lot of time, certainly hours, to run the upgrade: Mind you, nothing around here still runs the OS on spinning rust, below quad logical cores or three full Gigahertz... yet, single threaded and painfully slow it went... if in fact it did: So far two systems failed somewhere beyond the 90% mark and went "much ado about nothing" or back to 1809.

    Couldn't tell you what kept them at that stage, because they really are rather similar, because I try to make that so (honestly, quite a few of them actualy started off as clones, because that works so well and so much faster these days. Turns out, that Microsoft itself has elevated cloning to the default installation method, but they like to take it s l o w l y).
  • Korguz - Saturday, May 25, 2019 - link

    " spinning rust " sorry.. but that is the dumbest term i have ever seen to refer to a mechanical hard drive..
  • Axiomatic - Friday, May 24, 2019 - link

    MSDN Sub here, I've used 1903 for about a week now and I really like it. Also being a gamer I can attest that 1903 has not introduced any issues for gaming that I know of.
  • Kougar - Friday, May 24, 2019 - link

    I actually wanted to update, but it looks like my desktop isn't being offered the May 2019 update yet. Wish MS would actually notify users the specific reason(s) why major version updates are being withheld as this is becoming a common trend with my rigs.
  • TheWereCat - Friday, May 24, 2019 - link

    just get the ms update tool?
  • Alexvrb - Friday, May 24, 2019 - link

    They've actually got a pretty good known issues page now that would give you some insight as to what major bugs they may have encountered with certain hardware/configs that could lead to a blocking bug, and the status of them

    https://docs.microsoft.com/en-us/windows/release-i...

    But with that being said what you're experiencing is more than likely just the effect of a gradual rollout, which is noted at the top of that page as well. Try again in a few days, or as TheWereCat said get the Windows 10 Update Assistant.

Log in

Don't have an account? Sign up now