On my last Blog Post I described a procedure to implement a Windows 7 SteadyState by utilizing differencing VHD files and the "Boot from VHD" feature of Windows 7. It was great to see the enthusiastic response from the community and how much some of you desperately needed such a solution.
However the procedure to implement my solution had many drawbacks: It was difficult to implement all the steps as they required a LOT of manual work. For that same reason deploying the solution to more that 10 PCs was pretty much out of the question. Another drawback was that it required the use of WinPE to handle the VHD files.
I promised to implement a more straight-forward method by using the Microsoft Deployment Toolkit (MDT) to deploy and configure the OS. So here it is! The solution in this Blog Post has many advantages over the old one:
I urge everyone needing to implement a Windows 7 SteadyState scenario to give it a try (Internet Cafes, Kiosks, etc.). I believe that you will find the solution clean and effective. As usual I am eager to receive your feedback on how this solution can be improved further or to address any specific scenarios that you have in mind.
We will need one PC where the Windows Automated Installation Kit (WAIK) and the Microsoft Deployment Toolkit (MDT) will be installed. Both of these are free downloads from Microsoft. We will use these tools with AutoIt scripts to create a bootable ISO from which we will use to automatically install Windows 7 and the SteadyState solution.
Download the Windows Automated Installation Toolkit from here: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=5753. Run the installation. Choose "Windows AIK Setup":
Run the setup wizard and accept the defaults.
Download the Microsoft Deployment Toolkit from here: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=25175. Select either the x86 or the x64 version (depending on the OS you are currently running). Run the setup file and select the defaults on the installation wizard. Note: This solution was tested with the x86 version of MDT.
Download the package containing the Windows 7 SteadyState solution files here.
Create a folder (for example: C:\SteadyState) and unzip the Win7SteadyState.zip files there.
Copy all the files from your Windows 7 DVD to the WIN7CD subfolder.
IMPORTANT NOTE (updated!): ONLY use Windows 7 Enterprise or Windows 7 Ultimate edition media. Other editions or multi-edition DVDs (which include all editions) will not work! You can get a 90-day trial edition of the Windows 7 Enterprise Edition here: http://technet.microsoft.com/en-us/evalcenter/cc442495
UPDATE: Before running "SETUP.exe" make sure that you have set the execution policy in Powershell correctly. Open Powershell (as an administrator) and execute the following command:
Answer "Y" to the Execution Policy Change question and close Powershell. Thanks goes to Brendan for pointing this out!
To automatically create our Windows 7 SteadyState installation ISO we will run the setup.exe script. This script (written in AutoIT) will configure MDT and prepare a bootable ISO which we will use to deploy the solution.
Run the script as a local administrator and wait for it to prepare your bootable ISO file which you will use to install the Windows 7 SteadyState solution to your PCs.
You should see several Powershell scripts executing while the image is prepared.
If you get the following message, click "This program installed correctly":
At the end you should see a Windows Explorer window with the ISO file:
Burn the ISO file to a DVDR.
Boot with your newly created DVDR on the computer you want to install the Windows 7 SteadyState solution.
WARNING: This procedure will completely format your hard disk so make sure you are prepared for this!
The bootable ISO will:
When your PC boots from the ISO you will have to select either the x86 or the x64 installation of Windows 7. Choose whatever version of Windows 7 you used during the creation of the ISO (in Step 4 above):
WARNING: Choosing the wrong OS version here will cause the installation to fail! If that happens simply restart the procedure.
After selecting the proper OS version the install procedure will start automatically. Allow plenty of time for the installation to complete (usually 15-30 minutes).
At the end of the procedure you should see a message that the "Operating System deployment completed successfully". Do not proceed further if you have not received this message.
Click “Finish”. Windows 7 installation (configured for SteadyState) is complete:
Proceed to install and configure whatever you want to be part of your initial Windows 7 SteadyState (install Office or run Windows Update for example).
After you are done simply reboot the machine.
After reboot you are given two options during the start procedure:
The first option (Windows 7) runs your initial State where you can configure it to your liking. Whatever changes you make will be permanent after your next reboot.
The second option (SteadyState) runs the initial SteadyState but any changes you make on it will be discarded on the next reboot.
This is basically it! In case you want to make changes that need to reboot your OS (installing Windows 7 SP1 for example) then simply select the first option after the first reboot. This will ensure that your changes are persistent in your SteadyState.
You can automate further the installation (for example by automating the Microsoft Office installation or a 3rd party program) by modifying the MDT 2010 Task Sequence which was created by the setup script. For further guidance on how to work with MDT 2010 look here: http://technet.microsoft.com/en-us/solutionaccelerators/dd407791
A special thanks goes to The Deployment Guys for automating the deployment of Windows 7 to a VHD file. You can find their solution here.
Panos Macheras Microsoft Infrastructure Consultant
Panos, First - great stuff, a really straight forward guide! This is my first search for SteadyState since we implemented SCT v1 then WSS v2.0 & v2.5 on XP in our cafe nearly 3 years ago! It's given me great hope for a simple, yet robust Win7 solution!
You mention in Q5 & Q7 a reference to FAQ#1 & #5 re: VHD maximum size - but don't provide a link to it - not being a follower of your blog I don't know whether this is a FAQ you maintain somewhere, or whether it's a FAQ off one of the other links. After a few quick excursions to these other pages, I've still not found this elusive FAQ list.
We have gaming PCs which have over 400GB of apps/games, so obviously need to ensure that the VHD solution will cope.
Could you update your doc to give active links to the FAQ sections mentioned.
Thanks for trying out my Win7 SteadyState solution.
FAQ#1 and #5 are from that very same list! So FAQ#1 (for example) is the "How do I change the size of win7.vhd on the OSDisk? " question answered just above. The same for FAQ#5: It is item number 5 in this very list (about System Requirements). No need to look elsewhere.
For a 500 GB VHD, for example, you will need to open ZTIDiskpartVHD.wsf and modify the following line:
DiskPartWrite oExec, "Create vdisk file='c:\win7.vhd' MAXIMUM=30000 type=expandable"
DiskPartWrite oExec, "Create vdisk file='c:\win7.vhd' MAXIMUM=500000 type=expandable"
Well I feel a complete fool with that! Thankyou - I must admit I was looking for a more indepth FAQ about the limits and configs of VHD files. (do you have to allocate 50% blank space for the differential VHD etc)
However, in order to rectify this, I thought I'd give you some quick feedback:
Scenario:I created a clean host build Win7x86 system in a VM, using clean MSDN Win7x86UltimateSP1, installed WAIK, MDTx86, and SteadyState files all installed AND "set-executionpolicy unrestricted" - however, SETUP still getting "ImportOS.ps1 is not digitally signed" error, UNTIL I manually UNBLOCKED each and every file in the SteadyState prep dir by RH-Clicking, properties, UNBLOCK - then the SETUP script created an ISO. (if you can't see UNBLOCK within properties then it's already done)
I then took this ISO into another clean VM, booted into x86 and began to build. Unfortunately within seconds, a big red error box, 1 error, 2 warnings about "end tag 'os' does not match the start tag 'variable'..." and then lots of debug dump.
I thought I'd created the perfect clean build and test environments, but I still can't get further. The investigation continues.
You can read an in-depth explanation of VHD files here:
Thanks for sharing your experience on how to unblock the setup files. It seems that different installations require different things to make the scripts to work (for example on my VMs the only thing required is the set-executionpolicy command).
Now, regarding the error you are getting during setup: This error usually means that an XML file is badly formatted. Please try to install the solution again on a brand new VM (if you didn't try that already). Sometimes when you get an error during setup
you need to cleanup C: and the boot sector to make the bootable ISO working again so using a brand new VM will give you that.
To investigate further please send me a complete screenshot of the error message you are getting by using the "Email Blog Author" in the "Options" pane on the top-right of the blog.
Please also have a look at the updated note on Step 4 about which DVD media will work. You have to use either Windows 7 Ultimate or Windows 7 Enterprise (x64 or x86 version). Other editions or multi-editions (DVDs that include all editions together) will NOT work with the solution.
Why will other Windows editions (like Professional) not work? It would be nice to know the reason. Thanks.
This is good stuff Panos. I do have some feedback and a question though. I to like Steve had to right click and unblock all the files downloaded in order for teh ISO to be created so just an FYI on that.
Also I setup the install successfully on a USB drive and installed it on a brandnew machine. The install went fine and I got the the 'Operating system deployment was successful' at the end. While still booted in the 'Windows 7' side I only changed the screen resolution and then rebooted to the 'SteadyState' side. I then went through and deleted random folders and reg keys trying to see if a restart would fix all the issues that say a serious virus could cause. While after rebooting the computer I got an error message:
Windows Boot Manager
Windows Failed to start
Info: An error occurred while attempting to read the boot config data.
No matter how many reboots it comes back. I have tried to do this with 2 different USB drives and 2 different computers with the same result.
Any ideas why this would happen?
Hi this is just what i was looking for, here's my question how would i combine this steady state to an already prepared (all applications installed and configured) captured image, or computer.
This is really great work. I am trying to get a test system configured but I am running into trouble when I go to make the ISO. When I run the setup.exe, it does not complete and give me an AutoIT error reading:
Line 37 (File: C:\SteadyState\Win7SteadyState1.0\SETUP.exe)
Error Subscript used with non-Array variable
I'm completely new to scripting so I was hoping you might be able to shed some light on this for me. Thanks and keep up the great work!
Great work here!
I am having a problem getting my ISO's created. When I run setup.exe, I get the following error:
Line 37 (File: C:\SteadyState\SteatdyWinSteadyState1.0\Setup.exe)
Error: Subscript used with non-Array variable.
Any help would be greatly appreciated!
Me to i get the same error and i dont know what to do , any help please ?
This is a very good tutorial! Can I apply Your method to already installed PCs? I installed all computers in our schools lab, and I don't want to do all over again. I saw I can copy the existing system to a wim file, then I can apply that file to a vhd. Can I use that vhd file with your solution?
Thanks in advance!
I suggest additional steps because I tested them:
1) Many Win 7 ultimate DVDs contain remains of multi-editions although you cannot recognize them during the installation. To remove these remains, copy contents of Win 7 in the folder "Win7SteadyState1.0\WIN7CD" and then go to the folder "sources" to remove any clg file for any other edition and use the free open source "gimagex v. 2.0.17" to delete any image index for any other edition in "install.wim" without mounting.
2) If you use Win 7 SP1, you need to install "WAIK supplement for Windows 7 SP1" as update to "WAIK". To install it, use the following steps: Emulate the iso file with the free open source emulator "WinCDEmu" and then if Waik is installed in C while D is the emulated disk for WAIK update, then run "Command Prompt" with "Run as administrator" on right click:
a) xcopy D:\ "C:\Program Files\Windows AIK\Tools\PETools" /ERUY
It must copy 134 files.
b) xcopy D:\*winpe-dot3svc* "C:\Program Files\Windows AIK\Tools\PETools" /ERY
It must copy 82 files.
Hi Panos, I'm testing this solution in a laptop, but with problems, sometimes when I change the wallpaper, and then restart, the wallpaper remains.I reinstall several times but the problem continues not always have the same behavior.
I am getting the same error as Omar M. Any ideas? I am using a Win7wSP1 Ent media