Jump to content

The Art of OEM - nLite & OEM Preinstallation


Your opinion goes here  

141 members have voted

  1. 1. Would you like for Windows Designer Studio to perform most of the operations described in this guide?

    • Yes, and I want more features too!
      69
    • Yes
      13
    • No, I'd rather stick with the plain old Windows Setup routine.
      5
    • No, it's just a waste of time; nLite/vLite will always be enough for my needs.
      7
  2. 2. Now that this guide is complete, are you happy with its contents?

    • Yes, it's a great idea!
      63
    • Somewhat, I used some of the things described here.
      20
    • Probably, but it is too complex for me to handle.
      7
    • No
      4
  3. 3. Which of these should benefit you the most and you'd like to see first in Windows Designer Studio? (more details soon)

    • Windows Setup SDK (Panther Engine) - WIM capture, Setup customization and ISO making, like in Parts 3 and 4
      46
    • VKEY Explorer - an advanced tool to design the registry of the OS you are designing
      5
    • Package Designer - a set of diff and compression tools to allow you to author/create/add/remove windows components and preinstalled apps
      18
    • VM Workbench - an extension for the free VMware Player product to test the results of your work before finalizing
      10


Recommended Posts

2.5.6. Codename Quattro and Freestyle - Extra Stuff

The setup for WHS is quite poorly designed, as you've probably found out by now. The latest CTP is even worse than Beta 2 from the setup's point of view. They should have sticked to 2-CD media, like Codename Freestyle (Media Center 2005).

The WHSOC.INF is mostly a dummy:

[version]
signature="$Windows NT$"
ClassGUID={00000000-0000-0000-0000-000000000000}
LayoutFile=layout.inf
Provider=%Msft%
DriverVer=10/01/2002,5.2.3790.3959

[Optional Components]
WhServer

[WhServer]
OptionDesc = %COMP_OPTIONDESC_WHS%
Tip = %COMP_OPTIONDESC_WHS_TIP%
IconIndex = 0

CopyFiles = WHS_Bin
AddReg = WHS_Reg

[WHS_Reg]

HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\CustomBrand\{F20B21BE-5E3D-11d2-8789-68CB20524153}", "DontPaintText", 0x10001, 0x00000001
HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\CustomBrand\{F20B21BF-5E3D-11d2-8789-68CB20524153}", "DontPaintText", 0x10001, 0x00000001
HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\CustomBrand\{F20B21C0-5E3D-11d2-8789-68CB20524153}", "DontPaintText", 0x10001, 0x00000001
HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\CustomBrand\{F20B21C1-5E3D-11d2-8789-68CB20524153}", "DontPaintText", 0x10001, 0x00000001
HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\CustomBrand\{F20B21BE-5E3D-11d2-8789-68CB20524153}", , , "whsbrand.dll, -1004"
HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\CustomBrand\{F20B21BF-5E3D-11d2-8789-68CB20524153}", , , "whsbrand.dll, -1001"
HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\CustomBrand\{F20B21C0-5E3D-11d2-8789-68CB20524153}", , , "whsbrand.dll, -1003"
HKLM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\CustomBrand\{F20B21C1-5E3D-11d2-8789-68CB20524153}", , , "whsbrand.dll, -1002"


HKU, ".Default\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Setup\Welcome", "srvwiz", 0x10001, 0x00000000
HKCU, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Setup\Welcome", "srvwiz", 0x10001, 0x00000000

[DestinationDirs]
WHS_Bin = 11

[SourceDisksNames]
1="NT Setup",,0

[SourceDisksFiles]

[WHS_Bin]

[Strings]
COMP_OPTIONDESC_WHS = "Microsoft Codename Quattro"
COMP_OPTIONDESC_WHS_TIP = "Provides the ability to convert this server to a Microsoft Windows Home Server."
Msft = "Microsoft"

The actual installer logic relies on adding tons of hotfixes and packages after the core of Small Business Server is installed. Even more, the default shares in Home Server Console are hard-coded somewhere in the setup routine.

Quite messy, isn't it? And only half of them are actually in that picture. Imagine making unattended packages for nLite for each one of those and getting it right.

