Profilo di StevenDevelopmentalBlogElenchi Strumenti Guida

Blog


30 settembre

Developer Machine Builds for Real Men (and women) - WDS, WinPE, ImageX and Sysprep

I like to rebuild my machine a lot. I usually install every beta under the sun, and my HDD is usually fragmented within a day of rebuild. So I need an efficient process around rebuilding my desktop and my laptop for developer use. Installing Vista Ultimate followed by Office, VS2005/2008, Sql 2005/2008, Visio, Project, Expression Suite, SysInternals, Reflector, Fiddler, Twhirl, Live Writer/MSN, Firefox, Opera; the list is endless. And these are my standard day to day tools.

Enter WDS : Windows Deployment Services. Like most developers I have a Server 2008 license (either through TechNet, MSDN, or handed out at any user group these days!) and one of the 'Roles' is WDS. This software lets you specify a boot image and a build image to be deployed via the network. It operates with WIM files, which contain all the information to build a particular operating system and software.

For example, if you load up your Vista or Windows Server DVDs, you will find a boot.wim and install.wim on those disks. Microsoft uses WIMs for deploying operating systems already, so the infrastructure is already here to build our own WIMs and deploy them. But instead of building a DVD, we'll deploy via a network so that any machine at home can be reimaged at any time.

WinPE is a boot environment that gives us a command prompt. Generally WinPE is something you boot into, instead of your normal operating system. In fact, there is a boot.wim that contains WinPE, and its available in the Windows Assisted Installation Kit (WAIK) in x86 and x64 varieties.

Sysprep is a tool build into Vista already. Usually hiding out at C:\Windows\System32\Sysprep, you can also hit it from the Vista Search prompt. It has a command line mode and a window mode. Sysprep performs a very interesting task. It will strip your current installation of all operating system logic such as language, domain, etc. This is known as the "Out of the box" experience (OOTB). If you run Sysprep and reboot, then you will be prompted for all the usual system information, time/date settings, etc. But once you fill those in, you will see your system still has all the programs installed, etc. All it does is "prep" the system for setup.

Finally, ImageX is a command line tool used to image a machine and create a WIM file. Using this tool we can image a full installation and create an install.wim for our developer machine. Combined with Sysprep, we can create a WIM file that has been stripped of machine specific information.

So how do we put it all together? Here's some steps around what I've done to give you an idea what's need to get this puppy rolling.

A) Build your development machine with all the software you want. I found it easy to do this in a virtual machine; I was already using hyper-V on my 2008 server so this suited my needs. The cool thing here is that I've taken a snapshot after every software install, so in future if I want to build a machine with less software, I can just apply the relative image, then continue the steps below.

B) Sysprep the machin with the OOTB experience, and shut it down

C) On the machine running WDS, add the WinPE WIM as a boot image

D) Also on WDS, create a new SHARE where we can put new image files. Make sure you have an account with full access to this folder; doesn't matter if it is password protected, we will see options to specify auth later.

E) In the share folder, create sub folders called BIN and IMAGES. Copy the binaries from WAIK into the BIN folder (from C:\Program Files\Windows AIK\Tools\x86 or similar). Leave IMAGES empty; this is where we will put our developer image.

E) Start up the developer machine again; it should detect your WDS and ask you to press F12 : press it!

F) You will be prompted to choose a boot image. If you have more than one, ensure you choose the WinPE option. This will dump you at a command prompt eventually.

G) We have to map a network drive to our share on the WDS server. For that we use 'net use' command:  net use z: \\server\share
This will prompt for user and password. If you have any problems with the 'net' command, just try 'net /?' or 'net use /?'

H) Time to image: go to Z:\BIN and you should see the files from before, including ImageX. Type this command: imagex /capture c: z:\images\install.wim "Vista Developer Machine" /verify
This will capture the local C: to the images folder. If you want to image a different drive then feel free.

WARNING: Be prepared to wait. Imaging takes a while, and the bigger your image/slower your network, the worse it gets. For me, it took about 24 hours, for a 18Gb image on my main network. Think about optimisations for this. For example, if you are imaging a VM and WDS is another VM on same machine, create a virtual network between the two. That way communication never leaves the host machine.

I) Once imaged, you can close your developer VM. Go back to the WDS machine and add the new image file as an install image. You will also need to add another boot image since WinPE boot image will not boot to the installer. As mentioned earlier you can find boot.wim files on your Vista and Windows Server DVDs. I suggest the latter (which can be used to deploy Vista and Server 2008 images). Now you have a boot image and developer machine install image.

