Showing posts with label Hyper-V. Show all posts
Showing posts with label Hyper-V. Show all posts

Tuesday, June 7, 2011

DC with Copied VM in Hyper-V, Fail

I previously built a domain controller using a copy of a Windows Server 2008 R2 Core template that I had already setup. Everything worked fine until I built another server using the same template and joined it to the domain. Then I ran into this:

Event 5516 The computer or domain [machine] trusts domain [domain]. (This may be an indirect trust.) However, [machine] and [domain] have the same machine security identifier (SID). NT should be re-installed on either [machine] or [domain].

Bottom line here is that you do not ever want to copy/clone/duplicate a server to build a new domain. Your domain controller for your new domain needs to be a unique build, so that it has a unique machine SID. Based on this article, you can feel free to copy/clone/duplicate servers for all other scenarios. It is my understanding that you can even do this when adding a new domain controller to an existing domain - because the new DC will inherit the SID from the domain. This issue only occurs with duplicating a server to build a DC for a new domain.

Now I have to go fix a couple VMs...

Monday, May 16, 2011

Hyper-V Tools for R2

After searching the internet for hours it seemed clear that setting up a dedicated network in Hyper-V was something that should be possible. I’d read dozens of posts on how dedicated networking was a new feature for Hyper-V R2. So why couldn’t I figure out how to do it?

I eventually found my way to this blog post from John Howard. The article clearly explained the new networking option and included a picture of what the screen should look like. So… why didn’t my screen look like that? Well, if you scroll down and read the comment posted by John on March 25, 2010, you’ll find out.

“That checkbox only exists on the v2 UI present in Windows 7 and/or Windows Server 2008 R2. The v1 (Vista) UI operating against R2 is not supported - you should be using the v2 UI instead.”

Seriously? The Windows Vista Hyper-V client has not been updated to support Hyper-V R2. And based on John’s comment, I’m going to guess that it never will be. Why doesn’t the download page for the Vista Hyper-V tools explicitly state that they are NOT compatible with Hyper-V R2? Where’s the bright red print? WTF! If the guy who wrote that KB article was standing in front of me I’d kick him square in the nuts! Thanks Microsoft. Thanks for wasting hours of my life.

Here’s another article that John wrote, specifically on using the Vista client for R2.

For most people this probably isn’t an issue. Just manage Hyper-V from the Windows Server 2008 R2 box. But when your corporate network runs Vista and the first Windows Server 2008 R2 box you deployed is Windows Server 2008 R2 Core running Hyper-V… where exactly does that leave you? Screwed, that’s where it leaves you.

Thursday, April 7, 2011

Copying VMs in Hyper-V

I’m a programmer. I have plenty of experience building and configuring systems, but I’m not a real systems engineer. As a result, I can, and have, screwed up my share of systems. For the virtual network that I’m building, I need a way to recreate VMs easily when I screw them up.

I already have a base Server Core VM that I have built in Hyper-V. My first inclination is to just make a copy my existing VHD. Then create a new VM and point it to that copied VHD. Let me save you some time - don’t do that.

When you create a VM and attach a copied VHD, something about the Hyper-V settings are just different enough that Windows needs to be reactivated. You may have better luck, but I tried it several times using my Server Core VHD with the same result each time.

This isn’t an issue if you’re perfect and will never need to recreate any of your VMs. Me, I’m likely to go through 15 VMs over the next year. Since, to the best of my knowledge, my MSDN key can only be used to activate a machine 10 times, I’m likely to have an issue.

Solution: use Hyper-V’s export and import functionality. Select the VM in Hyper-V, right click and select "Export..." This will open a dialog box asking you where you want to export the files. Whatever folder that you pick, Hyper-V will create a new folder in the location with the same name as the VM. Once you click Export, Hyper-V will start to copy your VM. In the main Hyper-V window scroll all the way to the right side to see the "Status" column. It will show you the progress of your export.


Once the export has completed, I rename the folder that Hyper-V created to whatever I want my new VM to be named. Then select "Import Virtual Machine..." from the Actions menu on the left side of the Hyper-V window. Browse to the folder you just renamed and select it. Change the Import settings to "Copy the virtual machine". It’s not actually going to copy the VM, but import it as a unique VM.


Once the VM has been imported, you’ll have to rename it in Hyper-V. And I tend to rename my VHDs as well, but that’s a personal preference. Once you finish making all the changes that you need and start the VM, you can run the following command to validate that it’s still activated.

start /w slmgr.vbs -dli

This was all tested with Server Core, but I would expect the same results in full Windows Server.

UPDATE (5/22/2011):  Tested this with the regular version of Windows Server 2008 R2 and it works.

UPDATE (6/7/2011):  Do NOT do this if you're building a domain controller for a new domain. You'll run into this problem.

UPDATE (10/1/2012):  A few months ago I replaced my server with a beefier box. My exported VM template, when imported, was no longer activated. Activation does seem somehow tied to the host. I wanted to figure out how I could have prevented it, but I didn't have the time. So I just reactivated my template moved on.