In order to get best compatibility with Windows XP apps (mostly games that won't normally launch on the server platform), I will add some data from a Media Center machine in the registry:

HKLM\SYSTEM\Setup

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\Setup]
"SetupType"=dword:00000000
"SystemSetupInProgress"=dword:00000000
"CmdLine"=""
"SystemPrefix"=hex:c9,1b,00,00,00,00,46,52
"SystemPartition"="\\Device\\HarddiskVolume1"
"OsLoaderPath"="\\"

[HKEY_LOCAL_MACHINE\SYSTEM\Setup\AllowStart]

[HKEY_LOCAL_MACHINE\SYSTEM\Setup\AllowStart\AFD]

[HKEY_LOCAL_MACHINE\SYSTEM\Setup\AllowStart\DcomLaunch]

[HKEY_LOCAL_MACHINE\SYSTEM\Setup\AllowStart\EventLog]

[HKEY_LOCAL_MACHINE\SYSTEM\Setup\AllowStart\PlugPlay]

[HKEY_LOCAL_MACHINE\SYSTEM\Setup\AllowStart\ProtectedStorage]

[HKEY_LOCAL_MACHINE\SYSTEM\Setup\AllowStart\Rpcss]

[HKEY_LOCAL_MACHINE\SYSTEM\Setup\AllowStart\SamSs]

[HKEY_LOCAL_MACHINE\SYSTEM\Setup\AllowStart\WS2IFSL]

[HKEY_LOCAL_MACHINE\SYSTEM\Setup\AnswerFileMap]
"ms_tcpip"="{4AF21B38-6480-4EAA-A30E-6AE72BB54601}"
"ms_ndisuio"="{65FAD695-216F-4020-9E44-E4B7C2F7771C}"
"ms_webclient"="{4C7D293F-5229-43B3-B9BE-AA5B1B163A4B}"
"ms_msclient"="{33969587-9062-41C2-B786-7DC52F2809B9}"
"ms_alg"="{2A904767-0E46-49A1-A6D6-67377B7C19D7}"
"ms_gpc"="{7964DC1B-487F-45AB-A8F3-0CB80AABE3BB}"
"ms_server"="{4DB33CA5-809F-4827-A226-BAD7FAFFC5F8}"
"ms_rascli"="{5C89021C-E8FA-451D-8808-13EDF894F885}"
"ms_rassrv"="{218A9586-BF63-48BA-B606-E66E423267F3}"
"ms_wzcsvc"="{D1CA14AE-D2B8-48F1-8C5E-5ADD076EA742}"

[HKEY_LOCAL_MACHINE\SYSTEM\Setup\Pid]
"Pid"="76487000"

And the corresponding WPA entry:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\WPA\MediaCenter]
"Installed"=dword:00000001

You can find here a very good guide of installing Media Center 2005 on Server 2003 that you can use to do this. I don't want Media Center in this case, but just to fake it as being installed. The mediactr.cat, medctroc.inf and ehOCGen.dll should be enough for that purpose.

\Windows\eHome\custsat.dll

\Windows\Inf\medctroc.inf

\Windows\Inf\plusoc.inf

\Windows\Inf\sonic.inf

\Windows\System32\CatRoot

\Windows\System32\EHOCGEN.DLL

\Windows\System32\encdec.dll

\Windows\System32\MEDCTROC.DLL

\Windows\System32\Mpeg2Data.ax

\Windows\System32\msvidctl.dll

\Windows\System32\PLUSOC.DLL

\Windows\System32\quartz.dll

\Windows\System32\sbe.dll

\Windows\System32\sbeio.dll

\Windows\System32\vbicodec.ax

\Windows\System32\wstpager.ax

\Windows\System32\wstrenderer.ax

\Windows\System32\wstrendr.ax

\Windows\System32\CatRoot\{F750E6C3-38EE-11D1-85E5-00C04FC295EE}\MEDIACTR.CAT

\Windows\System32\CatRoot\{F750E6C3-38EE-11D1-85E5-00C04FC295EE}\PLUS.CAT

\Windows\System32\CatRoot\{F750E6C3-38EE-11D1-85E5-00C04FC295EE}\SONIC.CAT