J) Test it: provision a new VM (or host machine) and do the network boot thing again (F12). This time the Server 2008 boot image is an option, select it. Start following the prompts and you will eventually get an option to select an installation - Select your developer machine.

WARNING: Be prepared to wait again! Once again, the imaging takes a while.

K) After system finishes deploying you should have a full working developer machine!

Further Notes

The waiting times are somewhat annoying. Creating the machine image is something you really only have to do once, but you might want to automate it a little more to make it easier to deploy versions of a VM (snapshots) with a quick click of a button or PowerShell script. You could modify the WinPE boot.wim image to incorporate the ImageX tools, and a batch file so that you don't have to keep coming back to this article for reference. In fact, an autoexec.bat might even work bundled into your WinPE image.

Building async in a separate VM can be slow but at least you can provide a nice structure for reusability, while still using your dev machine. Then leave it to reimage over a weekend or whatever when its needed. And you can obviously reimage multiple machines. WDS is great because you can also copy the install.wim files from Vista and Server across as well and deploy those if needed. Basically, no need for hard media any more. =)

Commenti (8)

Attendere...
Il commento immesso è troppo lungo. Immetti un commento più breve.
Immissione non effettuata. Riprova.
Impossibile aggiungere il commento al momento. Riprova più tardi.
Per aggiungere un commento è necessaria l'autorizzazione di un genitore. Chiedi autorizzazione
I tuoi genitori hanno disattivato i commenti.
Impossibile eliminare il commento al momento. Riprova più tardi.
Hai raggiunto il numero massimo di commenti pubblicabili giornalmente. Riprova tra 24 ore.
Impossibile lasciare commenti. La funzionalità è stata disattivata perché i sistemi hanno rilevato una possibile attività di spamming dal tuo account. Se ritieni che il tuo account è stato disattivato per errore, contatta il supporto tecnico di Windows Live.
Esegui il seguente controllo di protezione per completare la pubblicazione del commento.
I caratteri digitati nel controllo di protezione devono corrispondere ai caratteri dell'immagine o della riproduzione audio.

Per aggiungere un commento, accedi con il tuo Windows Live ID (se utilizzi Hotmail, Messenger o Xbox LIVE possiedi già un Windows Live ID). Accedi


Non hai ancora un Windows Live ID? Registrati

