SK is newb

Customize your Vista Installation Part 2

by SimKill on Feb.08, 2009, under Technical, Tutorial

Hi,

Just as promised, I’m back for more Windows Vista customization action. In this part, we will discuss in detail the steps to follow to customize your install.

Let’s take this step by step. I’m going to assume that you have VMWare and WAIK already installed, have your Vista DVD ready at hand, have your softwares on demand and have a steady internet connection for any Windows Updates and Anti-Virus updates that you need.

Step 1: Setting Up the VMWare environment with Windows Vista

Okay, now that you have VMWare installed and running lets set it up. Firstly, you are going to create 2 virtual machines. So, create 2 virtual machines with around 40GB hard disk space allocated to each (You do not need to pre-allocate them as this will save hard disk space). For simplicity lets name the first one as “Vista VMWare” and the second one as just “Vista”.

We are creating 2 virtual machines because we do not want VMWare Tools installed onto our “core” copy of Vista. Thus, we will be installing VMWare tools in the “Vista VMWare” copy and transfer all our setup files to a folder in that machine.

Now, we need our “Vista” to be able to read the drive from the “Vista VMWare”. So, in the “Vista” virtual machine, click on the “Edit Virtual Machine settings” and then click on the “Add” button. A new window will pop-up (most likely after a UAC prompt). Select “Hard Disk” and click “Next”. On this page, select “Use existing Virtual Disk” and click “Next”. In the next windows it will ask you for the path of the virtual disk to use. Select the virtual disk that you setup for the “Vista VMWare” and click “Finish”. There, now you have setup your Vista to read another hard disk.

Now, install which ever version of Vista you have/prefer on both your virtual machines as you normally do on a computer. Alternatively, you could make an image of your Vista disk and run it off the hard drive for faster install.

After you have setup Vista on both the virtual machines, install VMware tools in the “Vista VMWare” virtual machine. This will allow you to copy files to and from the virtual machine. Shut down this virtual machine and boot the “Vista” virtual machine, open “My Computer” and check if it detects two disk drives. It most probably will, and now you are good to go.

Step 2: Install all softwares required

Well, this isn’t all that a complicated a step anyways. To install your softwares, boot into your “Vista VMware” machine, and create a folder called “Installers” or “Setup” (or whatever floats your boat) on the C: drive (because as of now, you do not have any other drive). From your real computer, drag and drop whatever softwares you want to be preinstalled in your customized OS into this folder.

After that is done, shut down that virtual machine and boot into your “Vista” virtual machine. You should be able to find all the files that you wanted to install in the D: drive.

Before installing you must do an important thing, that is, use the Administrator account to install softwares and delete your account.To do this, open the Run Dialog and type in “secpol.msc” (with or without the quotes, doesn’t really matter). A familiar and annoying UAC prompt will greet you. Push it away with a Continue and then the “Local Security Policy” window opens up. Navigate your way to “Local Policies” -> “Security Options” and there you will see the first entry as “Account: Administrator account status – Disabled”. Open that and click “Enable” and then “OK”. Close the window and log off the system and be greeted with the magical super user account “Administrator”. Log-in using the Administrator account. Now go to the account settings and delete your own account that was created by the Windows Vista setup so that only the “Administrator” account remains.

Feel the power of the Administrator account as there are no UAC prompts to nag you anymore.Now that you have unlocked the Administrator account, just install everything and be happy that things are going easy and just fine. After installing all software make sure that you setup your internet connection just as you would do in real life and run Windows Update to download any security fixes and patches. Once your work is done here you can shut down this machine.

Step 3: Creating the Windows Preinstalled Environment(WinPE) disk image

Now that our Vista copy is ready we need to actually create our bootable WinPE image using which we would boot and install/capture our vista install.

We need a folder (lets call it WinPE on the d: drive, so its path is d:\WinPE) where we will copy all the WinPE files required for a bootable WinPE disk. Do not create the directory as it will automatically be created for you.

