As with vCenter, if you want to deploy some Windows based OSes via vCD you will need to uploaded and package up the Sysprep binaries. That’s because despite Sysprep being publicly downloadable – its not redistributable. That means companies like VMware cannot just add Sysprep to their software distributions as they might MS.NET or MS-SQL Express. A situation I feel is rather silly, but has been the way since time imemoral (or since 2003 when I first copied sysprep to VMware VirtualCenter 1.0 as it was called then). For this reason I’ve always carried around in my environment the files & directories needed for vCenter – is if I did have to do clean install of vCenter (as it is now called) then it was drag ‘N’ drop affair to the right directory location.

Note: Remember sysprep on vCenter or vCD is only needed for Windows 2000, 2003, XP – and you will need both the 32-bit and 64-bit editions based on your requirements. Since Windows Vista (?) sysprep has been included in the base Windows OS build in C:\Windows\System32\Sysprep. So if your only running Window7/8, Windows 2008/2012 this wouldn’t be neccessary. If you don’t already have the sysprep files at your beck and call the KB article http://kb.vmware.com/kb/1005593 will set you on the right path.

I’m working with the vCloud Director appliance in my lab environment, and probably the easiest way to copy the Sysprep Folders across is to enable SSH (to allow for Secure Copy) and then use a free-SCP tool like Veeam SCP 3.0 (requires registration, WinSCP does not if that bothers you!) to copy the files across. To enable SSH open a VMware Remote Console on the vCD Cell (or server if you prefer – each install instance of vCD that shares the same database is referred to as a “cell”) you can do this using either the web-client on vSphere5.1 or using the Ye Old C# vSphere Client.

Screen Shot 2012-10-30 at 12.44.06.png

At the console you can login as “root” with your password – this “vmware” if you haven’t already changed it. You really should you know. I mean really.

Using the Uber-Friendly “vi” text editor you can edit the sshd_config tool to temporarily allow SSH connections from root with

vi /etc/ssh/sshd_config

Type [i] on the keyboard to enter –INSERT– mode

and locate the text “PermitRootLogin no

replace this with “PermitRootLogin yes

Type [ESC] to exit

Type :w! [ENTER] to write your changes

Type: :q! [ENTER] to exit vi

To restart SSH to let these changes take affect – you can use the command service sshd restart

The next step is to upload the Sysprep files to the vCD – in my case I used WinSCP to achieve that. As with vCenter, the vCD system requires the directories that make up the Sysprep folder to be correctly named. Sadly, this naming convention isn’t the same as vCenters. However, its relatively trival process to copy the folders across and then rename them.

Screen Shot 2012-10-30 at 13.28.11.png

Note: Remember these directories (win2000, win2k3 and so on) are CaSe-SeNsItiVe and must be in all in lower-case for the script to execute properly.

The next step is to run a script on the vCD host called createSysprepPackage.sh. This script will return errors if any of the folders are empty or if sysprep.exe cannot be found within them. Even after downloading and extracting the “core” .exe file from Microsoft you might find there is a “deploy.cab” file that needs extracting to the directory before this works properly. Of course, this could be reasonable if you have no intention of running or support a legacy OS like Windows 2000 in vCloud Director. So in the screen grab below you can see their errors on some of the directories.

Screen Shot 2012-10-30 at 13.45.53.png

If all the directories are correct then the scripts runs without errors.

Screen Shot 2012-10-31 at 13.07.05.png

I was following these instructions from the offical courseware on vCD (originally written around the 1.5 edition), but I thought I would follow it to the letter. At the end of the process they finish off with a restart of the vCD service with:

service vmware-vcd restart

Screen Shot 2012-10-30 at 18.43.46.png

It’s strikes me this proceedure might be a bit of PITA if I’m building, rebuilding or re-importing vCD as an appliance. So I decided to make .ISO of the Sysprep files, so they can be easily mounted to the vCD from within the web-client, copied across and registered with vCD using the .SH script.