How to attach (mount) VHD which is currently used by Hyper-V VM to the host

hyper-vvhdwindows-server-2008-r2

I want to be able to read data from the Hyper-V VMs on the host. I understand I can go to DISM and attach VHD there – but it requires a VM to be offline – otherwise I get the following error:

Virtual Disk Manager

The process cannot access the file because it is being used by another process.

Are there any ways to achieve this while keeping VM online? I want this primary for making backups easier.

Best Answer

If your goal is backups, then you should be using Hyper-V aware backup software (something that uses the Hyper-V VSS writer). While the VM is running, the .vhd/.vhdx file is locked.

If you want to backup files within the VM, then use any backup software you like that will backup flat files/sql/exchange/whatever.

It sounds like the VM portion it throwing you off. Take that out of the equation, treat it like a standard computer and find a backup solution that works for you.

Related Topic