How to attach existing VHD file to newly created VM

Feb 23, 2011 at 4:17 PM


I am fairly new to hyper-v and specifically this library for command line access to management.  I have a Windows 2008 R2 Core installation and we don't have Microsoft System Center to manage via the GUI.  I have the hyper-v library installed for powershell and have created a new VM, assigned memory and nic to it and now need to attach a VHD file that I created from the utility disk2VHD.  I'm a bit confused by the documentation on the steps necessary to accomplish this.

My vhd is on the local core server in:  v:\virtual machines\servername\serveranme\servername.vhd

It was made from a physical server that had a c: and e: drive, both are in the VHD.

I would like to attach it to my newly created VM and boot the VM...

Can you point me in the right direction or provide an example?



Feb 28, 2011 at 11:55 PM

Add-VMdisk -vm "yourVMname" -path "v:\virtual machines\servername\serveranme\servername.vhd"

Should do it.