Codename Freestyle finally gets enabled by rundll32 syssetup,SetupInfObjectInstallAction Freestyle 128 medctroc.inf. You will need your Media Center CD to provide the needed files.

2.5.7. Extra apps

In order not to break the WGA detection process in WMP11, only at this point it's safe to install it, because Quattro provides Universal Plug and Play and SSDP Discovery and Freestyle has added the required WPA registry keys for MCE v3.0

To install it, add these using XP compatibility:

- User-Mode Driver Framework Feature Pack 1.0

- Hotfix for Windows XP (KB926239)

- Windows Media Format 11 Runtime

- Windows Media Player 11

th_07580_P2-025_122_450lo.jpg

Picture 25 - WMP11 on Home Server

At this point, install whatever apps you will need to be installed by default with Windows. Apps installed at this point are considered "preinstalled".

For example, System Mechanic 7

th_07581_P2-026_122_570lo.jpg

Picture 26 - System Mechanic 7

which is also a good opportunity to correct erroneous data in the registry.

th_07586_P2-027_122_823lo.jpg

Picture 27 - Performing Tasks

th_07591_P2-028_122_934lo.jpg

Picture 28 - Tasks Complete

Edited by dexter.inside
Link to comment
Share on other sites


2.5.8. Drivers

Similar to Part 1, my drivers are stored in Business Desktop Deployment. You can find them in \Distribution\Out-of-Box Drivers

th_07005_P2-029_122_1020lo.jpg

Picture 29 - Driver Repository

Use the VMware shared folders feature to copy them to the virtual machine. I use \WINDOWS\Driver Cache, it's a very suitable target for this operation. Original drivers (driver.cab) is cached in \WINDOWS\Driver Cache\I386.

th_07011_P2-030_122_513lo.jpg

Picture 30 - Copying Drivers

It's good to use NTFS compression to save space on the destination machine. The setup method described in Part 4 of this tutorial also saves NTFS streams and security. In my case, this saved over 600 Mb of space.

2.5.9. Setup Manager

Unpack DEPLOY.CAB from \SUPPORT on your original disc to C:\sysprep. Home Server uses the same one as Windows Server 2003 SP1.

Setup Manager will configure the needed settings for mini-setup. Run C:\sysprep\setupmgr.exe.

th_07012_P2-031_122_418lo.jpg

Picture 31 - Welcome

th_07013_P2-032_122_568lo.jpg

Picture 32 - Create New

You will need a sysprep.inf file.

th_07014_P2-033_122_376lo.jpg

Picture 33 - Sysprep Setup

Home Server is compatible with Windows Server 2003 Enterprise. Instead of Terminal Server it is based on Small Business Server.

th_07018_P2-034_122_931lo.jpg

Picture 34 - Windows Version

In my case, I am not fully automating the answers.

th_07023_P2-035_122_707lo.jpg

Picture 35 - Not Automated

th_07028_P2-036_122_438lo.jpg

Picture 36 - Name & Organization

These display settings will be used during setup.

th_07033_P2-037_122_838lo.jpg

Picture 37 - Display Settings

Edited by dexter.inside
Link to comment
Share on other sites

th_07039_P2-038_122_477lo.jpg

Picture 38 - Time Zone

th_07252_P2-039_122_863lo.jpg

Picture 39 - Product Key

You can change here the initial restriction of 10 user licenses included in Windows Home Server.

th_07256_P2-040_122_1080lo.jpg

Picture 40 - Licensing Mode

th_07261_P2-041_122_456lo.jpg

Picture 41 - Computer Name

th_07266_P2-042_122_336lo.jpg

Picture 42 - Administrator Password

th_07267_P2-043_122_854lo.jpg

Picture 43 - Networking

th_07268_P2-044_122_381lo.jpg

Picture 44 - Workgroup or Domain

th_07268_P2-045_122_435lo.jpg

Picture 45 - Telephony

th_07269_P2-046_122_940lo.jpg

Picture 46 - Regional Settings

I have added here settings that will clean setup temporary files, created by the setup routine described in Part 3 and 4.

