Sysprep: Single Image Intel/AMD & uni/multi-processor with Windows XP

The Windows XP sysprep tool is quite limited in the hardware configurations that it supports. With a few hacks and tweaks you can successfully deploy the same syspreped image to both Intel and AMD hardware and uni-processor as well as multi-processor CPU’s.

Before starting, there are a few assumptions

  • The master hardware is a uni-processor Intel PC
  • It is as old as possible (P4 vintage is good if you can get your hands on them, its what I used)
  • You are competent using sysprep already and simply want to consolidate on the number of images

Uni/Multi-Processor

This part is easy as there is enough documentation around. Unfortunately I cannot remember exactly where I found the solution so I cannot give credit. Add the following line to your unattended section of sysprep

[unattended]
UpdateHAL="ACPIAPIC_MP,%WINDIR%\Inf\Hal.inf"

Intel and AMD

This is a bit harder to achieve. If you image back an image created on an Intel PC to an AMD PC, it will BSOD before mini-setup runs. This is due to the Intel Power Managment driver that runs only if the PC is an Intel. To get around this, the driver needs to be disabled before the sysprep tool is run on the master and then re-enabled after the image is deployed on the target PC’s only if the PC is Intel. This does not break the Intel image and the driver will be re-enabled on the target PC’s if it is identified as an Intel.

First, you will need to create a batch script that disables the Intel driver and then runs sysprep. Create a file called SYSPREP.BAT with the following and put it in your Sysprep directory (EG: C:\sysprep).

@echo off
cd C:\SYSPREP

echo Enabling image for AMD and Intel processors
reg add "HKLM\SYSTEM\ControlSet001\Services\intelppm" /v Start /t REG_DWORD /d 4 /f

echo Running sysprep and shutting down.
sysprep.exe -forceshutdown -mini -reseal -quiet -activated

Next we need to create a VBScript that will be run after the image has been deployed to the target PC and mini-setup has run. This will check for the CPU manufacturer throught WMI and adjust the Intel driver accordingly. Create a file called checkforintel.vbs and enter the following text. You can also download the script here.

' CheckForIntel.vbs
' Checks if the processor is an Intel and re-enables the power managment driver if it is.
' Written by Ryan D - based off the WMI sample script by Guy Thomas http://computerperformance.co.uk/
'
' ===Version History===
' 1.0 - Initial release
' 1.1 - Changed the way that the script checks for Intel machines. Now it looks at the CPU type and looks
'         to see if the string "GenuineIntel" is present.
' --------------------------------------------------------------'
option explicit
const HKEY_LOCAL_MACHINE = &H80000002
dim objWMIService, objItem, colItems, strComputer, compModel, strKeyPath, strValueName, strValue, oReg
strKeyPath = "SYSTEM\ControlSet001\Services\intelppm"
strValueName = "Start"
strValue = "1"
strComputer = "."
' WMI connection to Root CIM and get the computer type
set objWMIService = GetObject("winmgmts:\\" _
& strComputer & "\root\cimv2")
set colItems = objWMIService.ExecQuery(_
"Select Manufacturer from Win32_Processor")
'Loop through the results and store the type in compModel
for each objItem in colItems
compModel = objItem.Manufacturer
next
'Get a registry object
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
'Check the computer type. If the processor is an Intel, then re-enable the driver
if compModel = "GenuineIntel" then
 oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
else
 
end if
' Exit
WSCript.Quit

Save this file to C:\WINDOWS\PostGhost\checkforintel.vbs. This needs to be set to automatically run after the target PC has finished mini-setup. Make the following alterations to your sysprep.inf

[Unattended]
    OemSkipEula=Yes
    UpdateInstalledDrivers=yes

[GuiUnattended]
    AdminPassword="adminpasshere"
    EncryptedAdminPassword=NO
    AutoLogon=Yes
    AutoLogonCount=1
    OEMSkipRegional=1
    TimeZone=255
    OemSkipWelcome=1

[GuiRunOnce]
    Command0="C:\WINDOWS\PostGhost\checkforintel.vbs"

The admin password and and other settings are to ensure that mini-setup will run unattended. The vital parts of the process are bolded. These settings will make sure that the target PC will auto login and run the script. You may also want to add in another script so that the PC automatically reboots so it is not logged in as an administrator.

Conclusion