Senza nomeha scritto:
http://www.batteryfast.com/acer/travelmate-3240.htm acer travelmate 3240 battery
http://www.batteryfast.com/asus/al23-901.htm asus al23-901 battery
http://www.batteryfast.com/hp/zt3100.htm hp zt3100 battery
http://www.batteryfast.com/hp/zt3200.htm hp zt3200 battery
http://www.batteryfast.com/hp/zt3400.htm hp zt3400 battery
http://www.batteryfast.com/mitac/e2000.htm mitac e2000 battery
http://www.batteryfast.com/hp/nx7000.htm hp nx7000 battery
http://www.batteryfast.com/hp/presario-x1000.htm hp presario x1000 battery
http://www.batteryfast.com/acer/travelmate-2300.htm acer travelmate 2300 battery
http://www.batteryfast.com/gateway/4000.htm gateway 4000 battery
http://www.batteryfast.com/gateway/m1200.htm gateway m1200 battery
http://www.batteryfast.com/gateway/m1300.htm gateway m1300 battery
http://www.batteryfast.com/acer/aspire-3690.htm acer aspire 3690 battery
http://www.batteryfast.com/acer/aspire-5680.htm acer aspire 5680 battery
http://www.batteryfast.com/acer/aspire-9120.htm acer aspire 9120 battery
http://www.batteryfast.com/compaq/nx9000.htm compaq nx9000 battery
http://www.batteryfast.com/compaq/nx9005.htm compaq nx9005 battery
http://www.batteryfast.com/compaq/nx1050.htm compaq nx1050 battery
http://www.batteryfast.com/dell/312-039.htm dell 312-039 battery
http://www.batteryfast.com/hp/hstnn-db11.htm hp hstnn-db11 battery
http://www.batteryfast.com/hp/hstnn-fb44.htm hp hstnn-fb44 battery
http://www.batteryfast.com/hp/nc6000.htm hp nc6000 battery
http://www.batteryfast.com/hp/nx5000.htm hp nx5000 battery
http://www.batteryfast.com/hp/nw8000.htm hp nw8000 battery
http://www.batteryfast.com/hp/v1000.htm hp v1000 battery
http://www.batteryfast.com/sony/vgp-bpl2c.htm sony vgp-bpl2c battery
http://www.batteryfast.com/toshiba/pa3451u.htm toshiba pa3451u battery
http://www.batteryfast.com/toshiba/pa3457u.htm toshiba pa3457u battery
http://www.batteryfast.com/toshiba/pabas067.htm toshiba pabas067 battery
http://www.batteryfast.com/toshiba/satellite-x200.htm toshiba satellite x200 battery
http://www.batteryfast.com/asus/al23901.htm asus al23901 battery
http://www.batteryfast.com/asus/al241000.htm asus al241000 battery
http://www.batteryfast.com/hp/hstnn-db36.htm hp hstnn-db36 battery
http://www.batteryfast.com/hp/b1900.htm hp b1900 battery
http://www.batteryfast.com/hp/hstnn-db02.htm hp hstnn-db02 battery
http://www.batteryfast.com/hp/dp399a.htm hp dp399a battery
http://www.batteryfast.com/dell/inspiron-9200.htm dell inspiron 9200 battery
http://www.batteryfast.com/laptop-ac-adapter/universal/universal-12-20V-120W-universal.php
http://www.batteryfast.com/acer/btp-63d1.htm acer btp-63d1 battery
http://www.batteryfast.com/acer/aspire-3020.htm acer aspire 3020 battery
http://www.batteryfast.com/acer/aspire-3610.htm acer aspire 3610 battery
8 Nov.
Senza nomeha scritto:
http://www.bestlaptopbattery.com.au/ibm/thinkpad-t42.htm Ibm thinkpad t42 battery
http://www.bestlaptopbattery.com.au/ibm/thinkpad-t42p.htm Ibm thinkpad t42p battery
http://www.bestlaptopbattery.com.au/ibm/thinkpad-t43.htm Ibm thinkpad t43 battery
http://www.bestlaptopbattery.com.au/ibm/thinkpad-t43p.htm Ibm thinkpad t43p battery
http://www.bestlaptopbattery.com.au/ibm/thinkpad-t60.htm Ibm thinkpad t60 battery
http://www.bestlaptopbattery.com.au/ibm/thinkpad-t60p.htm Ibm thinkpad t60p battery
http://www.bestlaptopbattery.com.au/ibm/thinkpad-t61.htm Ibm thinkpad t61 battery
http://www.bestlaptopbattery.com.au/ibm/thinkpad-x40.htm Ibm thinkpad x40 battery
http://www.bestlaptopbattery.com.au/ibm/thinkpad-x41.htm Ibm thinkpad x41 battery
http://www.bestlaptopbattery.com.au/ibm/thinkpad-x61t.htm Ibm thinkpad x61t battery
http://www.bestlaptopbattery.com.au/ibm/thinkpad-z60m.htm Ibm thinkpad z60m battery
http://www.bestlaptopbattery.com.au/ibm/thinkpad-z60t.htm Ibm thinkpad z60t battery
http://www.bestlaptopbattery.com.au/ibm/thinkpad-z61e.htm Ibm thinkpad z61e battery
http://www.bestlaptopbattery.com.au/ibm/thinkpad-z61m.htm Ibm thinkpad z61m battery
http://www.bestlaptopbattery.com.au/ibm/thinkpad-z61p.htm Ibm thinkpad z61p battery
http://www.bestlaptopbattery.com.au/mitac/8050.htm Mitac 8050 battery
http://www.bestlaptopbattery.com.au/mitac/8375.htm Mitac 8375 battery
http://www.bestlaptopbattery.com.au/mitac/8575.htm Mitac 8575 battery
http://www.bestlaptopbattery.com.au/mitac/8575a.htm Mitac 8575a battery
http://www.bestlaptopbattery.com.au/mitac/8575p.htm Mitac 8575p battery
http://www.bestlaptopbattery.com.au/mitac/8x75.htm Mitac 8x75 battery
http://www.bestlaptopbattery.com.au/mitac/bp-8050.htm Mitac bp-8050 battery
http://www.bestlaptopbattery.com.au/mitac/bp-8089.htm Mitac bp-8089 battery
http://www.bestlaptopbattery.com.au/mitac/bp-8089p.htm Mitac bp-8089p battery
http://www.bestlaptopbattery.com.au/mitac/bp-8089x.htm Mitac bp-8089x battery
http://www.bestlaptopbattery.com.au/mitac/bp-8389.htm Mitac bp-8389 battery
http://www.bestlaptopbattery.com.au/mitac/bp-8599.htm Mitac bp-8599 battery
http://www.bestlaptopbattery.com.au/mitac/bp-8x99.htm Mitac bp-8x99 battery
http://www.bestlaptopbattery.com.au/mitac/e2000.htm Mitac e2000 battery
http://www.bestlaptopbattery.com.au/mitac/e680.htm Mitac e680 battery
http://www.bestlaptopbattery.com.au/mitac/mam2080.htm Mitac mam2080 battery
http://www.bestlaptopbattery.com.au/mitac/mim2120.htm Mitac mim2120 battery
http://www.bestlaptopbattery.com.au/mitac/mim2130.htm Mitac mim2130 battery
http://www.bestlaptopbattery.com.au/nec/m300.htm Nec m300 battery
http://www.bestlaptopbattery.com.au/nec/m500.htm Nec m500 battery
http://www.bestlaptopbattery.com.au/nec/op-570-75901.htm Nec op-570-75901 battery
http://www.bestlaptopbattery.com.au/nec/pc-vp-wp44.htm Nec pc-vp-wp44 battery
http://www.bestlaptopbattery.com.au/samsung/nc10.htm Samsung nc10 battery
http://www.bestlaptopbattery.com.au/sony/12-cell-vgp-bpl5a.htm Sony 12-cell vgp-bpl5a battery
http://www.bestlaptopbattery.com.au/sony/12-cell-vgp-bps5.htm Sony 12-cell vgp-bps5 battery
http://www.bestlaptopbattery.com.au/sony/12-cell-vgp-bps5a.htm Sony 12-cell vgp-bps5a battery
http://www.bestlaptopbattery.com.au/sony/bpl5.htm Sony bpl5 battery
http://www.bestlaptopbattery.com.au/sony/bps5.htm Sony bps5 battery
http://www.bestlaptopbattery.com.au/sony/bps5a.htm Sony bps5a battery
7 Nov.
Michael Brownha scritto:
In a Hyper-V environment, I just use System Center Virtual Machine Manager...it's phenomenal :)
26 Apr.
Senza nomeha scritto:
When the <a href="http://www.game4power.com/">Wow Gold </a> wolf finally found the <a href="http://www.game4power.com/">Buy Wow Gold</a>hole in the chimney he crawled <a href="http://www.game4power.com/buy-gold/">wow gold cheap </a> down and KERSPLASH right into that kettle of water and that was <a href="http://www.wowgoldone.com/"> cheapest wow gold </a> the end of his troubles with the big bad wolf.

