Replace Hyper-V Virtual Disk












5















Some updates crashed my hyper-v virtual machine. The good news is I created a copy of the vhd file yesterday, will have to reinstall programs, but at least I won't have to start all over. I deleted the current vhd, and put the backup in the directory. When I try to start the VM I receive this error:



hyper-v error



I have tried to give the VM domain users full rights permissions, but that didn't fix the issue. Thanks for the help in advance










share|improve this question


















  • 1





    When you say you gave them Full permissions, do you mean on the directory or on the .vhd file itself? Also, do you have multiple VMs on that box?

    – Taegost
    Jul 11 '13 at 14:17


















5















Some updates crashed my hyper-v virtual machine. The good news is I created a copy of the vhd file yesterday, will have to reinstall programs, but at least I won't have to start all over. I deleted the current vhd, and put the backup in the directory. When I try to start the VM I receive this error:



hyper-v error



I have tried to give the VM domain users full rights permissions, but that didn't fix the issue. Thanks for the help in advance










share|improve this question


















  • 1





    When you say you gave them Full permissions, do you mean on the directory or on the .vhd file itself? Also, do you have multiple VMs on that box?

    – Taegost
    Jul 11 '13 at 14:17
















5












5








5








Some updates crashed my hyper-v virtual machine. The good news is I created a copy of the vhd file yesterday, will have to reinstall programs, but at least I won't have to start all over. I deleted the current vhd, and put the backup in the directory. When I try to start the VM I receive this error:



hyper-v error



I have tried to give the VM domain users full rights permissions, but that didn't fix the issue. Thanks for the help in advance










share|improve this question














Some updates crashed my hyper-v virtual machine. The good news is I created a copy of the vhd file yesterday, will have to reinstall programs, but at least I won't have to start all over. I deleted the current vhd, and put the backup in the directory. When I try to start the VM I receive this error:



hyper-v error



I have tried to give the VM domain users full rights permissions, but that didn't fix the issue. Thanks for the help in advance







virtualbox virtual-machine virtualization windows-server-2008 hyper-v






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jul 11 '13 at 13:56









natenate

7071921




7071921








  • 1





    When you say you gave them Full permissions, do you mean on the directory or on the .vhd file itself? Also, do you have multiple VMs on that box?

    – Taegost
    Jul 11 '13 at 14:17
















  • 1





    When you say you gave them Full permissions, do you mean on the directory or on the .vhd file itself? Also, do you have multiple VMs on that box?

    – Taegost
    Jul 11 '13 at 14:17










1




1





When you say you gave them Full permissions, do you mean on the directory or on the .vhd file itself? Also, do you have multiple VMs on that box?

– Taegost
Jul 11 '13 at 14:17







When you say you gave them Full permissions, do you mean on the directory or on the .vhd file itself? Also, do you have multiple VMs on that box?

– Taegost
Jul 11 '13 at 14:17












2 Answers
2






active

oldest

votes


















3














What you need to do is delete your Virtual Machine and create a new one. Then choose the existing .vhd during the setup process.






share|improve this answer































    0














    You need to reset the permissions on the VHD files to give the individual VM guid access. Here's some PowerShell I wrote to do this quickly. Just select the VMs you want and click OK.



    If you don't have Out-GridView, you'll need to modify the code slightly.



    foreach ($vm in (Get-VM | ogv -PassThru)) {
    foreach ($vhd in $vm.HardDrives) {
    $vhdpath = Split-Path $vhd.Path -Parent
    icacls "$vhdpath*.*vhd*" /grant "$($vm.VMid.Guid):F"
    }
    }





    share|improve this answer























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "3"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f618460%2freplace-hyper-v-virtual-disk%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      3














      What you need to do is delete your Virtual Machine and create a new one. Then choose the existing .vhd during the setup process.






      share|improve this answer




























        3














        What you need to do is delete your Virtual Machine and create a new one. Then choose the existing .vhd during the setup process.






        share|improve this answer


























          3












          3








          3







          What you need to do is delete your Virtual Machine and create a new one. Then choose the existing .vhd during the setup process.






          share|improve this answer













          What you need to do is delete your Virtual Machine and create a new one. Then choose the existing .vhd during the setup process.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jul 11 '13 at 14:17









          jth41jth41

          4243623




          4243623

























              0














              You need to reset the permissions on the VHD files to give the individual VM guid access. Here's some PowerShell I wrote to do this quickly. Just select the VMs you want and click OK.



              If you don't have Out-GridView, you'll need to modify the code slightly.



              foreach ($vm in (Get-VM | ogv -PassThru)) {
              foreach ($vhd in $vm.HardDrives) {
              $vhdpath = Split-Path $vhd.Path -Parent
              icacls "$vhdpath*.*vhd*" /grant "$($vm.VMid.Guid):F"
              }
              }





              share|improve this answer




























                0














                You need to reset the permissions on the VHD files to give the individual VM guid access. Here's some PowerShell I wrote to do this quickly. Just select the VMs you want and click OK.



                If you don't have Out-GridView, you'll need to modify the code slightly.



                foreach ($vm in (Get-VM | ogv -PassThru)) {
                foreach ($vhd in $vm.HardDrives) {
                $vhdpath = Split-Path $vhd.Path -Parent
                icacls "$vhdpath*.*vhd*" /grant "$($vm.VMid.Guid):F"
                }
                }





                share|improve this answer


























                  0












                  0








                  0







                  You need to reset the permissions on the VHD files to give the individual VM guid access. Here's some PowerShell I wrote to do this quickly. Just select the VMs you want and click OK.



                  If you don't have Out-GridView, you'll need to modify the code slightly.



                  foreach ($vm in (Get-VM | ogv -PassThru)) {
                  foreach ($vhd in $vm.HardDrives) {
                  $vhdpath = Split-Path $vhd.Path -Parent
                  icacls "$vhdpath*.*vhd*" /grant "$($vm.VMid.Guid):F"
                  }
                  }





                  share|improve this answer













                  You need to reset the permissions on the VHD files to give the individual VM guid access. Here's some PowerShell I wrote to do this quickly. Just select the VMs you want and click OK.



                  If you don't have Out-GridView, you'll need to modify the code slightly.



                  foreach ($vm in (Get-VM | ogv -PassThru)) {
                  foreach ($vhd in $vm.HardDrives) {
                  $vhdpath = Split-Path $vhd.Path -Parent
                  icacls "$vhdpath*.*vhd*" /grant "$($vm.VMid.Guid):F"
                  }
                  }






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 10 at 20:51









                  Dan BuhlerDan Buhler

                  17713




                  17713






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Super User!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f618460%2freplace-hyper-v-virtual-disk%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Plaza Victoria

                      In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

                      How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...