Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using diskshadow to backup live Hyper-V machines on a Windows 2008 server.

The backup consists of 3 scripts, the first will create the shadow copies and expose them, the second uses robocopy to copy them to a remote location and the third unexposes the shadow copies again.

The first script – the one that runs correctly but fails to do what it's supposed to:

# DiskShadow script file to backup VM from a Hyper-V host
# First, delete any shadow copies of the drives. System Drives needs to be included.
Delete Shadows volume C:
Delete Shadows volume D:
Delete Shadows volume E:

#Ensure that shadow copies will persist after DiskShadow has run
set context persistent

# make sure the path already exists
set verbose on
begin backup
add volume D: alias VirtualDisk
add volume C: alias SystemDrive

# verify the "Microsoft Hyper-V VSS Writer" writer will be included in the snapshot
# NOTE: The writer GUID is exclusive for this install/machine, must be changed on other machines!
writer verify {66841cd4-6ded-4f4b-8f17-fd23f8ddc3de}
end backup

# Backup is exposed as drive X: make sure your drive letter X is not in use
Expose %VirtualDisk% X:

The next is just a robocopy and then an unexpose.

Now, when I run the above script, I get no errors from it, except that the "BITS" writer has been excluded because none of its components are included. That's okay because I really only need the Hyper-V writer. Also I double checked the GUID for the writer, it's correct.

During the time when the Hyper-V writer becomes active, 2 things will happen on the guest machines:

  1. The Debian/Linux machine will go to a saved state and restore when done, all fine.
  2. The Windows guests will "creating vss snapshop-sets" or something similar.

Then X: gets exposed and I can copy the .vhd files over.

The problem is, for some reason, the VHD files I get over seems to be old copies, they miss files, users and updates that are on the actual machines.

I also tried putting the machines in a saved sate manually, didn't change the outcome. I hope someone here has an idea of how to solve this.

share|improve this question

migrated from Oct 5 '12 at 9:29

This question came from our site for computer enthusiasts and power users.

I think you'd do better over at ServerFault. I'll start the migration process. – KronoS Oct 5 '12 at 6:07
Allright, thanks – Martinnj Oct 5 '12 at 9:19
Are there any useful events logged in the Windows Application event log? – Twisty Sep 26 '14 at 1:18

I see that this hasn't been answered for a long time, so I'll assume that there was no solution or VSS agent is faulty.

Instead of using scripts, I'll propose another solution for you that might just help. My friends have been telling me about this free nice tool that is specifically used to backup Hyper-V guest machines from Windows, I'd recommend you to use it and see if it gets you better functionality that what you're using now.


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.