Link to home
Start Free TrialLog in
Avatar of Garyn Charlet
Garyn CharletFlag for United States of America

asked on

Cannot start hyper-v VM

Stumped.
 Server 2012 core with 2 VMs. VM1 had a usb drive attached for backup.
When swapping drive, forgot to remove it in VM1 before I unplugged the cable to the usb drive. Couldn't start VM1 w/o drive at all. Got it reconnected. It didn't show up in VM settings under controller 0. Tried to re-add  it in settings but errors that the drive is already attached. Went into the xml file and removed anything pertaining to the usb drive and I must have taken out something I shouldn't have and it said it couldn't find the file. I'm pretty bad at xml'
Any ideas now to reconnect (or remove and re-add it) the usb drive to the virtual machine. I have the machine files. Would deleting the vm and creating a new vm and attaching the machine file. Any suggestions are very welcome.
Drive-already-attached.jpg
Not-initiate.jpg
Avatar of Lee W, MVP
Lee W, MVP
Flag of United States of America image

Can you edit the drive settings on the VM? If so, disconnect it from the VM, then save.  Then, edit again and re-attach.  I've seen similar problems a couple years ago, I believe when it's an issue with perms on the drive which strangely get reset when the drive is attached/detached.
Avatar of Garyn Charlet

ASKER

Hi Lee, thanks for the response! I have saved the settings, but when I go back to  I am guessing the settings for the drives etc. are in the xml file in the virtual machine folder. I am not a programmer by a long shot, but I went into the ,xml file and removed anything that I thought was a reference to the usb drive, I'm sort of making semi-educated guesses as to where the references to that drive begin and end. I am not a coder in any way. As I'm continuing to research this, it seems VMs can put files pertaining to boot on attached drives, so I'm wondering if the only reason for the boot failure is that it can't reconnect that drive.
Could be.  

Can you reconnect the drive?

Also, I wasn't suggesting you edit the XML file - in Hyper-V manager, remove the drive from the VM's settings, then add it back (if you need it).
Well, in the VM settings, nothing shows in the controller 0 as being connected. But, when I take the usb drive offline (per instructions) and try to add it, I get the error of "the device is already attached". The xml file edits were my idea. And perhaps if I connect with someone who knows xml and hyperv, it would be easy (for them). The main thing I think is that the VM config either has files it needs from that drive or it simply fails because it cannot find the device, I was hoping by editing drive and boot  xml file, I think if I could make forget about the usb drive for the moment it would start up.
Does that make any sense at all?

g
ASKER CERTIFIED SOLUTION
Avatar of Philip Elder
Philip Elder
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks so much. Both of you sent me in the right direction. The Remove VHD was exactly what I needed. I did it another way, but having those commands would have saved me a lot of headache!