th_07274_P2-047_122_780lo.jpg

Picture 47 - Run Once

Edited by dexter.inside
Link to comment
Share on other sites

This is a string stored in registry to uniquely identify your OEM build.

th_07280_P2-048_122_622lo.jpg

Picture 48 - Identification String

Here's how my sysprep folder looks like.

th_07434_P2-049_122_1157lo.jpg

Picture 49 - Sysprep data

Finally, save your new sysprep.inf file there.

th_07440_P2-050_122_804lo.jpg

Picture 50 - SYSPREP.INF

2.5.10. Other unattended instructions.

I have added some extra instructions in SYSPREP.INF:

;SetupMgrTag
[Unattended]
InstallFilesPath="C:\WINDOWS\Driver Cache\i386"
OemSkipEula=Yes
DriverSigningPolicy=Ignore
UpdateInstalledDrivers=Yes

[GuiUnattended]
EncryptedAdminPassword=NO
AutoLogon=Yes
AutoLogonCount=0
OEMSkipRegional=1
OEMDuplicatorstring="Windows Home Server"

[UserData]
ProductKey=?????-?????-?????-?????-?????
FullName="Windows User"
OrgName=""
ComputerName=*

[Display]
BitsPerPel=32
Xresolution=800
YResolution=600

[LicenseFilePrintData]
AutoMode=PerServer
AutoUsers=100

[SetupMgr]
DistFolder="C:\WINDOWS\Driver Cache\i386"
DistShare=windist

[GuiRunOnce]
Command0="cmd /c "rd %SystemDrive%\$WINDOWS.~BT /s /q""
Command1="cmd /c "rd %SystemDrive%\$WINDOWS.~LS /s /q""

[Identification]
JoinWorkgroup=WORKGROUP

[Networking]
InstallDefaultComponents=Yes

- OemSkipEula=Yes - Skips EULA

- DriverSigningPolicy=Ignore - Don't prompt when installing drivers

- UpdateInstalledDrivers=Yes - Reinstall all present drivers when mini-setup starts. Very important.

In order to successfully make this setup work on any system configuration, you will have to use UpdateInstalledDrivers=Yes, which will clean the entire Device Manager, except non-PnP and HAL. This will ensure that all VMware drivers are removed and your setup will install the proper drivers for the system it is being executed on.

2.5.11. Sysprep Driver Scanner

You will need the Sysprep Driver Scanner to link the drivers you copied to the setup routine. Important -don't store drivers in the sysprep folder. It will be deleted when mini-setup starts.

th_10866_P2-051_122_401lo.jpg

Picture 51 - Sysprep Driver Scanner

You must also add C:\WINDOWS\Inf for this to work, otherwise default drivers won't be detected.

th_10867_P2-052_122_914lo.jpg

Picture 52 - Add Default Drivers

Paths are saved in registry.

th_10872_P2-053_122_1125lo.jpg

Picture 53 - Saved

th_10874_P2-054_122_1139lo.jpg

Picture 54 - Done

Edited by dexter.inside
Link to comment
Share on other sites

2.5.12. Mass Storage

In order for sysprep to work properly, you will need a mass storage section. If you do not add at least this, your image will work only on the same computer, in this case only in VMware, and on different computers will produce a STOP 0x0000007B INACCESSIBLE_BOOT_DEVICE BSoD.

This problem exists because Windows can only load if the boot loader is able to read the files from the extended portion of the disk. So, if it doesn't have the necessary drivers it will fail. The way around is to have sysprep load all the standard drivers for mass storage, so it will have the ability to read from most computer configurations.

- add a [sysprepMassStorage] section at the end of the sysprep.inf file and save it. If you don't, sysprep won't enumerate mass storage devices.

- open a command prompt and run sysprep -bmsd from the C:\sysprep folder.

Sysprep will extract all mass storage devices from Windows and place them in the [sysprepMassStorage] section that you created. When you run the -bsmd command, sysprep should pop up a hourglass like in Picture 55. During the time you see it, it is actively generating the mass storage device list and inserting it into the sysprep.inf file.

th_15468_P2-055_122_566lo.jpg

