»

Thursday, November 21, 2013

How to backup VMware using the Volume Shadow Copy Service

 

Summary: The purpose of this guide is to show you how to setup and use the VMWare VSS writer to perform consistent VSS backups of VMWare guest machines.

Note: Some of the following instructions can also be found in the VMWare Server 2.0 technical documentation.

Limitations

  • The VMWare VSS writer is only installed with VMWare Server 2.0 and later.
  • This procedure is only possible on Server 2003 32-bit and 64-bit and Server 2008 32-bit operating systems.

Checking the VMware VSS Writer is present

First, you need to check that the VMWare VSS writer is present on the machine and that it is working correctly.

  1. Open a Command Prompt by navigating to Start > Run and typing 'cmd' in the text field provided.
  2. In the command prompt window type vssadmin list writers and press Enter. This will list all the VSS writers running on the machine and their current state.
  3. Locate the 'VMWare vss writer' and confirm that it is in a stable state.
    Tip: record the 'Writer Id' for the VMware VSS Writer by right-clicking the command prompt window and selecting 'Mark'. Now drag a box around the Writer Id and press Enter. You can now copy the Writer Id to a text file in Notepad.
    wbadmin versions list
    If the VMware VSS Writer is not listed check that the 'VMware VSS Writer' service is started under Control Panel > Administrative Tools > Services.

Allowing the VSS writer to overwrite existing snapshots

VMware Server only allows one snapshot for each Guest virtual machine. If a snapshot exists, the VSS writer will not disable the virtual machine.. To override this default behaviour carry out the following:

  1. Create a file called vmvsswriter.cfg in the directory where VMware is installed (by default C:\Program Files\VMware\VMware Server.)
  2. Open the vmvsswriter.cfg in notepad and add the following command:  vmwriter.overwriteSnapshots = "TRUE". This command will allow snapshots to be overwritten.
  3. Save vmvsswriter.cfg and exist Notepad.
  4. Re-start the 'VMWare vss writer' service under Control Panel > Administrative Tools > Services.
  5. You should now be able to backup your VM guests using the native Microsoft Volume Shadow Copy service.

Adding the VMware VSS Writer Id to the Registry

Note: this step is only required for Server 2008 32-bit operating systems.

In order for Windows to be able to utilize the VSS writer, you need to make some modifications to the Windows Registry.
Note: it is a good idea to make a backup of the Windows Registry before carrying out the following steps.

  1. Open RegEdit by going to Start > Run and typing 'regedit' in the text field provided.
  2. Browse to registry key 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WindowsServerBackup\Application Support\'
  3. Add the VMware Writer Id that you recorded earlier (step 3 under 'Checking the VMware VSS writer is present') as a new key by right-clicking on Application Support and selecting New > Key.
  4. With the new Key still selected choose Edit from the top menu and select New > String Value.
  5. Call the new String Application Identifier.
  6. Double-click the new String and enter VMware in the 'Value data' field.
    wbadmin system state restore begun

Wednesday, November 20, 2013

How to fix VSS errors in Windows XP and 2003.

1. Click Start, click Run, type Regedit, and then click OK.

2. Locate and then click the following registry subkey:

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\EventSystem\{26c409cc-ae86-11d1-b616-00805fc79216}\Subscriptions

3. On the Edit menu, click Delete, and then click Yes to confirm that you want to delete the subkey.

4. Exit Registry Editor.

5. Click Start, click Run, type services.msc, and then click OK.

6. Right-click the following services one at a time. For each service, click Restart:

  • COM+ Event System
  • COM+ System Application
  • Microsoft Software Shadow Copy Provider
  • Volume Shadow Copy

7. Click Start, click Run, type cmd, and then click OK.

8. At the command prompt, type vssadmin list writers, and then press ENTER.

9. If the VSS writers are now listed, close the Command Prompt window. You do not have to complete the remaining steps. If the VSS writers are not listed, type the following commands at the command prompt. Press ENTER after each command.

  • cd /d %windir%\system32
  • net stop vss
  • net stop swprv
  • regsvr32 ole32.dll
  • regsvr32 oleaut32.dll
  • regsvr32 vss_ps.dll
  • vssvc /register
  • regsvr32 /i swprv.dll
  • regsvr32 /i eventcls.dll
  • regsvr32 es.dll
  • regsvr32 stdprov.dll
  • regsvr32 vssui.dll  (does not work in Windows XP)
  • regsvr32 msxml.dll
  • regsvr32 msxml3.dll
  • regsvr32 msxml4.dll

Note The last command may not run successfully.

10. At the command prompt, type vssadmin list writers, and then press ENTER.

11. Confirm that the VSS writers are now listed.

12. At the command prompt, type vssadmin list shadows and then press ENTER.

13. Confirm that there are no errors listed.  On Windows XP you should see: No shadow copies present in the system.

14. Congratulations your machine should work again with any VSS compatible programs.