Replicating SteadyState in Windows 7

Yes, you can create physical snapshots in the latest Windows OS!

One of my favorite virtual machine (VM) features is snapshots. Want to test something messy on your VM but don’t want to risk the necessity to rebuild the system from scratch afterward? No problem! Just take a snapshot. When you’re done with the experiment, the cleanup is just as easy as clicking Undo, and you’re quickly back where you started.

As many readers know, snapshots are more than just a convenience. Many educational institutions support uncountable numbers of physical (not virtual) student machines, all of which need to be restored to their just-like-new pristine state after every class. Now, Microsoft used to offer a free tool called SteadyState that did just that thing for Windows Vista and Windows XP, but it failed to do so for Windows 7. So, as I promised last month, this month I want to show you how to create your own home-made SteadyState functionality for Windows 7 Enterprise and Ultimate editions. Expect this solution to be a bit rough-edged at first, but I'll examine some streamlining ideas in future columns.

You can implement physical snapshot/recovery capabilities for a physical Window 7 system by combining two technologies that I’ve covered in past columns: Windows 7 Enterprise/Ultimate’s boot-from-VHD capability (“Booting Windows 7 Enterprise or Ultimate from a VHD File,” InstantDoc ID 129377), and those OSs' ability to natively support a kind of VHD called a “differencing disk” ("Diskpart Takes Snapshots of Physical and Virtual Systems,” InstantDoc ID 125233).

First, get your desktop on a VHD. You can use the procedure explained in “Creating a Bootable VHD” (InstantDoc ID 129194) or “Creating Bootable VHDs with Disk2VHD” (InstantDoc ID 125422) to set up a Windows 7 system as a bootable VHD. Call that file baseimage.vhd. (Be very sure to make baseimage.vhd an expandable VHD—not a fixed-size one—or you won’t be able to create a snapshot.) Next, you’ll want to install baseimage.vhd as a second boot option on your computer, as you read in “Creating a Bootable VHD," so copy that file to your computer and put it in a folder named C:\VHDs.

Second, using the Bcdedit commands you saw in “Booting Windows 7 Enterprise or Ultimate from a VHD File,” configure your system to boot from baseimage.vhd. At that point, use the new option to boot from baseimage.vhd and do whatever you need to get your system just the way you’d like it, prior to snapshotting it.

Now, it's time to create the snapshot. You want to be able to boot from baseimage.vhd while at the same time being able to undo any changes to baseimage.vhd, so you'll tell Windows 7 to leave baseimage.vhd unchanged and instead write any changes to a different VHD by creating a new VHD that is neither fixed nor expandable, but is instead a differencing VHD associated with baseimage.vhd. Windows refers to the original VHD as the parent VHD and the new differencing VHD as the child VHD. Windows won't let you create a child VHD to an in-use parent VHD, however, so before you can create a child for baseimage.vhd, you need to reboot to the original Windows image on the computer's C drive to free up baseimage.vhd.

Now, open Diskpart and type

create vdisk file=c:\vhds\snapshot1.vhd parent=c:\vhds\baseimage.vhd

Then, type exit to get out of Diskpart.

Just one more step, and you're in business. Using the Bcdedit commands that you used to enable your system to boot from baseimage.vhd (again, your system’s second boot option), create a third boot option, booting this time from C:\vhds\snapshot1.vhd.

Boot from that third option, and from this point on baseimage.vhd remains unchanged, and all changes go into snapshot1.vhd. You can then modify your system however you like and, when you want to return things to their pre-snapshotted state, just reboot into the first of your three boot options, open an elevated command prompt, and type

del c:\vhds\snapshot1.vhd
diskpart
create vdisk file=c:\vhds\snapshot1.vhd parent=c:\vhds\baseimage.vhd
exit

After a reboot—again, into the third option—your system is back to its base state. As before, any new changes will go into snapshot1.vhd, and if you ever want to return to the “pristine state,” just recreate the above commands to continue to use the third boot option.

If you want to update baseimage.vhd in some way, you have two choices. Either boot to the second option and do your maintenance (the second option writes all changes to baseimage.vhd) or, if you like the changes that you’ve wrought to snapshot1.vhd and want to keep them, boot from the first option and merge snapshot1.vhd into baseimage.vhd like so:

diskpart
select vdisk file=c:\vhds\snapshot1.vhd
merge vdisk depth=1
exit
del c:\vhds\snapshot1.vhd

Yes, I know, it's a bit kludgy. But try it out. I think you’ll see that it’s a viable replacement for SteadyState. As to the kludgy part? Well, I’ve got a few ideas to smooth that out, and I'll start examining them next month.

Discuss this Article 6

scoleby
on Apr 20, 2011
For those that want to use what is available in win7 without buying third party products, this article is really useful. I work at an educational establishment (about to change to win 7) and will certainly be trying this out. Thanks Mark for another great article.
anonymuos
on Mar 23, 2011
Hardly as easy as SteadyState. I might as well buy DeepFreeze for EASE OF USE. Microsoft had SteadyState almost built-in to Windows 7 but this nonsensical trend of removing features prevailed.
irowley
on Apr 20, 2011
I think one of the major points being missed here is the functionality that SteadyState provided that is no longer available in Windows 7. It's not about returning a PC to a given state - we can all do that with a variety of tools (deep freeze, reimaging, Ghost etc.). It's about getting the PC into that "state" in the first place - building the image/environment. For many SteadyState was the ideal tool for creating "kiosk" type environments where there was a lack of resource or skills to manipulate GPO's, regesitry keys etc. It doesn't matter how many articles are written like this, it does not get away from the fact that Microsoft have removed customer-valued functionality that is incredibly difficult for many to replicate on the Windows 7 platform. Regards Ian

Please or Register to post comments.

IT/Dev Connections

Las Vegas
September 30th - October 4th

Paul ThurottYou'll have the opportunity to experience:
• The Microsoft
Technology Roadmap
• Office 365 Implementation
• Hyper-V Optimizing
• Windows 8 Deployment
and much more!

Come See Paul Thurrott & Rod Trent in Person!

Early Registration Now Open

Upcoming Training

Mastering SharePoint 2013: Succeeding, Not Just Surviving

Building on the success of the “Mastering SharePoint 2010” seminars, the presenters have updated the content to cover the latest and greatest SharePoint product: SharePoint 2013. While SharePoint 2013 is relatively new on the marketplace, the presenters have been working with SharePoint 2013 for well over a year, and have implemented it with a number of clients in production environments.

Register Now

Current Issue

May 2013 - The NameTranslate object is useful when you need to translate Active Directory object names between different formats, but it's awkward to use from PowerShell. Here's a PowerShell script that eliminates the awkwardness.

CURRENT ISSUE / ARCHIVE / SUBSCRIBE

Windows Forums

Get answers to questions, share tips, and engage with the Windows Community in our Forums.