Picture 55 - Build Mass Storage Section

Here's a sample of what my result was:

 
pci\ven_0e11&dev_ae33=c:\windows\inf\mshdc.inf
pci\ven_1042&dev_1000=c:\windows\inf\mshdc.inf
pci\ven_1039&dev_0601=c:\windows\inf\mshdc.inf
pci\ven_1039&dev_5513=c:\windows\inf\mshdc.inf
pci\ven_10ad&dev_0001=c:\windows\inf\mshdc.inf
pci\ven_10ad&dev_0150=c:\windows\inf\mshdc.inf
pci\ven_1106&dev_0571=c:\windows\inf\mshdc.inf
pcmcia\ibm-microdrive-7f50=c:\windows\inf\mshdc.inf
pcmcia\ibm-microdrive-aa55=c:\windows\inf\mshdc.inf
pcmcia\cl_ata_flash_card_lexar__-hurric_-172f=c:\windows\inf\mshdc.inf
pcmcia\cl_ata_flash_card_lexar__-tidalwv-0e97=c:\windows\inf\mshdc.inf
pcmcia\____cl_ata_flash_card_lexar__-hurric_-dc37=c:\windows\inf\mshdc.inf
pcmcia\cl_ata_flash_card_lexar__-tornado-29ec=c:\windows\inf\mshdc.inf
pcmcia\cl_ata_flash_card_lexar__-tidalwv-fd21=c:\windows\inf\mshdc.inf
pcmcia\lexarmedia_ata_flash_card-hur_hp_-0623=c:\windows\inf\mshdc.inf
pcmcia\sony-memorystick(__4m)-e637=c:\windows\inf\mshdc.inf
pcmcia\sony-memorystick(__8m)-9eb3=c:\windows\inf\mshdc.inf
pcmcia\sony-memorystick(_16m)-d04d=c:\windows\inf\mshdc.inf
pcmcia\sony-memorystick(_32m)-1766=c:\windows\inf\mshdc.inf
pcmcia\sony-memorystick(_64m)-8c2c=c:\windows\inf\mshdc.inf
pci\ven_1055&dev_9130=c:\windows\inf\mshdc.inf
pcmcia\micron-mtcf____-392d=c:\windows\inf\mshdc.inf
pci\ven_1179&dev_0105=c:\windows\inf\mshdc.inf
pci\ven_1166&dev_0211=c:\windows\inf\mshdc.inf
pci\ven_1166&dev_0212&subsys_02121166=c:\windows\inf\mshdc.inf
pci\ven_10de&dev_00e3=c:\windows\inf\mshdc.inf
pci\ven_10de&dev_00ee=c:\windows\inf\mshdc.inf
pci\ven_10de&dev_00e5=c:\windows\inf\mshdc.inf

As you can see, there are a lot of entries in the section (about 690 in Windows XP). These are plug and play identifiers for mass storage drivers and their location. If it didn't insert any, your device path is invalid and you forgot to add the \WINDOWS\Inf path to the Sysprep Driver Scanner. Check it in HKLM\Software\Microsoft\Windows\CurrentVersion\DevicePath. Note that sysprep takes ~1 second to add each entry.

2.5.13. Running Sysprep

th_15469_P2-056_122_487lo.jpg

Picture 56 - Warning

- Grace Period - if this option is unchecked, a evaluation version of Windows will not reuse the 30-60 day ReArm counter.

- Mini-setup - Sysprep will use mini-setup instead of text-mode setup.

th_15472_P2-057_122_585lo.jpg

Picture 57 - Sysprep Options

- Security Identifiers - a SID is a unique computer code that identifies it on the network.

- Detect non-PnP - also scans for non-PnP drivers, like ISA cards. Increases setup time up to 10 minutes and is no longer needed on most computers built after 2000.

th_15473_P2-058_122_766lo.jpg

Picture 58 - Start

- Factory - a more advanced method of creating custom setups. Big OEMs like Dell usually use it.

- Reseal - the method I am describing in this guide.

After the SID warning it's OK to reseal if you've gotten your Windows just the way you like it already.

th_15478_P2-059_122_1183lo.jpg