Now, open a command prompt and navigate to PETools folder in the WAIK directory. It is usually c:\Program Files\Windows AIK\.

So you would type

 cd "C:\Program Files\Windows AIK\Tools\PETools"

Now, you would type

"copype.cmd x86 d:\WinPE\"

to copy the files to the WinPE folder we’ve just created in the d: drive. The “x86″ declares that we are going to use a 32-bit WinPE environment. The other options are ia64 and amd64 for 64-bit WinPE environments for IA-64 and AMD 64 architectures respectively.

Once this is done, we need a tool called ImageX. This is the program that is going to capture our Windows Image. It is located in the “Tools” folder of “Windows AIK”. So now just copy that into d:\WinPE\ISO\Tools. You need to create the tools folder, it will not be present.

After copying, open a blank notepad and copy-paste this into it.

[ExclusionList]
ntfs.log
hiberfil.sys
pagefile.sys
"System Volume Information"
RECYCLER
Windows\CSC
MSOCache
[CompressionExclusionList]
*.zip
*.cab
\WINDOWS\inf\*.pnf

The [ExclusionList] specifies files to be excluded from being captured, while the [CompressExclusionList] excludes files from compression, and captures them directly. It makes sense as .zip and .cab files are already compressed and do not benefit from further compression. Now save this as “wimscript.ini”.

The final step in the creation of our bootable ISO is the actual creation of a bootable ISO (yes, you read it right). Now that we have all our files ready in the d:\WinPE folder we will use the Microsoft tool called oscdimg to create an ISO. Open up the command prompt, navigate to the Tools\x86 folder and type:

oscdimg -n -bD:\WinPE\etfsboot.com C:\WinPE\ISO C:\WinPE\winpe.iso

Here, the -n switch indicates support for long file names. The -b switch indicates that we are going to make this disk bootable and the path indicates the file to write to the boot sector. The remaining two paths specify the source files and the target ISO to be written to.

Now you will find a new file called winpe.iso in your D:\WinPE folder. This is a bootable image of our Windows Preinstalled Environment. Mount this in the “Vista” machines’ virtual CD-ROM drive and if you want to now, change the boot order to CDROM-HDD-Removable Disk. I’d prefer if you do this now, because you would have to do it later anyway.

Step 4: Final checklist for your “Vista”

Boot into the “Vista” vm one last time. Now, before we are ready to capture the Vista install just run through the following checklist, with the correct answers given in the brackets.

  1. * Did you enable the Administrator account? (Yes)
  2. * Did you delete your own user created account? (Yes)
  3. * Did you then disable the Administrator account? (No)
  4. Did you install all software? (Yes)
  5. Updates? (Yes)
  6. * Any temporary files in the c: drive that you dont need, did you delete those? (Yes)

The points marked with an asterisk (*) are essential and should not be skipped. Once you are sure that you’ve done everything, and set it up as you like it, just for one last time open “My Computer” on your vm (yes, I know, Vista calls it “Computer”, I still prefer to keep it personal) and see if you can see 2 hard drives viz. C and D drives. After this, you are ready to use the sysprep tool.

The main idea of using the sysprep tool is to “generalize” the copy. That is to say, to allow it to be installed on hardware other than your own. This tool flushes the driver cache and clears the system identifier – these are unique for each system, so we need to ensure that they are cleared. So, now we run sysprep. To do so, open Run and type “sysprep”. It will take you to the sysprep folder in Windows. Here run the sysprep.exe and select the option “Enter Out-of-Box-Experience”, tick the “Generalize” option and select the “Shutdown” option.

Alternatively, you can also type this in the command prompt:

c:\windows\system32\sysprep\sysprep.exe /oobe /generalize /shutdown

You can also add the /quiet switch but I find it unnecessary. A sysprep dialog will appear and then after it is done your system will shutdown. Your system is ready for capture.

Step 5: Capturing the image

