Hyper-V – Black screen with flashing cursor after capturing a servers hard disks

So you’ve just captured that last server, you’ve done exactly the same as you’ve done on pervious occasions but this time when you fire up your freshly captured VM you get greeted with a black screen and a lone flashing cursor.  You sit and watch this cursor in the hope that it might suddenly remember what it was supposed to be doing and boot the VM, alas it doesn’t and you’re then search the internet for an answer….which is probably how you ended up here.

Ok. I discovered this while trying to grab a Windows 2012R2 Server VM from a Unraid system, which uses KVM hypervisor.  The disks are held in IMG files which should be reasonably easy to covert to VHDX using QEMU-IMG from Cloudbase Solutions

I created a generation 2 (this be is important later) and attached the newly covered disks.  After firing up the VM I was greeted with this black screen and a single flashing cursor.  After a bit of trawling the internet and failing each time I did some more digging.

The crux of the issue here is that the VM was created with a virtual UEFI rather than good old BIOS.  This meant when the IMG file was converted the system partition got messed about with.  The exact same thing happened when I used Disk2VHD so I am confident these instructions will help people that are capturing physical servers running UEFI.

  • First off you need to make sure your using a generation 2 VM, as gen 1 doesn’t support UEFI.
  • Next you need to connect a ISO of Windows Server, the same version that is used on the VM.  If you don’t have one you can most likely download one from the MSDN Eval center
  • Once you have added the ISO boot the VM onto this ISO, this will start the OOB installation process
  • On the language screen you can just click “Next”
  • Now click on “Repair your computer”
  • Click “Troubleshoot” -> “Command Prompt”
  • Type: diskpart
    • Type list disk and make a not of the number that is your OS disk
    • Type select disk 0 change the 0 to the number that matches your OS disk
    • Type: list volume and you’ll see that one of the volumes has a file system type of “RAW” and it should be 99Mb as this is the system partition and RAW means that it’s blank…not good.
    • Select this volume by typing: select volume 2 again change the 2 to the number that relates to your volume
    • Type: assign letter=R
    • Type: format FS=FAT32 Label=”BOOT”
    • Now exit Diskpart by typing: exit
  • Go to R:
  • Type the following:
    • md r:\efi
    • md r:\efi\Microsoft
    • md r:\efi\Microsoft\Boot
  • Now type:
    • bootrec /fixboot
    • bcdboot c:\windows /l en-us /s r: /f ALL
  • Now you can exit the command prompt and restart the VM

Hopefully now the VM will boot up and you can have yourself a beer in celebration of another good job well done!

16 thoughts on “Hyper-V – Black screen with flashing cursor after capturing a servers hard disks

  1. Vue Lee

    Thank you for sharing your solution. I had this same issue with the black screen and blinking cursor for a P2V of a Server 2016. Following your instructions resolved the same issue in my case. Thanks!!

  2. A. Ce

    This is a huge timesaver.

    I used a Server 2019 iso to recover the older OS structure and it worked as well.

    Thank you!

  3. Himanshu

    Thanks a lot Man. This article saved me a lot of time today. I owe you a Beer as well.

  4. Pachin

    Realy thanks bro!!! It really works, thanks again. For me the command bcdboot c:\windows /l en-us /s r: /f ALL showed me error so just use like this bcdboot c:\windows /l en-us /s r: and works.

  5. David MacKenzie

    bcdboot C:\windows /s R: /f UEFI (This replaces the above commands and works in Win 10 1709)

  6. Fábio

    Hi there,

    in the command “mr r:\efi\Microsoft\Boot” is it really “mr” or “md” ?


    1. Rob Post author

      You didn’t say at which point this happening, but it sounds like the BOOT drive isn’t created properly.

  7. James

    Hi Rob, could you please elaborate on step 2, where you say “you need to connect a ISO of Windows Server, the same version that is used on the VM.”

    Lets assume I’ve downloaded an ISO of the intended VM’s OS, and created the Gen2 VM in Hyper-V, and attached the .vhdx file that I created with Disk2VHD, how do I “connect” the ISO file?

    1. Rob Post author


      Assuming you have the ISO of the OS copy it to your host then from Hyper-V manager open the settings of the VM, go to the DVD drive and select the ISO so it’s mounted. Now open the VM console and start the VM when you see the prompt to boot from DVD press the space bar.

  8. Bill M

    Bravo! 👏👏👏 Thanks so much for this article. It helped me to fix a migrated physical to VHD VM that I have been trying to resolve the bootup issue for a good while and none of the other knowledge base articles worked.


Leave a Reply

Your email address will not be published.