Picture 59 - Working

This can be a lengthy process, especially if you have thousands of drivers like I do. Sysprep analyzes each of the driver I added in the \WINDOWS\Driver Cache, then all files on the partition, all INFs and log every changes it makes. When it's done, I've chosen to shut down the virtual machine.

In Part 3, you will learn how to image the partition you've sysprepped here, and in Part 4 how to make a setup routine to deploy and install it from that image to any computer.

Link to comment
Share on other sites

Part 3: Windows Imaging

In Part 3 of this tutorial, I will show you how the WIM technology can be used on pre-NT 6.0 Windows builds and how it relates with what you've done so far.

The reseal technique described in Part 2 has these main advantages, bringing portability features created by sysprep:

1. you can change the motherboard and the installed windows will detect and install it (on normal windows this will cause a BSoD).

2. you can clone the entire partition on another computer and boot from it, effectively allowing you to replicate your windows & programs on an unlimited number of computers.

3. you can clone your physical partition directly onto ESX Server/VMFS or VMware Workstation vmdk disks and it will go virtual without any P2V software converters.

4. you can clone it on a usb drive and boot from it (I haven't tested this feature yet).

5. you can Ghost it and restore it on any computer without any additional steps involved.

If you don't want the extra non-PnP drivers loading at boot, you can run "sysprep.exe -clean" to remove them. You won't be able to do the stuff enumerated above anymore.

The imaging technology that was specifically developed for Windows Vista can now bring these servicing features conceived for future Microsoft products in older and more reliable windows builds.

6. perform offline windows rollups and servicing (registry data and windows components) from Windows PE.

7. deploy any pre-configured workstation or server.

8. preinstall any number of applications without having to make unattended packages, no matter how complex or big they are (like Visual Studio, or Office)

9. make a backup of your genuine activated OS and restore it exactly the way it was.

Sounds good? I'm amazed myself from the extent of the stuff I've discovered by putting all this together.

3.1. Microsoft WIM Formats

Edited by dexter.inside
Link to comment
Share on other sites

2.5.12. Mass Storage

In order for sysprep to work properly, you will need a mass storage section. If you do not add at least this, your image will work only on the same computer, in this case only in VMware, and on different computers will produce a STOP 0x0000007B INACCESSIBLE_BOOT_DEVICE BSoD.

This problem exists because Windows can only load if the boot loader is able to read the files from the extended portion of the disk. So, if it doesn't have the necessary drivers it will fail. The way around is to have sysprep load all the standard drivers for mass storage, so it will have the ability to read from most computer configurations.

great guide so far. i'm wondering if it possible to use the universal massstorage driver from Here. one would think that this would help with transfering images from ide to sata drives.

Link to comment
Share on other sites

Yes, by the looks of it, it is possible... you can either:

1) add it as text-mode driver in the initial nLite image, and check if it gets in the [sysprepMassStorage], or:

2) add it yourself as PnP driver, by adding the PCI\VEN_xxxx&DEV_yyyy entries in uata_xp.inf at the end of the sysprep -bmsd generated list, so that it will act as a failsafe when none of the previous entries listed there worked.

Of course, after completing the 4 parts in this tutorial, those who build the final ISO must test it on various non-supported mass storage drivers to see if it actually works. The normal behavior would be for the mini-setup to start, auto-install this driver, complete setup and then prompt you to update the driver. In case it doesn't work, you'd get a BSoD anyways.

You can also test by using it in Windows PE, if it loads there it will also load in the mini-setup. Good finding btw, if this works out we've got ourselves some failsafe to this method. :D

Edited by dexter.inside
Link to comment
Share on other sites

  • 2 weeks later...

I cannot wait for the next part - I'm most interested in capturing a WIM of a fully configured system, but cannot make sense of Microsoft's documentation. Hope to see this somewhat finished in the near future!

Link to comment
Share on other sites

I cannot wait for the next part - I'm most interested in capturing a WIM of a fully configured system, but cannot make sense of Microsoft's documentation. Hope to see this somewhat finished in the near future!

lol, there is no microsoft "official" documentation on how to deploy pre-NT 6 this way... their only attempt is called Codename Eiger

