2

This is the process I use for duplicating a Virtual PC (on Windows 7):

1 - Create a new VPC. 2 - Install Windows 7 on the new VPC. 3 - Configure the new Windows 7 installation (install Windows updates, install applications, etc). 4 - Run Sysprep on the new VPC. 5 - Shut down the new VPC. 6 - Make a copy of the new VPC's VHD file. 7 - Create a new VPC, specify "use existing VHD file" in the wizard and provide the name of the copied VHD file.

Above works fine but there is one point that threw me off: During the OOBE for the duplicated VPC, when asked for a user name, I had to specify a different user name than the one I had specified for the base VPC. This makes sense because the copied VPC already has that user name. But what I did not understand is why I was asked for a new user name at all? Is it because it is part of the OOBE process and when the OOBE was designed by Microsoft, they did not think of the fact that base OS images could be copied?

Thanks -

-Todd

Sabuncu
  • 161
  • 9

2 Answers2

2

When you run sysprep it reseals windows and requires the user info again, if you want to keep the same user then there are already well documented methods to script the OOBE process.

Create a $oem$ folder in you I386 (from where you start setup).
Create a Cmdlines.txt file with the following section:
[commands]
".\net user <UserName> <Password> /add"
".\net group Administrators <UserName> /add"
Copy of the Net.exe in the $oem$ folder.
In Unattend.txt file, make sure the Oempreinstall value is set to Yes.
Run an unattended setup.
JamesRyan
  • 8,166
  • 2
  • 25
  • 36
  • Thank you. Scripting the OOBE is through ImageX and DISM etc? – Sabuncu Jun 15 '10 at 10:04
  • Thank you again but your edit is over my head. I don't start "setup", I use vpcwizard.exe to create a new VPC (and specify existing VHD file). I can manage the other steps once I understand how/where 'setup' and 'I386' folders figure in. Also, does the Unattend.txt file already exist, or is it a new file I create? – Sabuncu Jun 15 '10 at 14:02
  • I recommend you google on how to use sysprep.inf with the unattend.txt options for more info, but these folders are new ones in your VHD. syspref.inf is probably on there under a folder called sysprep – JamesRyan Jun 18 '10 at 13:46
2

look in the c:\sysprep folder of the win7 machine for the unattend.txt .

Translation for the above procedures:

  • if you are installing Win7 from files you copied to a network share, create a folder within the i386 sub-folder called $oem$ .

  • Create a text file using notepad, DOS edit or whatever text editor is your favorite & name it Cmdlines.txt . Copy everything from [commands] & the next 2 lines into that text file & save it. You will change out the appropriate user info for your domain denoted by <> . Place this file in that new $oem$ folder.

  • Copy over net.exe from c:\windows\system32 to the %oem% folder you just created.

  • The unattend file is more than likely created by vpcwizard.exe

  • You will see several sections contained in the unattend.txt file. Verify the OemPreinstall value = "yes". You'll see it. Just open it with a text editor & scan through it.

Other options can be found here

  • Run the sysprep.exe file to save your settings & shut it down. It is now ready to be imaged & will begin the automated process the next time it boots.

All the info you ever need to know about sysprep can be found here.

Pete
  • 136
  • 1
  • 8
  • Pete, THANK YOU! One question: I am not installing Win7 from a network share, but from DVD. In this case, do I copy the DVD to disk and then create the $oem$ folder within the i386 folder? PS: My editor is and will always be Vim! ;-) Thanks again. – Sabuncu Jun 16 '10 at 18:43