After following these steps, you should now have a master image that is able to be deployed on all hardware regardless of CPU brand or type of CPU. I will write a tutorial later which covers the whole sysprep process including:

  • Building in mass storage drivers
  • Building in drivers for all your hardware platforms
  • Debugging drivers for hardware platforms
  • Automatically renaming the PC’s based on MAC address
  • Automatically joining the Active Directory domain

EDIT: Added the suggestion from Bastian to look for the “GenuineIntel” string instead of AMD computer models so each model doesn’t have to be entered into the script manually. Thanks for the advice : D

February 05 2009 01:30 am | Windows

28 Responses to “Sysprep: Single Image Intel/AMD & uni/multi-processor with Windows XP”

  1. Basti756 on 05 Mar 2009 at 5:41 pm #

    Hi there,

    thanks for your guide. That helped me to understand why I always get a BSOD after deploying an Intel image to an AMD machine.
    Do you think it would be possible to let the VBS script check for the CPU type and change load the appropriate driver according to the result? As far as I know Intel’s return value is ‘genuineIntel’ while AMD’s is ‘authenticAMD’. The point behind my suggestion is that I really don’t know the model names of the computers the image will be used on and there’s no way for me to get them.

    Thanks again, Bastian

  2. chris arie on 27 Mar 2009 at 2:25 am #

    Thanks for your excellent post …works like a champ.

  3. Walter Gardner on 05 May 2009 at 11:20 am #

    I have tried the directions and procedures correctly and still received BSOD on AMD Turion 64×2 architecture. Has any confirmed that method works on this AMD CPU type?

    What could I be doing wrong? The vbs script, and Batch files are correct, sysprep.bat is executed and shutsdown correctly, but after cloning from Intel to AMD, BSOD returns big time.

    Help

  4. ryan on 06 May 2009 at 1:42 am #

    Hi Walter

    I cannot confirm myself that Turion processors work but I do not see any reason for them not to. Do you know what error code you are getting when it BSOD’s? It could well be the mass storage drivers (indicated by 0×0000007D I think). If you haven’t built in the default mass storage drivers into sysprep, it wouldn’t be a bad idea. It will make the image a lot more versitile. Without going into too much detail add the following to your sysprep.inf

    [Sysprep]
    BuildMassStorageSection=Yes

    [SysprepMassStorage]

    Once you have added these entries, run sysprep.exe -bmsd to add all the default windows storage drivers to the sysprep.inf file. You only need to do this once to your sysprep.inf file. Also change your SATA port mode to compatibility in your BIOS, not AHCI.

  5. Walter Gardner on 08 May 2009 at 12:31 am #

    Hi Ryan,

    Thanks for the great information which worked perfectly due to the fact I needed to integrate the controllers using the sysprep.exe -bmsd command.

    I also wanted to confirm that this method works on AMD Turion 64×2 and AMD Sempron architectures perfectly. I have been trying to fix this problem for last year. I am currently trying to deal with the final part of the problem, HAL switches.

    If you are cloning to an older system you can not use Multi Processor HALs and will have to incorporate a specal HAL switch or have separate images for ACPI older systems and Multi ACPI newer systems.

    [Unattended]
    UpdateUPHAL = “ACPIAPIC_UP,%WINDIR%\Inf\Hal.inf”

    I am using this switch in the sysprep.inf to see if it will allow me to downgrade to systems with single core processors and older. At the same time remain in the Multi Processor HAL if system is detected as new. If you have any ideas let me know about this also.

    Special Note: I have tested that this method works on Windows XP Professional as well as Home Editions, which do not support mini setup, yet it works.

    Any more findings or ideas send them to me…

    Thanks for great networking and support…

    WG

  6. ryan on 08 May 2009 at 5:35 pm #

    Hi again Walter

    Glad you got it working. Regarding the HAL switching/detection, you are on the right track. The best way to test it is to just see if it works. I’ve only dealt with the master being a uniprocessor and not a multiprocessor PC. I’ve had some issues using modern hardware and trying to get it to work on older achitecture, so I prefer to use the oldest hardware that is in use. I found this post quite helpful as well. http://remyservices.wordpress.com/2007/09/28/sysprep-in-depth-part-3-sysprepinf-and-hals/

  7. Brandon on 02 Jul 2009 at 3:26 am #

    I have a universal image working for our company but I have two separate images one for single processor and one for multi. However I have been able to put the multiprocessor HAL version of our image on single processor systems with no issues that I can tell. I know Microsoft is going to say they don’t support that but lets face it there is alot of things Microsoft says they don’t support doing that work. But I see people on various forums post that there are problems with doing that but they never say what the problems are and like I said I have done it and haven’t noticed any issues at all. Does anyone have any idea what potential problems this could cause if any or has anyone else done this with much success?

  8. Matt on 02 Jul 2009 at 11:18 am #

    Nice work!! I’ve been trying to figure out for the last week why I was getting a BSOD with my image on an AMD based desktop (I’m used to working with Intel systems), and your solution did the trick! You’ve saved me a ton of time, thanks!

  9. ryan on 02 Jul 2009 at 11:52 am #

    Hi Brandon

    I’ve done a bit of research, but all Microsoft seems to say is that there may be some compatibility issues. This is from KB309283:

    Microsoft does not support running a HAL other than the HAL that Windows Setup would typically install on the computer. For example, running a PIC HAL on an APIC computer is not supported. Although this configuration may appear to work, Microsoft does not test this configuration and you may have performance and interrupt issues. Microsoft also does not support swapping out the files that are used by the HAL to manually change HAL types.

    It looks like Microsoft simply doesn’t test these different scenarios. Its strange as they have an option in the sysprep.ini file with the UpdateHAL and UpdateUPHAL options but don’t support it. Personally, I would test a lab or area of the company with the image you are talking about for a few weeks and see if the users report any stability issues. If there are no problems then you could consider rolling the image out to the rest of the users. I guess it is possible that MS could release an update which would break the uniprocessor image as your configuration is unsupported. I would say the chances are remote but it is still something to factor in.

    Also, have you got UpdateUPHAL option configured in your sysprep.ini file? As long as this option is configured, sysprep should detect the CPU type that is running and load the appropriate HAL.

    I reccomend having a read of http://remyservices.wordpress.com/2007/09/28/sysprep-in-depth-part-3-sysprepinf-and-hals/. It might help clarify some aspects of sysprep/HALs

  10. ryan on 02 Jul 2009 at 11:54 am #

    Hi Matt

    Glad to hear. If you are getting anymore BSOD’s its likley that you need the mass storage drivers loaded. Refer to my comment earlier in this post for more info.

    Ryan

  11. Travis on 24 Jul 2009 at 2:32 am #

    I had the BSOD problem after SP3 was added to the image. I rebuilt the image on an AMD with UpdateUPHAL = “ACPIAPIC_UP,%WINDIR%\Inf\Hal.inf” in the sysprep.inf to update to uni-processor or multi-processor. My new Dell workstations add drivers for the Intel processors so I have not had any issues yet. Has anyone else tried building an image on an AMD, even with a predominate Intel environment.

  12. ryan on 24 Jul 2009 at 10:31 am #

    Travis, what BSOD were you getting? Did you try disabling the Intel driver and re-enabling it after the image loaded onto the target PCs? Are you just talking in general or in terms of this guide? I have tried building the image on AMD architecture but was getting BSOD’s when imaging to Intel hardware (in retrospect I think it was actually an issue with mass storage drivers instead of an issue with CPU vendor).

  13. Paul on 10 Oct 2009 at 7:46 pm #

    I am going to try your guide Sysprep: Single Image Intel/AMD & uni/multi-processor with Windows XP as I have had the 7e bsod problem when I deploy to AMD PCs. Been looking for this answer for a while now.

    My workaround is to deploy image then boot to XP Recovery Console and use the disable intelppm command.

    I am curious as to why you need:
    [unattended]
    UpdateHAL=”ACPIAPIC_MP,%WINDIR%\Inf\Hal.inf”

    I’ve been making my images on a Compaq Evo D510
    2.4GHz P4 is a uniprocessor.
    When the sysprepped image is deployed to a multi processor the system will get to the desktop (check device manager and its uniprocessor) then after about 30 seconds the “a new device has been installed and your system needs to reboot…” message appears; after reboot it shows multiprocessor in the device manager.
    Is this a bad method?

  14. ryan on 11 Oct 2009 at 3:31 pm #

    Hi Paul

    I know that when I deploy images, I don’t get the message saying that a new device has been installed. The UpdateHAL option is what is listed by Mircosoft as to what is needed to deploy a uniprocessor image on a multiprocessor system. I think MS call what you have done an “unsupported scenario”. That said, being able to deploy an Intel image on AMD hardware is also “unsupported”. I would still reccomend that you add the UpdateHAL line into sysprep though.

  15. Tim on 17 Oct 2009 at 8:13 pm #

    Hello Paul,
    I’ve used the UpdateHAL in the sysprep file and my image works fine on multi and uni intel processors. I then added the intelppm reg entry. The image works fine on multi intel processors and amd processor but now wont work on intel uniprocessors when it did before without the reg entry. Do you have any suggestions?

  16. Tim on 18 Oct 2009 at 12:08 am #

    Sorry meant Ryan.

  17. ryan on 19 Oct 2009 at 11:12 am #

    Hi Tim

    What hardware are you using to create your master image on? AMD/Intel? Uni/Multi?

  18. Tim on 19 Oct 2009 at 10:08 pm #

    Hi Ryan,
    Created it on an Intel quad core processor. Just rereading your instructions you say to use an oldish pc as a base image e.g. a P4 computer. I had always assumed the newer the better.

  19. ryan on 19 Oct 2009 at 11:09 pm #

    Hi Tim

    Try using this line in your sysprep.inf
    UpdateUPHAL="ACPIAPIC_UP,%WINDIR%\Inf\Hal.inf"

    This will replace the HAL with a uniprocessor HAL if needed and will keep the multiprocessor HAL if there is no change in CPU type the image is deployed to. If this doesn’t solve it, have a look at the error code you are getting on the BSOD

  20. Tim on 20 Oct 2009 at 12:06 am #

    Yep that works, ta.

  21. Helo on 14 Jan 2010 at 3:56 am #

    Thanks

    I build my master images with Vmware Remote Console Server and use snapshot and bartpe with ghost 11.5 to deploy to computers across campus

    Trying to get 1 image for all computers on campus

  22. Tom on 31 Jan 2010 at 11:58 am #

    I was pondering why the registry change is in ControlSet01 and not current . . .
    What if you do not have the source machine anymore. U used imageX or some other image program for backup and the retore should be done on AMD from intel.
    Could you edit the image file in PE or just the target disk after restore ?

  23. Pablo on 04 Feb 2010 at 8:47 am #

    Hi! Thanks for the guide it was a little hard at first but it finally worked just fine. Again, thanks, it was really useful for me

  24. rinz on 02 Mar 2010 at 4:16 am #

    In my experience (testing with uni processor vm) the UpdateHAL statement will always install the multi processor hal and this will degrade performance when there is a uni processor.

    See also http://itk.samfundet.no/dok-filer/ms-xp-sp2-deployment-ref/s_unattended.htm#updateuphal

    Still not sure what is the best method. Stupid in the first place why it is so difficult to make a really universal image.

  25. ryan on 03 Mar 2010 at 9:20 am #

    Hi Rinz

    Since I originally wrote this article, I changed the master to a multi-processor and used the UpdateUPHAL option instead. Also since then, all our desktops and laptops are now multi-processor so it is hard to say if I noticed a performance degredation since this was a while ago. Maybe it is now advisable to build a master on a multiprocessor so you can use the UpdateUPHAL option?

    I will be looking at W7 deployment soon. Although it doesn’t have the same issues as XP in terms of sysprep being very specific to hardware, I’m sure it will open yet another can of worms.

  26. Quad-Damage on 05 Mar 2010 at 3:51 am #

    Oh yeah you should do this

    [GuiRunOnce]
    Command0=”cscript /BB C:\WINDOWS\PostGhost\checkforintel.vbs”

    This will run and install silent in the background :)

  27. zmobile on 15 Apr 2010 at 5:08 am #

    Have you created any further tutorials covering the additional steps such as:
    1. Building in mass storage drivers
    2. Building in drivers for all your hardware platforms
    3. Debugging drivers for hardware platforms
    I would be interested in reading your methods.

  28. ryan on 16 Apr 2010 at 4:26 pm #

    Hi zmobile

    I was planning to hold off the XP platform and go into W7 deployment. If there is enough intrest I still could do a set of multi-part posts on syspreping XP with all the bells and whistles. It would be a lot of content to cover everything so I would have to do it over several parts.

Trackback URI | Comments RSS

Leave a Reply