Good news: this guide will soon be available in HTML and PDF in nuhi's guide collection.

Edited by dexter.inside
Link to comment
Share on other sites

Part 3: Windows Imaging

In Part 3 of this tutorial, I continue were we left off with Sysprep. Covered here are two issues of great importance that will greatly enhance the NT deployment experience - one is the Microsoft WIM technology, arguably the best idea that Microsoft Research came up with in the past 10 years and the other is called virtual to physical migration - V2P - a free alternative solution that I managed to make instead of using expensive software like Symantec, Acronis and VMware to migrate a closely tweaked windows installation from a virtual, controlled environment to physical bare metal hardware.

3.1. Some legal considerations

As you may know, WIM is closed source. Although the Vista SDK and WAIK are free to use, the windows setup UI and installer logic capable of reading from a WIM is not. Using components from Vista RTM to install other windows editions this way is a clear violation of the EULA. Fortunately, there is a way around this.

Back in 2004, when Vista was called Longhorn and was based on the NT 5.1 codebase (unlike builds 5xxx that are based on NT 5.2 codebase) the setup was a simple Visual C++ program that used the Beta 1 format of WIMs to install builds 4xxx on your computer. After build 4093, the entire codebase was scrapped and the new Beta 2 WIM format was no longer compatible with the previous one. Microsoft considers the 4xxx builds as abandonware and is no longer interested in what people do with them. You might have heard of some people from the joejoe forums trying to make good use of them. The good part is that I can make some very good use of the Beta 1 format of WIMs, which is also abandonware, along with the Longhorn 4033 SDK. Using these for personal use should not be of any legal concern, the same case as with nLite.

Sysprep is part of the same EULA of it's corresponding NT build, so, as covered by the OEM reseller license, it should be legal to deploy through your organization network evaluations of windows that include the WIM Beta 1 technology, as well as keeping a backup of your licensed retail edition of windows to be deployed with the same technology. This is covered by the same regulations that allow products like Symantec Ghost Suite or VMware V-Motion / Converter. So... enjoy!

3.2. The WIM Beta 1 format

You can get ximage.exe from the Longhorn 4074 install CD or from the Longhorn 4033 SDK. It was renamed to ImageX after Beta 1 was scrapped. It may surprise you to know that Codename Eiger also uses the Beta 1 format instead of later revisions, due to some unknown reason.

I use version 6.0.4059.0 (main.031208-1842), compatible with XML*.DLL schema v2.00.3510.0 (main.031208-1842) and earlier. This was the last release of Beta 1, compatible with all WIMs made before Beta 2. Notice the compile date - December 2003. Eiger uses a different compile of the same code, flagged with a "cjonas" string in the version, both compatible.

Here's how the /? output should look like.

