Showing posts with label VMware. Show all posts
Showing posts with label VMware. Show all posts

Sunday, November 24, 2013

How to migrate a VHD to VMware Workstation

Introduction

This posting walks you through the process of migrating a pre-configured Microsoft Virtual Hard Disk (VHD) system to VMware, using nothing more complex than a text editor.  This posting integrates relevant postings on this topic from other authors.  Links to all references uses in researching and developing this posting are provided in the References section, below.  This posting was developed on VMware Workstation 7.1.3 build-324285, but applies to other VMware products, including ESX and Player.

In this posting, you will migrate the Microsoft Windows Server 2003 R2 Enterprise Edition VHD to VMware Workstation 7.1.3.

Step 1: Prepare VHD
  1. Download or locate the Source VHD. For this posting, the source VHD filename is Win2k3R2EE.vhd.
  2. Create a new folder in your VMware VM directory.  For this posting, a new folder win2k301 was created.
  3. Copy the source VHD to your VMware directory
    While not absolutely necessary, it facilitates file management to keep the VHD source file co-located in the same folder as the target VMware VM folder.
Step 2: Create New VM
  1. Launch VMware Workstation.
  2. From the File menu, point to New and then point to Virtual Machine..
  3. Click Virtual Machine.  The first page of the New Virtual Machine Wizard appears.
  4. Select the Custom (advanced) option
  5. Click Next.
  6. On the Choose the Virtual machine Hardware Compatibility page, select the appropriate virtual machine hardware compatibility from the Hardware dropdown, and then click Next.
  7. On the Guest Operating System Installation page, select the I will install the operating system later option, and then click Next.
  8. On the Select a Guest Operating System page, from the Guest operating system group, select Microsoft Windows, and then click Next.
  9. On the Processor Configuration page, leave all settings default, and then click Next.
  10. On the memory for the Virtual Machine page, change the memory to 1 GB (1024 MD), and then click Next.
  11. On the Network Type page, choose the network configuration desired.  For this posting, the Use bridged networking option was selected
  12. Click Next.
  13. On the Select I/O Controller Types page, leave the default (LSI Logic), and then click Next.  The next page is the most important in the VM creation process.
  14. On the Select a Disk page, select Use an existing virtual disk.
  15. Click Next.  The Select an Existing Disk page appears
  16. On the Select an Existing Disk page, click Browse, and then navigate to the location of the VHD
  17. Select the VHD file, and then click Open.  The navigation dialog closes, and you are returned to the Select an Existing Disk page
  18. Back on the Select an Existing Disk page, verify that the path and file name are correct, and then click Next.
  19. On the Ready to Create Virtual Machine page, click Finish.  The VM is created and a new tab appears in VMware
  20. Verify that the VM folder now has VMSD, VMX and VMXF files
