Enable Integration features for Virtual PC Beta running server 2008

Running on Windows 7 it obvious you would use the new Windows Virtual PC Beta.

There is a problem however, when you want to run a Server2008 virtual PC. The server it self runs great, and is much faster than Virtual PC2007, but like in Virtual server2005 Drag’n Drop is not supported.

This Should basically not be a problem because the integration features gives you access to all the host machines drives (including USB).  Only problem is that it doesn’t seam to work on Server2008. It might work at first, but after a couple of reboots the integration features suddenly will not install…

The workaround is simply to restart the “Virtual PC Integration Components Services Application” service.

Her is what I did after the integration features started to error.

image After starting the virtual 2008 server, it takes quiet a while for the installing integration features to run, and eventually a dialog appears telling you that the features could not be enabled.

Click Continue. 

image If you click Tools you will notice that it is not possible to enable integration features (grayed out)

Click Settings

image In settings choose Integration Features  and remove the check mark in Enable at startup.

I do this to skip the install integration features dialog as it will fail anyway.

Note: If you restart the server with the features enabled, it will try and install again, and fail !!

image Star a command prompt and type
net stop “Virtual PC Integration Components Services Application”

net start ”Virtual PC Integration Components Services Application”

image If you click Tools you will notice that it is now possible to enable integration features 

Click Enable Integration Features

image If you open windows explorer you will notice that there is now a lot of new disks pointing to the host machines locale drives and shares.


That’s it.  Integration features are now available.

Posted in Virtual PC | Leave a comment

Try out Windows 7 without messing up your XP/VISTA installation