<a href="http://www.game4power.com/">game4power</a>,<a href="http://www.game4power.com/buy-gold/">buy cheap wow gold</a>

The next day the <a href="http://www.wowgoldone.com/"><strong> cheap wow gold </strong></a><a href="http://www.game4power.com/">buy gold wow</a> little pig invited his mother over . She said "You see it is just as I told you. The way to <a href="http://itemchannel.com">wow gold</a>get along in the world is to do <a href="http://www.itemchannel.com/">world of warcraft gold</a> things as well as you can." Fortunately for that little pig, he <a href="http://www.game4power.com/buy-gold">cheapest wow gold</a> learned that lesson. And he just lived happily ever after!
3 Apr.
Steven Nagyha scritto:
Just ran a test on a spare PC, it took just over 1 hour to deploy my image via the network. This is a fantastic gain in productivity. Imagine rolling out developer machines in your organisation in only 1 hour? I'm now going to use this process to deploy over the laptop I am typing this message on. I hope to be back in action in 1 hour (plus drivers/email setup).
3 Ott.
Steven Nagyha scritto:
Its worth stating my specific environment for those looking at the performance aspects.
The server I run from runs Server 2008 Enterprise and only runs HyperV. It then runs a VM for active directory for my home network, a VM for Server 2008 running WDS, a VM for the development machine, and a VM being deployed to. There are other VMs that are turned off currently. The server is quad core with 8Gb RAM. The WDS server is on the domain, but the Developer VM is not, and of course the deploy-to VM is not. The network deploy could (should) have been optimised with a virtual network instead of my physical network.
 
You can also remove WDS from the situation and use a portable hard drive to store your boot.wim and install.wim. Some other configuration might be required to get it to boot. Also, the imaging process with WinPE and ImageX can also be done via a DVD however I tried this first and had problems hacking together various files. I found it easier to just use WDS.
30 Set.
Steven Nagyha scritto:
It took about 12 hours to deploy via network. I have a feeling that it is unpacking files and sending those across the network, but can't really prove it!
30 Set.
Immagine di Anonimo
Adam ha scritto:
So how long did the actual re-image take?
30 Set.