Step 3: Edit VMX File
  1. Exit VMware Workstation.  If you are using ESX, remove the new VM (but don't delete the files).
  2. Navigate to the VM folder created in Step 1.  This folder should contain the VHD file along with a VMSD, VMX and VMXF files
  3. Right-click the VMX file, in this posting named win2k301.vmx, point to Open With, and then choose Notepad.  The VMware VM settings file opens in NotePad.
  4. Edit the scsi0.present setting from TRUE to FALSE.
  5. Edit the scsi0:0.present setting from TRUE to FALSE.
  6. Add the following settings:
    ide1:1.present = "TRUE" ide1:1.deviceType = "disk" ide1:1.fileName = "Win2k3R2EE.vhd"
  7. Save and close the VMX file.
Step 4: Launch the VM
  1. Launch VMware Workstation.  If you are using ESX, add the VM back.
  2. Start the VM.
  3. If you repeatedly experience this blue screen,
    you may not have correctly edited the VMX settings file.  Review this file and try again.
  4. You'll see the usual Windows settings screen appear
    and then various Windows Setup dialogs will also appear; and the rest is normal Windows startup
  5. If, after logging into the Windows VM, you find the cursor missing or stuck in the bottom right corner, see Troubleshooting I below.
  6. If after trying to shutdown Windows VM, you find that it appears to hang, see Troubleshooting II below.
Summary

This posting has presented one method for migrating Microsoft VHD systems to VMware Workstation without the need for third party conversion tools.  The process merely involves minor changes to the VMware settings file for the VM.

Troubleshooting I: Mouse cursor does not appear within the virtual machine window
This can occur if the original VHD system had Microsoft Virtual Machine Additions installed.  To verify this, perform the following tests:
  1. Right-click anywhere in the virtual machine window: does a pop-up appear repeatedly in the bottom right corner no matter where you right-click?
  2. Using your keyboard navigation skills, check the installed software: is Virtual Machine Additions listed?
If either is the case, try the following:
  1. Re-open the VHD in Virtual PC or Hyper-V, remove the Virtual Machine Additions, and then repeat steps 1-4 above.
  2. Re-install or update the VMware tools, but leave out the mouse driver, and then reboot.
  3. Launch Regedit, navigate to
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\... ...Class\{4D36E96F-E325-11CE-BFC1-08002BE10318}
    look for the UpperFilters setting, and remove msvmmouf and any spaces from its value, leaving the mouclass value still there
Troubleshooting II: Shutdown Locks
This occurs after attempting a normal shutdown of the server.  The screen changes, the message appears indicating that server is shutting down, the message disappears, and then only a normal desktop is displayed that is unresponsive to keyboard and mouse input.  The only way to force the server to shutdown us using VMware shutdown option.  There is significant discussion and troubleshooting steps on this issue to be found in the VMware knowledgebase.  However, the workaround is simple:
  1. On the VM server (guest OS), from the Start menu, point to Control Panel, and then point to VMware Tools.
  2. Click this item.  The VMware Tools dialog appears
  3. Select the Scripts tab:
    1. On the Scripts tab, from the Script Event dropdown, select Shut Down Guest Operating System.
    2. Enable Use Script.
    3. Select Custom script
    4. Click the Edit button.
    5. In that file, add the following:  shutdown /s /t 10 /d P:0:0 /c "VM guest shutdown".
  4. Save and close the file
  5. Click OK.
  6. Test by performing a normal shutdown of the server.
References
Notes

Sunday, October 6, 2013

Error 1060: vmdebug.sys has been blocked from loading due to incompatibility with this system

Problem

Created new virtual instance of Windows Server 2008 R2 on VMware Workstation 7.x.  After installation, checked server System log and discovered this error:

Log Name:       System
Source:             Application Popup
Date:                [Date]
Event ID:         1060
Task Category: None
Level:               Error
Keywords:       Classic
User:                N/A
Computer:        spdev12.contoso.com
Description:
\??\C:\Windows\system32\Drivers\vmdebug.sys has been blocked from loading due to incompatibility with this system. Please contact your software vendor for a compatible version of the driver.
.
.

Resolution
  1. Go: Start > Run > Regedit.
  2. Navigated to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\vmdebug:
  3. Modified Start data from 1 to 4:
  4. Rebooted: new instances of error no longer appear in server System log.
  5. Success.
References

Wednesday, September 25, 2013

Build a Windows Server 2003 R2 (32) Clone Template

Introduction

This posting compiles notes on building a Windows Server 2003 R2 SP2 32-bit server clone template for development and training purposes, for use with VMware Workstation 7.X. This procedure is based upon an evaluation copy of Windows Server 2003 R2.  Settings that are not specifically indicated below are default.  Creating the clone involves five discrete steps:
  1. Preparing the VM
  2. Installing Windows Server 2003
  3. Configure Windows
  4. Install VMware Tools
  5. Sysprep
Other optional steps also covered here include: building a new VM from the clone and setting up Active Directory and DNS services.

Step 1: Prepare VM
 
Build a new VM using the following parameters:
  1. Have both installation disks ready.
  2. Start the procedure for building new VM using the following parameters.  Use the following configuration settings as you work through the New Virtual Machine Wizard:
    1. Type of configuration: Custom (advanced)
    2. Choose virtual machine hardware compatibility: Workstation 6.5-7.X.
    3. Guest operating system installation: I will install the operating system later.
    4. Select a Guest Operating system: Windows Server 2003 Enterprise Edition (not x64).
    5. Name the Virtual Machine: Template2k3R2Sp2.
    6. Processor Configuration:
      1. Processors: 1
      2. Cores: 1
    7. Memory for the Virtual Machine: 1536
    8. Network Type: Bridged
    9. Select I/O Controller Types: SCSI Controller: LSI Logic
    10. Select Disk: Create a new virtual disk
    11. Select a Disk Type: SCSI
    12. Maximum disk size: 25GB
      • Allocate all disk space now: enabled
      • Store virtual disk as a single file: selected
Step 2: Install Windows Server
  1. Insert Windows Server 2003 R2 Enterprise SP2 disk 1 of 2
  2. Power on VM.
    1. Computer name: Template2k3R2Sp2.
    2. Administrators password: [blank].
    3. Network settings: Typical settings.
Step 3: Configuration
  1. Install VMware Tools - typical installation
  2. Disable Internet Explorer Enhanced Security.
Step 4: Install VMware Tools
  1. On VMware Workstation, from the VM menu, select Install VMware Tools.
  2. Reboot.
Step 5: sysprep
  1. Insert the Windows Server 2003 R2 installation disk 1.
  2. Create new folder at: root:\sysprep.
  3. Navigate to: CDDrive:\Support\Tools\Deploy.CAB.
  4. Copy contents of CAB file to new folder.
  5. Double-click setupmgr.exe.
    1. New or Existing Answer File: Create new.
    2. Type of Setup: Sysprep setup.
    3. Product: Windows Server 2003 Enterprise Edition.
    4. License Agreement: No, do not fully automate the installation.
    5. Wait for message stating "You have successfully completed...", then click Cancel button.
  6. Verify File and Printer Sharing is installed.
  7. Verify Server Service is running.  If not, start it.  Use Services.msc.
  8. Double-click sysprep.exe.
    1. Prompt: OK.
    2. Dialog: keep all defaults, then click Reseal button.
      • NOTE: if this prompt appears, leave it be (don't click OK), then verify that the Server service is started.  If not, start it and then return to the prompt, click OK, and then click Reseal again.
    3. Prompt: OK.
  9. Shutdown (automatic).
Optional: Build new machine from clone
  1. Right-click on the template, and then select Clone.
  2. Select the following settings at each window of the Clone Virtual Machine Wizard:
    1. Clone from: The current state in the virtual machine.
    2. Clone method: Create a full clone.
  3. Click Close.  Clone operation will take approximately five minutes.
  4. Power on new machine.  Windows Setup Wizard starts.
  5. Configure new settings as needed.
Optional: Configure Domain Controller
  1. From the Start menu, select Manage Your Server.
  2. On the Manage Your Server page, click Add roles.  The Configure Your Server Wizard appears.
  3. Click Next.
  4. On the Configure Options page, select Typical configuration for a first server, and then click Next.
  5. On the Active Directory Domain Name page, enter a domain name, and then click Next.
  6. On the NetBIOS page, click Next.
  7. On the Summary of Selections page, click Next.  At the prompt, click OK.
  8. On the Server Configuration Progress page, click Next.
  9. On the This Server is Now Configured page, click Finish.
  10. View the Configure Your Server log: C:\Windows\Debug\Configure Your Server.log.
  11. On the Manage Your Server page, click Add or remove role.
  12. Click Next.
  13. Select DHCP, and then click Next.
  14. Enable the checkbox, and then click Next.  This removes DHCP.
Summary

This posting collates and archives notes on creating a template for Windows Server 2003 R2 Enterprise.

References
Notes
  • There is an incompatibility between this tool and the current operating system.  Unable to continue: verify that the Server service is running.

Friday, September 13, 2013

How to build and deploy clone servers on VMware Workstation

Introduction

This posting walks you through the process of building and deploying clones of Windows Server 2008 R2 within the VMware Workstation environment. It involves a five-step process: build, sysprep, snapshot, clone and launch.  Budget about 3h for completion of all steps - most of which will involve the build step.

Step 1: Build
  1. In VMware Workstation, create a new VM.  For my work, 40GB disk is sufficient
    • 1.5GB memory will work fine if total host memory is limited.
  2. Install Windows Server 2008 R2
  3. Install Windows Server 2008 R2 Service Pack 1
  4. Install all remaining updates
  5. Do not add roles or features (these are not supported for sysprep)
  6. Do not configure the network adapter
  7. Do not configure system properties
Step 2: Sysprep
  1. Navigate to C:\Windows\System32\sysprep:
  2. Launch sysprep.
  3. Configure as:
    1. System Cleanup Action: Enter System Out-of-Box Experience (OOBE)
    2. Generalize: Enabled
    3. Shutdown Options: Shutdown
  4. Click OK.
  5. Wait for completion. 

    Shutdown.
Step 3: Snapshot
  1. Right-click build in VMware Workstation sidebar
  2. Choose Take Snapshot
  3. Enter identifying information
  4. Click OK.
Step 4: Clone
  1. Right-click build in VMware Workstation sidebar
  2. Choose Clone...
  3. Click Next
  4. Select An existing snapshot (powered off only)
  5. From dropdown, select snapshot you created
  6. Click Next
  7. Select Create a full clone
  8. Click Next
  9. Enter virtual machine name and location
  10. Click Finish
  11. Wait for completion.
Step 5: Launch
  1. Select a new clone and power up.
  2. On power up, the startup screen will appear different. 

    Seeing this screen is an indication that your clone was successful.  Services and devices will be installed. To retain services and devices in the template, review the references for additional command line arguments.
  3. After bootup, complete the usual installation prompts
  4. This completes this procedure.
Summary

In this posting, you have learned how to build and deploy clones of Windows Server 2008 R2 in VMware Workstation.

References
Notes
  • If after cloning the build and joining it to your domain, you experience weird problems such as disappearing domain accounts or security principal errors, verify that you made the snapshot after sysprep and not before.