Usage:
XIMAGE /capture [Drive] [Image File] [Description]
XIMAGE /boot [Drive] [Image File] [Description]
XIMAGE /append [Drive] [Image File] [Description]
XIMAGE /apply [Image File] [Drive] [View #]
XIMAGE /script [Script

Commands:
/capture - Creates a new image of a drive
/boot - Creates a new bootable image of a drive
/append - Appends a drive image into an existing image
/apply - Applies an image to a drive
/info - Displays available image views
/script - Specifies an answer script
/scroll - Scrolls output for redirection
/nosis - Stores duplicate files
/nocomp - Stores uncompressed file data
/lznt - Use LZNT1 compression
/lzx - Use LZX compression [default]
/flags - User defined image flags
/verify - Verify duplicate files

Examples:
ximage /capture D: data.wim "Drive D"
ximage /lzx /capture C: cdrive.wim "C Drive"
ximage /lznt /capture E: data.wim "Drive E"
ximage /nosis /nocomp /capture D: data.wim "Drive D"
ximage /scroll /append E: data.wim "Drive E"
ximage /boot D: data.wim "Drive D"
ximage /apply data.wim D: 1
ximage /info data.wim
ximage /script unattend.txt
ximage /flags 128 /capture D: data.wim "Drive D"

Functionality differences from the RTM version are:

- Beta 1 does not support mount/unmount operations, they were added 1 year later.

- There is no mini-filter driver compatible with the resulting WIMs.

- The XML schema is different.

Edited by dexter.inside
Link to comment
Share on other sites

3.3. Needed INSTALL.WIM settings

If we want to create a proper image, we must look for its settings in another that is accepted by the Longhorn setup routine. In this example, I use Longhorn 4074, one of the most popular.

Here's what the /INFO looks like:

Available Image Choices:
------------------------
<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<WIM>
<IMAGE INDEX="1">
<DIRCOUNT>38</DIRCOUNT>
<FILECOUNT>1287</FILECOUNT>
<TOTALBYTES>183629593</TOTALBYTES>
<CREATIONTIME>
<HIGHPART>0x1C42CDF</HIGHPART>
<LOWPART>0x4BE6614</LOWPART>
</CREATIONTIME>
<DESCRIPTION>WinPE Boot Image</DESCRIPTION>
<FLAGS>1</FLAGS>
</IMAGE>
<IMAGE INDEX="2">
<DIRCOUNT>37</DIRCOUNT>
<FILECOUNT>1284</FILECOUNT>
<TOTALBYTES>183629406</TOTALBYTES>
<CREATIONTIME>
<HIGHPART>0x1C42CDF</HIGHPART>
<LOWPART>0x50127EC</LOWPART>
</CREATIONTIME>
<DESCRIPTION>WinPE Drive Image</DESCRIPTION>
<FLAGS>2</FLAGS>
</IMAGE>
<IMAGE INDEX="3">
<DIRCOUNT>1491</DIRCOUNT>
<FILECOUNT>15762</FILECOUNT>
<TOTALBYTES>2612836956</TOTALBYTES>
<CREATIONTIME>
<HIGHPART>0x1C42CEC</HIGHPART>
<LOWPART>0xCA2101A2</LOWPART>
</CREATIONTIME>
<DESCRIPTION>Windows Longhorn pro</DESCRIPTION>
<FLAGS>0</FLAGS>
</IMAGE>
</WIM>

Image #1 contains Windows PE 1.6 (before Beta 2, both BOOT.WIM and INSTALL.WIM were stored together), image #2 contains the drive image of the same Windows PE with setup program added and #3 is the Longhorn image. Thus, the setup program has IMAGE INDEX="3" hardcoded. Also, notice the "0" flags. Both are required by the setup to identify the source image.

3.4. VMware Mount

VMware Workstation 6 has a great feature: the vmount2 service that allows you to mount any partition stored in a VMDK file as a disk in your host OS. I will mount the C: drive from the WHS VM on Z:

You can delete temporary files, like pagefile or hiberfil to save space. Also, you can read what modification sysprep did to your installation in \WINDOWS\setupapi.log. For components, there will also be logs like iis6.log. In my case, I had the services disabled, you can see what happened here:

[5/8/2007 12:5:43] LogFile Open. [***** Search on FAIL/MessageBox keywords for failures *****].
[5/8/2007 12:5:43] SysPrepBackup:start
[5/8/2007 12:5:43] SysPrepBackup:InetStartService():ServiceName=IISADMIN unable to start WARNING. Err=0x422.
[5/8/2007 12:5:44] SysPrepBackup:!FAIL!
[5/8/2007 12:5:44] SysPrepBackup:CoCreateInstance on IID_IMSAdminBase2 failed
[5/8/2007 12:5:44] SysPrepBackup:end,ret=0x80070422
[5/8/2007 12:5:44] Final Check:RtlValidateHeap(): Good.
[5/8/2007 12:5:44] Final Check:LogFile Close.

Thanks to vmount, you will be able to image the drive without having to boot from a rescue disk with ximage on it.

There are some minor issues with sysprepping a nLited OS. The thread is here. It's a good idea to copy the files specified there to the \WINDOWS\Driver Cache\I386 and check \sysprep\sysprep.inf for InstallFilesPath="C:\WINDOWS\Driver Cache\i386" in Unattended section. Even if you don't do this, installation will still succeed, but you will see some annoying prompts regarding missing files during mini-setup.

Edited by dexter.inside
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...