Hyper-V Resolving Event ID 4096


Over the break I’ve been taking over Christmas, one of my goals was to move the remainder of my Virtual Server “production” VMs across to Hyper-V. But when nearing completion, I noticed that Server Manager was reporting a role error: 2008-dec-eventid-4096[1]



Role Error


Looking at the detail of the event logs, it was Event ID 4096 from Hyper-V-Config saying that The Virtual Machines Configuration {GUID} at ‘{Directory}’ is no longer accessible: The system cannot find the path specified. (0x80070003)


Role Error2


This is a pretty common error many people hit, and in my case it was due to some rearranging of directories and moving virtual machines around until I had it “just right” in terms of how I like to set my own servers up. By personal preference (nothing more), I like to keep the configurations, snapshots and VHDs for my virtual machines under a single directory on a per VM basis – in my case v:\virtual machines. However, when playing earlier with my new server, I’d been using the v:\vms directory (hence the specific error in the screenshot below).


So in Hyper-V Manager, under Hyper-V Settings, I enter V:\Virtual Machines in the text boxes for both Virtual Hard Disks and Virtual Machine Configuration files.


Role Error4


 


Then, when using the New Virtual Machine wizard, I check “Store the virtual machine in a different location” but keep the default directory set above, and get to the Connect Virtual Hard Disk step, the wizard populates the default directory for a new VHD in a sub-directory under V:\Virtual Machines named the same as the Virtual Machine.


Role Error6


If you examine the directory structure of V:\Virtual Machines\Test after completing the wizard, you end up with this (if you also take a snapshot)


Role Error7


Your VHD is in the main directory, and the configuration and snapshot data-root are under the Virtual Machines and Snapshots subdirectories under “Test” (or whatever you name your virtual machine). In other words, everything for that virtual machine is in a single location which was the primary intent.


Anyway, (as I frequently do in my blog posts), I somewhat digress. Back to the Event ID 4096 which indicated there was a problem with V:\VMs, the original location I was using when moving virtual machines across from Virtual Server.


If you navigate to \ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines on your system drive (note that ProgramData is a hidden directory), you’ll notice that there are a number of symbolic links to configuration files. There are two in the screenshot below (one being highlighted) which points to the V:\VMs\… directory.


Role Error3


So it’s a simple case of very carefully deleting that or those links (just use the “del” command) which refer to the old directory, and cycling the VMMS service (net stop vmms, then, net start vmms). After this, the error will no longer be logged. Please be extremely mindful not to delete links referring to VMs you want to keep! Onwards with the rest of the migration now…


Cheers,
John.

