I made a rookie mistake and did not use best practices. I installed hyper-v, promoted to a AD/DC and created several VM’s.

Found out this would be a problem and not supported so I demoted the Host and cannot access the VM’s any longer.

Any help out there for me?

I try to import the VM’s and I am getting a permission error.

4 Spice ups

Login in to host, take ownership of the vm files, then try to import again.

Edit: Typo

5 Spice ups

What happens if you log in locally into to hyper-v host? and openthe Hyper-V manager?

Did you join the host to that domain?

Remove the role from the box.

Add the role to one of the VMs.

I clicked on this thread because just yesterday I added a Hyper-V VM to my AD/DC. Are you saying that is an issue and is not supported, or did you have your AD/DC on a VM? I’m a bit concerned. Do I need to modify my setup? Sorry I’m no help in fixing your issue.

Its not supported from Microsoft to have the Hyper-V Host as a DC. VM’s can without any issue.

Also it is most likely against licensing agreement to do it

1 Spice up

i did

I made my HOST the AD / DC, the VM was a member

Assuming that when you demoted the DC it also destroyed the domain unless you have other DC’s in your enviornment, and the hyper-v host still looking to authenticated against the domain its going to have issues. Unjoin it from the domain and just into a workgroup, then login locally and start your VM’s

You can try to create a new VM and attatch the VHD’s to the new machine.

ah…lol that’s right, so is the Hyper-V host just in a workgroup now?

Do you have more than one DC?

If not, when you removed the one and only DC you would have reverted a bunch of permissions.

You’ll need to logon to the hyper-v box as a local admin

1 Spice up

ouch, yeah the solution depends on whether or not the DC/VM Host was the ONLY DC in the domain.

I’m hoping it wasn’t but it sounds like it may have been…!

Like others have said, you’ll have to login to the machine with local admin account to do anything with it.

1 Spice up

Need to enble “winrm qc” and then add the hyper-v to TrustedHosts and connect to it remotely?

Problem is actually that hyper-v creates a service account for each vm. These are local accounts except if you are running on a domain controller where they become domain accounts. So, when you demoted that host you effectively deleted the local account.

I would recommend copying the .VHD/.VHDX files to a new location and create a new vm using the copied files. Then when it’s running delete the old vm. If that fails it will give you an access error in the event log that you can use to track down the files (typically under c:\ProgramData).

2 Spice ups

Actually came across the blog that helped me when I ran into this when I moved a machine between domains. Archived MSDN and TechNet Blogs | Microsoft Learn

1 Spice up

OP - Listen to Don007 - he’s on the right track to help you. You horked the permissions.