none
Mount Server 2012R2 VHDx in Server 2016

    Question

  • Hi All

    I am having issues mounting Server2012R2 VHDx files with PowerShell. When I try and mount the VHDx files I get the error 

    Mount-VHD : The Hyper-V Management Tools could not access an expected WMI class on computer xxxx 

    This may indicate that the Hyper-V Platform is not installed on the computer or that the version of the Hyper-V Platform is incompatible with these management tools.

    I can however mount the images via Explorer.

    Hyper-V Module for Windows PowerShell is installed ( As well as all other management tools)

    Any help would be appreciated.

    Thanks

    Tim

    Friday, February 3, 2017 7:05 AM

Answers

  • It seems that it is? How did you verify? That WMI path is not part of the tools, it is part of Hyper-V.

    Run this in an elevated PowerShell prompt:

    gwmi -Namespace root\virtualization\v2 -List
    If you get an invalid namespace error, then that is why the *-VHD cmdlets don't work. However, the *-DiskImage cmdlets will work just fine.

    Eric Siron
    Altaro Hyper-V Blog
    I am an independent contributor, not an Altaro employee. I accept all responsibility for the content of my posts. You accept all responsibility for any actions that you take based on the content of my posts.

    • Proposed as answer by Tim CerlingMVP Wednesday, February 8, 2017 1:15 PM
    • Marked as answer by TeeStar Thursday, February 9, 2017 10:16 AM
    Monday, February 6, 2017 2:28 PM

All replies

  • Hi Tim,

    The issue seems strange.

    Run sfc /scannow to see if there were any corrupted system files.

    >>Hyper-V Module for Windows PowerShell is installed

    Have you tried to reinstall the module?

     If you create a VHDX on server 2016, are you able to mount it through powershell?

    Best Regards,

    Leo


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, February 3, 2017 9:06 AM
    Moderator
  • Can you mount a VHD created on the 2016 server? Can you use other VHD PowerShell commands to create and mount a VHD completely on the 2016 system? If not, you could try uninstalling the Hyper-V Management tools and re-installing them.

    . : | : . : | : . tim

    Friday, February 3, 2017 1:42 PM
  • Is the Hyper-V role enabled? Mount-VHD doesn't work if root\virtualization\v2 isn't present. The Explorer tools use a different mechanism to mount VHD/X files.

    Try:

    Mount-DiskImage -ImagePath <fully-qualified-path-to-file.vhdx>


    Eric Siron
    Altaro Hyper-V Blog
    I am an independent contributor, not an Altaro employee. I accept all responsibility for the content of my posts. You accept all responsibility for any actions that you take based on the content of my posts.

    Friday, February 3, 2017 2:08 PM
  • Thanks Guys I appreciate it.

    I have tried to uninstall and re-install Hyper-V management tools to no avail. It seems that none of the Hyper-V cmdlets work. However DiskPart  has no issues mounting or creating VHDs.

    @Eric Siron it seems that the  root\virtualization\v2 is installed. I guess that explains the errors. Not sure of where to go from here tho.

    Monday, February 6, 2017 8:46 AM
  • It seems that it is? How did you verify? That WMI path is not part of the tools, it is part of Hyper-V.

    Run this in an elevated PowerShell prompt:

    gwmi -Namespace root\virtualization\v2 -List
    If you get an invalid namespace error, then that is why the *-VHD cmdlets don't work. However, the *-DiskImage cmdlets will work just fine.

    Eric Siron
    Altaro Hyper-V Blog
    I am an independent contributor, not an Altaro employee. I accept all responsibility for the content of my posts. You accept all responsibility for any actions that you take based on the content of my posts.

    • Proposed as answer by Tim CerlingMVP Wednesday, February 8, 2017 1:15 PM
    • Marked as answer by TeeStar Thursday, February 9, 2017 10:16 AM
    Monday, February 6, 2017 2:28 PM
  • OK, great thank you very much I appreciate it. That is what is wrong.


    Wednesday, February 8, 2017 10:59 AM