Comments (11)

  1. Anonymous says:

    Chris – what build number of Windows 7, and are you logging on with a smartcard? (I assume you are also remotely managing a server…..? If so, what is the server build – 2008, or R2, and if R2, which build number?)

    Thanks,

    John.

  2. Anonymous says:

    Chris – is it possible you are hitting
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;967902? Alternately, under Hyper-V Settings in Hyper-V Manager, have you flipped the "Use default credentials…" checkbox?  It shouldn’t be necessary to import a certificate from the server into the
    Win7 client….

    Thanks,

    John.

  3. Andy Stumph says:

    Hey John,

    I ran into this a while back and I wrote a little powershell script to delete the broken links.

    It uses James O’Neill’s Hyper-V library on codeplex http://www.codeplex.com/PSHyperv, so you will need that loaded into your shell.

    -Andy

    ——-

    . .Hyperv.ps1

    $VMPath = "C:ProgramDataMicrosoftWindowsHyper-VVirtual Machines"

    $FileNames = Get-ChildItem $VMPath | select Name

    $VMs = Get-VM | Select Name

    foreach ($FileName in $Filenames)

    {

    foreach ($VM in $VMs)

    {

    #$VM.Name

    if ($FileName.Name.split(".")[0] -match $VM.Name)

    {

    $Match = "True"

    }

    }

    if (-not $Match)

    {

    Write-Host "Deleting $($FileName.Name)" -foregroundcolor Red

    Remove-Item "$($VMPath)$($FileName.Name)"

    }

    else

    {

    Write-Host "$($FileName.Name) is Good!" -foregroundcolor Green

    }

    $Match = $Null

    }

  4. rajeev says:

    This is a great post and was really helpful! If only the Hyper-V team decided to add this event ID to their online help documentation.

    And I would assume that the UI would expose these stray hyper v configs and let the user delete them without messing with the config files. Alas, Wishful thinking???

  5. Chris says:

    Argh.  I admit, I am completely stuck.  I’ve managed to make the Hyper-V MMC Manager work in Windows7 32bit; but in 64 bit, I’m now getting a goofball issue.. I can connect and see the VMs, but when I try to start any of them, I get an error..

    "Your system adminstrator does not allow the use of default credentionals to log on to the remote computer HYPERV because it’s identity is not fully verified."

    So, hell, I go ahead and add the certificate as a trusted publisher.. it makes absolutely NO difference,

    "The certificate is not from a trusted certifying entity"

    (I think).

    Works beautiful in Win7 32bit.. but damn, I’m stuck.. anyone seen this ???

  6. Chris says:

    John-

    I’m using 7000 X64 build; I probably should log into my MSDN account and see if there is a new one out there for me to grab, but haven’t had a chance, I will try to do that today.  

    On our HyperV, I have these servers:

    Windows 2008 (stand alone)

    Windows 2003 SBS (setup, virtualized from dead hardware)

    And here’s a bit of a gasp, but wanted to try it, a Windows NT 3.1 Server.. just wanted to try this, still had the floppy discs, so what the hell 🙂 🙂

    The thing is, it doesn’t matter which VM I try to connect to, the Windows7 box won’t let me get remotely that far, saying the certificate for the box I’m connecting to (HYPERV, a box running Hyper-V 2008 Server, ie core) has a certificate published by a non-authenticated server.  I’ve added the certificate to the trusted publishers, etc. still no-go.  

    Blah!

    I’m wondering whether or not turning on the Win2k3 SBS, which is setup as an AD,  whereas everything else in this test environment is stand-alone is part of the issue.  I’ve debated giving the SBS an IP outside of the local range and creating a virtual IP-network to keep it off the same subnet as the HyperV server, just in case I"m running into something that way.  

    But the Win7 x32 build can open up a window on all of these.

    That’s the weird part.  On the x64 build, the manager opens, it sees the server, I can even create new VMs.. at least build the HDD, change settings, etc. all of that works.  I can even get the thumbnail view of what’s going on.. but when I try to connect to them, bammo.. the certificate/publisher stuff shows up 🙁

  7. Chris says:

    Never mind.  In WIndows 7 X32, "Install Certificate" works fine.. but it doesn’t in x64.  Using the certificates MMC plugin, I was able to add the certificate to the local computer and that fixed it.

  8. Chris says:

    Nope, not running into expired certificate; using a Hyper-V Server R2 (Beta) candidate for testing purposes only; certificate is valid through 3/10 or something.   It just doesn’t like publisher.  I ran the HVRemote script to reset; I’ve replicated this, it only seems to occur within the x64 version, this never happens in x32.. so, I’ll submit it in as a bug for now.. 🙂  But it’s fixed after an import.

  9. Joe says:

    Thank you very much!!!!

    Great information, and super helpful.

    Cheers!

  10. sreejith says:

    Update the patch in the hyper – v host server and restart to solve the certificate expiration issue

    support.microsoft.com/…/967902

  11. Berto says:

    Thank you for this post.
    In my case the event ID 4096 was refered to Snapshot configuration, so i deleted the symlink both in C:ProgramDataMicrosoftWindowsHyper-VSnapshots and C:ProgramDataMicrosoftWindowsHyper-VSnapshots Cache
    Thanks