I just love Windows 7 RC… It runs much better than VISTA, and has lots of super nice features.  (Get it here http://www.microsoft.com/windows/windows-7/ )

One of these features is the ability to boot from a VHD, which actually means that I can run Win7 on my laptop, without having to reinstall my existing OS, mess around with partitioning or having to install some boot manager in order to run it a dual boot environment. 

So what does this mean exactly!! Well for me it means that I can still have my Vista installed PC where I know my Microsoft training material works for when I’m teaching, and where i can always find a working driver for my hardware. further more, i don’t have to worry about the Windows 7 installation once the final release is out, as i can just remove the VHD from my hard disk.

Her is a Step by Step guide on how to do it.

image From your existing Vista /XP machine boot Your Windows 7 CD.
Once the Install Windows box appears, press SHIFT F10 to open a command prompt.
image Crate a folder called VHD on your hard disk

NOTE: this folder you will contain the Win7 virtual disk, so make sure there is space enough. At least 15 GB.

image You will now create the VHD to install Win7 on. This is done from DISKPART. Start diskpart by typing diskpart in the prompt.
image type:
create vdisk file=C:VHDWin7.vhd type=fixed maximum=15000

Note: This will create a fixed size virtual disk. If you leave out type=fixed the VHD will be a dynamical expanding disk.

image You must now select the newly created disk, and attach it to to system.

select vdisk file=C:vhdWin7.vhd

attach vdisk

image Exit DISKPART by typing exit, and the close the prompt.

in the Install Windows box choose your language settings, and the click NEXT

image click Install now
image Accept the license terms, and click Next
image In the “which type of installation do you want?” box make sure to choose Custom.
image Choose the virtual disk you created, and click Next

Just ignore the warning saying that windows cannot be installed to the disk.

Note: It should be easy to identify by looking at the size, that should be almost the same size you choose when you created the VHD.

image The installation will now run trough the normal setup process. and once finished, it will automatically create a dual boot setup, wit your old OS.
image To change the Boot order start a Command prompt with elevated privileges.

Right click Command Prompt and click Run as administrator

image type BCDedit /v to list entrees in the boot store.

NOTE: this must be done from the Win7 installation


Change the description for your VHD installation to say.  "Windows 7 VHD"

bcdedit /set {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} description "Windows 7 VHD"

Replace xxxxx… the Win7 GUID


Add VHD installation as the last choice in the boot list.

bcdedit /displayorder {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} /addlast

If you have multiple entries, just type them in your preferred order separated by spaces, and drop the /addlast option.


That it.. Enjoy your new Win7 installation, i know you will love it..

Posted in Windows 7 | Leave a comment

Auto run action when a new user loges on / add setting to HKEY_CURRENT_USER

Ever wanted to set a registry key to automate some stuff for your users, only to find out that the key resides in HKEY_CURRENT_USER making it quit difficult to have it work for all users on the pc. You can of cause set this in your login script, but setting registry fixes is not really a job for the login script.

During a deployment scenario, where only the administrator is logged in, we can obviously us the run once command from the registry, but that only run once on the computer, and not once pr. USER. We could also manipulate the NTUSER.DAT file and add settings there, but not all settings from ntuser.dat is transferred to the current user.

What we could do is to create an entry in the “HKEY_LOCAL_MACHINESOFTWAREMicrosoftActive SetupInstalled Components” key. Basically the entrees in this key is the stuff you se in the upper left hand corner during first log on. (the Personalized Settings box). Most if not all entries in this key will be in the GUID format, but it does not have to be..

Open REGEDIT and follow the instructions below.

image Right click Installed Components and click New KEY, and name the key {Z-UserSetup}.

NOTE: The different keys are executed in number and alphabetical order, so to make sure our key is executed last we name it Z-“something” and put it in { }. Everything not in curly braces wile be executed first.

image In the new key create two new String Values (REG_SZ) and name them
StubPath and Version.

StubPath has info on what we want to run, and could be any executable, script, run.dll e.t.c.

Version will show in the Installed Components section in CURRENT_USER

(Default) will be the info showed in the Personalized settings box during logon. (can also be sat as @=”info”)


Now just reboot and log on with a different user, and notepad will be executed during logon.

If you want to set this with a script ,then here small one for disabling the Windows Media Player wizard.

Set oShell=CreateObject("WScript.Shell")

RegPath="HKEY_LOCAL_MACHINESOFTWAREMicrosoftActive SetupInstalled Components{Z-UserSetup}"
oshell.RegWrite Regpath & "Stubpath", "reg.exe add HKCUSOFTWAREMicrosoftMediaPlayerPreferences _
/v AcceptedPrivacyStatement /t REG_DWORD /d 1 /f", "REG_SZ"
oshell.RegWrite Regpath & "Version", "1.00", "REG_SZ"
oshell.RegWrite Regpath & "@", "Accept MP Privacy Statement", "REG_SZ"

You can add as many entrees as you want, just be aware of the execution order.

Posted in Tips and Tricks | Leave a comment

Disable the Windows Media Player wizard on first run

Ever get annoyed that your users have to run trough the media Player 11 wizard, the first time they launch the program. Well I do, and in general my customers do to..

The fix however is quit simple. All you have to do is set the AcceptedPrivacyStatement key to 1 in the registry, under HKEY_CURRENT_USER


Windows Registry Editor Version 5.00



The obvious problem of cause, is the fact that the key is under current_user, which means that the user needs to be logged on to windows, when the key is added..  This can be automated by setting the reg key with  “Active Setup” which I will explain in my next post..


Posted in Tips and Tricks | Leave a comment

Working with regional settings during OSD

I know there are different ways to add regional settings to you build during OS deployment, and some of them are quiet confusing… I’m not trying to put any of the methods down, but I would like to suggest an easy way of adding simple stuff like:

  • Keyboard settings
  • Time Zones
  • Local Settings
  • And all the other sysprep settings.

The way I do this is quit simple, and it works every time.. (almost 😉


As we are going to use a couple of MDT scripts,  creating a package with the necessary configuration files is necessary. If you are already running MDT integration, and you have made a Toolkit package you can skip to step 2 and use that package to run your script from using the cscript.exe "%deployroot%scripts” syntax.

If you do not want to use MDT integration just add the necessary script files from the MDT package.

  1. Create a package containing “ZTIConfigure.wsf”,”ZTIConfigure.xml” and “ZTIUtility.vbs”  (lets call it ToolKit)
  2. In your TS add a “Run Command Line” step, and run the ZTIConfigure.wsf from the package Toolkit.

    ScreenHunter_01 Nov. 27 15.56
    This is a short bare metal deployment TS (but it works).You must place the script after you run Apply Windows and Network settings, as they both write to your answer files and will overwrite any settings injected by ZTIConfigure.wsf.

    Also they will create the answer file if you did not use one when building the image.

  3. Now we need to add the variables we want applied, to our deployment collection. You can use all the variables found in ZTIConfigure.XML under “</mapping id=” for both XP and VISTA
    For Windows XP and Sysprep.inf For VISTA and Unattend.XML
    image image

  4. Right click you deployment collection, and Click “Modify Collection settings” and open the “Collection Variables” TAB. Click the “star burst” and start typing in variables, like InputLocale and UserLocale with corresponding values. 

     ScreenHunter_02 Nov. 27 16.30

  5. When you have the Variables you need, you Collection Variables could look like this

Basically that is it, just run your TS, and the values will be added to sysprep.inf or unattended.xml.

There is however a small problem with XP (not VISTA). For some reason changing regional settings will not work if we do not add the “InstallFilesPath=” to our Sysprep.inf [Unattended] section.

So how do we do this!!

Well, if we have a  a couple of.

1. Add the line to the sysprep/unattend before capturing the Image

2. If you already have an image, mount it and make the changes to the sysprep/unattend (or add one!)

3. Add a sysprep/unattend file to a package, and point to it from your TS “Apply Operating System” step.

4. Add a InstallFilesPath variable to the ZTIConfigure.xml (Not recommended)


The general Sysprep syntax (for XP at least) regarding regional settings can found in my previous entre… http://kongkuba1.spaces.live.com/blog/cns!EEFF1607E296E5AB!265.entry

Posted in Language | Leave a comment

Handling HAL switching during XP deployment (no BSOD /0x07 error)


Because of the issue with different HAL’s (Hardware Abstraction Layer) used by XP, it is necessary to make some changes to both Sysprep, and the Kernel files during deployment..

I thought I’d supply my HAL changing script, as it does not require the reference computer to be build  from a specific ACPI structure , and you do not need to add any files to the image beforehand, as it’s done by the script.

Just run the script after the image has been deployed, but before booting from WinPE to the MiniSetup

<job id="HAL">
<script language="VBScript" src="ZTIUtility.vbs"/>
<script language="VBScript">
‘ //***************************************************************************
‘ // ***** Script Header *****
‘ //
‘ // Purpose: Change HAL
‘ //
‘ // Prerequsits: The refrence image must be SP2 or SP3
‘ //
‘ // Coretech History:
‘ // 1.0.0     Michael Petersen 19/09/2008  Created initial version.
‘ //
‘ // ***** End Header *****
‘ //***************************************************************************

‘// Global constant and variable declarations

Option Explicit

Dim iRetVal, sHalType, sLocalDrive, sHalSource, sSysprep, sfile, sSystem32, sHal, sNtoskrnl, sNkrnlpa

‘// End declarations

‘// Main routine

On Error Resume Next
iRetVal = ZTIProcess
ProcessResults iRetVal
On Error Goto 0

‘// Function: ZTIProcess()
‘// Input: None
‘// Return: Success – 0
‘// Failure – non-zero
‘// Purpose: Perform main ZTI processing
Function ZTIProcess()

iRetVal = Success

ZTIProcess = iRetval

‘ Check for Sysprep.inf and set Path
sLocalDrive = oEnvironment.Item("OSDTargetSystemDrive")  

If oFSO.fileExists(sLocalDrive & "sysprepSysprep.inf") then
    sSysprep = sLocalDrive & "sysprepSysprep.inf"
    oLogging.CreateEntry "Found sysprep in " & sSysprep, LogTypeInfo
     oLogging.CreateEntry "Could not locate Sysprep", LogTypeWarning
End if

‘Set HAL source path from sp2 or sp3
If oFSO.fileExists(sLocalDrive & "WINDOWSDriver Cachei386sp3.cab") then
    sHALsource = sLocalDrive & "WINDOWSDriver Cachei386sp3.cab"
    oLogging.CreateEntry "HAL replasment files will come from: " & sHALsource, LogTypeInfo
elseIf oFSO.fileExists(sLocalDrive & "WINDOWSDriver Cachei386sp2.cab") then
    sHALsource = sLocalDrive & "WINDOWSDriver Cachei386sp2.cab"
    oLogging.CreateEntry "HAL replasment files will come from: " & sHALsource, LogTypeInfo
    oLogging.CreateEntry "no HAL replasment fileses present", LogTypeInfo
end if

‘Get the HAL type from the registry (from Windows PE).  This will tell us if we are running on a PIC or an APIC chipset.
    oLogging.CreateEntry "Configuring HAL replacement", LogTypeInfo
    sHalType = oShell.RegRead("HKLMSYSTEMCurrentControlSetEnumRootACPI_HAL000HardwareID")
    oLogging.CreateEntry "Windows PE is using HAL " & sHalType(0), LogTypeInfo  

Select Case lCase(sHalType(0))
Case "acpipic", "acpipic_up"
    ‘Add the UpdateUPHAL command to the Sysprep.inf file.
    oUtility.WriteINI "C:SysprepSysprep.inf", "Unattended", "UpdateUPHAL", "ACPIPIC_UP,C:windowsInfHal.inf"
    oLogging.CreateEntry "Updated SYSPREP.INF to replace HAL with uniprocessor PIC HAL", LogTypeInfo
    ‘Configure HAL and Krnl
    sHal = "HALACPI.DLL"
    sNtoskrnl = "NTOSKRNL.EXE"
    sNkrnlpa = "NTKRNLPA.EXE"

Case "acpiapic", "acpiapic_up"
    if oShell.Environment.item("NUMBER_OF_PROCESSORS") > 1 then
    ‘If Processors.Count > 1 Then’Add the UpdateHAL command to the Sysprep.inf file.
        oUtility.WriteINI sSysprep, "Unattended", "UpdateHAL", "ACPIAPIC_MP,C:windowsInfHal.inf"
        oLogging.CreateEntry "Updated SYSPREP.INF to replace HAL with multiprocessor APIC HAL", LogTypeInfo
        ‘Configure HAL and Krnl
        sHal = "HALMACPI.DLL"
        sNtoskrnl = "NTKRNLMP.EXE"
        sNkrnlpa = "NTKRPAMP.EXE"   
        ‘Add the UpdateUPHAL command to the Sysprep.inf file.
        oUtility.WriteINI sSysprep, "Unattended", "UpdateUPHAL", "ACPIAPIC_UP,C:windowsInfHal.inf"
        oLogging.CreateEntry "Updated SYSPREP.INF to replace HAL with uniprocessor APIC HAL", LogTypeInfo
        ‘Configure HAL and Krnl
        sHal = "HALAACPI.DLL"
        sNtoskrnl = "NTOSKRNL.EXE"
        sNkrnlpa = "NTKRNLPA.EXE"
    End If

Case "acpiapic_mp"
    ‘Add the UpdateHAL command to the Sysprep.inf file.
    oUtility.WriteINI sSysprep, "Unattended", "UpdateHAL", "ACPIAPIC_MP,C:windowsInfHal.inf"
    oLogging.CreateEntry "Updated SYSPREP.INF to replace HAL with multiprocessor APIC HAL", LogTypeInfo   
    ‘Configure HAL and Krnl
    sHal = "HALMACPI.DLL"
    sNtoskrnl = "NTKRNLMP.EXE"
    sNkrnlpa = "NTKRPAMP.EXE"
End Select       

‘Check if System32 is present and unpack needed files.
sSystem32 = sLocalDrive  & "WindowsSystem32"
oLogging.CreateEntry "Checking for access to " & sSystem32, LogTypeInfo

If oFSO.FolderExists(sSystem32) then
    oLogging.CreateEntry sSystem32 & " Found", LogTypeInfo

    For Each sFile in Array(sHal,sNtoskrnl,sNkrnlpa)
        oShell.Run "expand " & Chr(34) & sHalSource & Chr(34) & " -f:" &sFile & " " &sSystem32,0,true
        oLogging.CreateEntry "Copying " & sFile & " to " & sSystem32, LogTypeInfo

        oFSO.CopyFile sSystem32 &sHal, sSystem32 & "HAL.dll", true
        oFSO.CopyFile sSystem32 &sNtoskrnl, sSystem32 & "NTOSKRNL.EXE", true
        oFSO.CopyFile sSystem32 &sNkrnlpa, sSystem32 & "NTKRNLPA.EXE", true
        oLogging.CreateEntry "rename HAL and Kernal files", LogTypeInfo
        oLogging.CreateEntry "Error – Folder " & sSystem32 & " Not Found", LogTypeError
End If
End Function


Get the script here.



Posted in SCCM | 10 Comments

Creating a bootable WinPE / OS installation USB key.


1. Attach the USB key to a computer running Vista, windows 7 or Server2008. ( if you only have XP, boot the PC from a WinPE CD)

2.Start a command prompt and type DISKPART.


3. Type LIST DISK  to locate the Disk number of the USB key. (in this case it a 1GB key, so it must be Disk 2)

4. Now that you knpw the key is DISK 2 run the following commands in diskpart:



  • sel dis 2
  • clean
  • cre par pri
  • sel par 1
  • active
  • format fs=fat32 quick
  • exit
  • 5. now just copy the content of your Vista, Windows7 or Server 2008 Installation CD to the USB key and your set to go. (You must of cause use a larger key for that).

    For WinPE, create a build following this guide http://kongkuba1.spaces.live.com/blog/cns!EEFF1607E296E5AB!332.entry and then copy the content of the ISO Folder to the USB key

    Content of WinPE build ISO folder

    Content of USB key


    Posted in WinPE | Leave a comment