Now that you have sysprepped your install, do not boot from the hard drive. Remember the ISO we created. We are going to boot from that. Mount the iso as usual in vmware and enter the BIOS setup in your vm and set the boot order to CD drive first, then save and exit.

At the next boot, you’ll see a “Press any key to boot from CD or DVD…” so press a key. Now, WinPE will begin to load, with a XP style DOS progress bar first and then the familiar Vista style green progress bar following that. After WinPE has completed loading you will be at a command prompt. Don’t be fooled, it’s not simple DOS, but a full fledged Win32 environment with full access to network, but thats out of our scope now. You will be on an X:\ drive which is a RAM drive created. Anyway not to worry about this, just switch to e:\tools and you should find your imagex.exe there.

Remember why I told you not to install anything on the “Vista VMWare”? It’s so that we have enough hard drive space to capture our image of this OS. We all know that it is mapped to the D drive in this vm, and are going to use that as our target, since you cannot capture the image of a drive onto itself.

Now for the final step in our capture process. After you have navigated to e:\Tools\ type this:

imagex.exe /capture c: d:\os.wim "Vista"

This will capture the image of the “C” drive to the path “D” in a file called “os.wim” with a label “Vista”. This is because you can store multiple images in a single volume, and a label is an easy way for you to remember in the future which image you want to apply.

ImageX is probably going to take its own time now. It took me around 45 minutes for a 20GB image (yes, I had almost everything on it) and it got compressed to aroung 4.71GB. So you should probably go out for a walk or something like that right now. After this is done, you can shutdown this virtual machine as your customized vista install is created.

If you think that your image is bigger than you media, then you should probably either remove application (defeats the purpose), enable higher compression (I’ll show you below) or buy a Dual Layer DVD.

Well since it is easier to increase compression this is what you do. Remember when you were running the imagex tool? Now we are going to add another switch. Type this line below instead of the one above.

imagex /compress maximum /capture c: d:\os.wim "Vista"

The one with compression specified at maximum will generally take double the time, so be ready for a really long wait. It might take you a few trials before you are satisfied with your image, but it is totally worth the wait.

Well, even though you have created the image, its still not there on your real machine. So, boot up your “Vista VMWare” vm and open “My Computer”. You will find your image called os.wim on the C drive. Copy that to you real computer hard drive and then you are done.

Step 6: Applying the Image

Now that you have created the image, you need to actually apply it. Before applying you can test it out in your virtual machine. So, boot into WinPE as before.

Now, before we apply our image, we need to make a partition and make it the active partition in the system. For this we use the DiskPart tool which is already present in our WinPE copy. So just type diskpart in the WinPE command prompt and you will be in diskpart tool which you will immediately notice by the prompt changing from $p$g to DISKPART>

In DiskPart just execute the following commands.

DISKPART> select disk 0
DISKPART> create partition primary
DISKPART> active
DISKPART> select partition 1
DISKPART> format fs=ntfs quick
DISKPART> assign letter=c
DISKPART> exit

What this basically does is select the first disk, and creates a primary partition in it. Then we set it to be the active partition and quick format it to NTFS. Then we assign it the drive letter C and then we exit DiskPart.

Once this is done, the system flags the C drive as bootable. Now switch your prompt to E:\Tools where the imagex is located. Assuming you still have the os.wim in the D drive, type this:

imagex.exe /apply d:\os.wim 1 c:

The “1″ specifies the volume number to be applied in case you have stored multiple images stored in the same volume. This will take around 10-20 minutes.

Once this is done, reboot the vm without pressing any key as we want to boot into Windows Vista rather than the PE. The initial setup will take some time after which you are greeted by the Out of Box Experience screens, where you have to setup your Vista. After doing all of this (which can be automated as well) we end up at the login screen. Now all you got to do is login and check if all your updates and programs are installed.

That’s it. Wow, it is a long process, but once you have your customized image you won’t waste days after formatting to set up your system.

P.S. : I suck at signing off notes.

:, , , , , , , , , , ,
No comments for this entry yet...

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Archives

All entries, chronologically...