Add a VMware Virtual Machine to your HII Models
Do you have a Hardware Independent Imaging job? Want to be able to test your images on VMware Workstation 6? Here's what I did to accomplish this.
Purpose
I spent the better part of a day using trial-and-error to get this to work, so I wanted to hopefully save someone else from having to reinvent the wheel.
As with adding any model to an HII job, one of the biggest challenges is getting the drivers and HAL to work. With VMware, there is really only one driver that needs to be added for a VMware virtual machine to function. That driver is the VMware SCSI driver, which can be downloaded from http://www.vmware.com/download/ws/drivers_tools.html.
One caveat to adding a VM was I needed to make a copy of the base image because the VMware SCSI driver uses the same vendor and device ID as a standard device. The changes will be discussed in the next section.
What changes need to be made to the image?
- The image file needs to have a VMware customized reg key under HKLM\system\controlset001\criticaldevicedatabase for Vendor ID 104b\Device ID 1040 that lists vmscsi as the service. This entry is as follows:
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CriticalDeviceDatabase\pci#ven_104b&dev_1040] "Service"="vmscsi" "ClassGUID"="{4D36E97B-E325-11CE-BFC1-08002BE10318}" - Vmscsi.inf needs to be added to the image in the \windows\inf folder and vmscsi.sys needs to be added to the image in \windows\system32\drivers folder
To make the registry changes in the image, see this kb article: https://kb.altiris.com/article.asp?article=2584&p=1.
Changes to sysprep.inf
Because of the following changes to sysprep.inf, I created a copy of sysprep.inf called "sysprepV.inf" and I use this on VMware VM's in place of sysprep.inf. I'll discuss how I called the different file in another section.
In order for the mini-setup to function the [MassStorageDrivers] section of the sysprep.inf needs to have the following entry:
pci\ven_104b&dev_1040=\vmscsi.inf
This driver is the VMware SCSI driver mentioned above. This driver needs to be present on the machine when mini-setup runs so if you are injecting drivers, make sure that this driver is added to your list of drivers for the VMware model, OR if you have the drivers on the image, make sure to insert the drivers into your image file.
Another change that may be needed is to set the HAL. VMware Workstation 6 emulates an ACPI Uniprocessor HAL. If you captured your image using the "Advanced Configuration Power Interface" CPU, then you will need to add the following lines to the [Unattended] section of the sysprep.inf:
- UpdateUPHAL=ACPIAPIC_UP,C:\Windows\inf\hal.inf
- UpdateInstalledDrivers=Yes
Do I have to do anything on the VMware Side?
On VMware, the hard drive and SCSI settings need to be set correctly or the driver selection above will be useless. The SCSI setting needs to be "BusLogic".
The hard drive needs to be set to "IDE".
What about the rest of the drivers?
The rest of the drivers will be installed when the VMware tools are installed. I was able to find an installation package of VMware tools by searching Google for "VMware6tools". Otherwise, VMware tools can be installed from the VMware console by selecting "VM" > "Install VMware Tools".
What's left to do?
Since I made a copy of the image and a copy of the sysprep.inf file specific to VMware, I added a condition to my image deployment job. The condition uses the Computer Product Name of "VMware Virtual Platform" as the field and value.
In the tasks for this condition, I replaced the sysprep.inf file name in my ReplaceTokens line with sysprepV.inf and change the name of the image file to the VMware specific version.





VMWare VMX file
As a quick workaround, you can also make your sysprep'd images suitable for VMWare Workstation by inserting the following line into your VMX file,
scsi0.present = "FALSE"
Adding mass-storage driver support for VMWare is better longer term definently. Nice write-up.
Kind Regards,
Ian./
Ian Atkin
Senior Developer for the ICT Support Team,
Oxford University, UK
ESX support
I had a request from my customer to add support for VM's created on an ESX box. This proved to be a little more challenging, since ESX does not support IDE disks. I ended up having to add some more information to the registry of the image to get this to work.
This also allows for a VMware Workstation VM to be build with a SCSI drive.
Stu
ITS Partners
LinkedIn
Thanks Stu!
I was just missing the regkeys, once I added them to the HIVE everything worked like a charm! Thank you so much!
Glad it worked!
Happy imaging!
Stu
ITS Partners
LinkedIn
Would you like to reply?
Login or Register to post your comment.