Extending root partition running Virtual Machine in VMware .

Why is this useful:
By giving the ability to deploy Windows VM’s with variable sizes, less templates
will be necessary, while being more flexible with regards to virtual disk space.

Explanation of the Process:

Microsoft’s Sysprep, which is utilized by VMware VirtualCenter, has a minimal
Sysprep configuration that is used to customize Windows Virtual Machines.
When VMware VirtualCenter Clones/Deploys a Windows VM, an opportunity is
given to Customize the Guest OS. This process “drops off” a generic Sysprep.inf
(and other necessary files) to have Windows perform this task.
The additional setting we need to add to the generated Sysprep.inf is the
ExtendOEMPartition setting in the Unattended section.

The “ExtendOEMPartition” setting has the following options:
Setting Value Result
ExtendOEMPartition 0 (ZERO) Do not extend
1 Extend to the end of the disk
X Extend the volume X megabytes
Source: http://support.microsoft.com/kb/240126/

If we modify the process of creating the generic Sysprep.inf, then we can grow
our partition to the full size of an expanded virtual disk file, before it is powered
on the first time.

Initial Setup:
You will need to modify 2 files that VMware has provided that generate the
Sysprep.inf file.

These files are:
1. Gensysprepinf.vbs – The actual script that generates the Sysprep.inf file
2. Autoprep.wsf – The script handling some duties in the deployment of a VM.
They are typically located in (as of this writing)
C:\Program Files\VMware\VMware VirtualCenter\scripts for VC 1.x and
C:\Program Files\VMware\VMware VirtualCenter 2.0\scripts for VC 2.x

These files are encoded using the Microsoft Script Encoder, which you can find
here: http://www.microsoft.com/downloads/details.aspx?FamilyId=E7877F67-
C447-4873-B1B0-21F0626A6329&displaylang=en (as of this writing)

You will need to decode these files to be able to work with them. I will not cover
the process of decoding these files.
When the files have been decoded, you will need to edit gensysprepinf.vbs to
include the ExtendOEMPartition setting.

Look for the [Unattended] section:
outStr = "[Unattended]" & vbCrLf _
& " OemSkipEula=Yes" & vbCrLf _
& " InstallFilesPath=\sysprep\i386" & vbCrLf _
& vbCrLf _
& "[GuiUnattended]" & vbCrLf _
& " AdminPassword=" & mAdminPassword & vbCrLf _
& " OEMSkipRegional=1" & vbCrLf _
& " TimeZone=" & mTimeZone & vbCrLf _
& " OemSkipWelcome=1" & vbCrLf

And change it to read:

outStr = "[Unattended]" & vbCrLf _
& " OemSkipEula=Yes" & vbCrLf _
& " ExtendOemPartition=1" & vbCrLf _
& " InstallFilesPath=\sysprep\i386" & vbCrLf _
& vbCrLf _
& "[GuiUnattended]" & vbCrLf _
& " AdminPassword=" & mAdminPassword & vbCrLf _
& " OEMSkipRegional=1" & vbCrLf _
& " TimeZone=" & mTimeZone & vbCrLf _
& " OemSkipWelcome=1" & vbCrLf

Then save gensysprepinf.vbs

Because Gensysprepinf.vbs is no longer encoded, autoprep.wsf will need to be
modified also.
Decode autoprep.wsf, and look for the following line:

Share this

Related Posts

Previous
Next Post »

What do you think about this Article? Add your Opinion..! EmoticonEmoticon