Windows 10: Add or Remove Physical Hard Disk for Hyper-V Virtual Machine  

Page 1 of 2 12 LastLast
    Add or Remove Physical Hard Disk for Hyper-V Virtual Machine

    Add or Remove Physical Hard Disk for Hyper-V Virtual Machine

    How to Add or Remove a Physical Hard Disk for Hyper-V Virtual Machine
    Published by Category: Virtualization
    13 Mar 2017
    Designer Media Ltd

    Published by


    Brink's Avatar
    Administrator

    Posts: 22,913

    Show Printable Version 


    How to Add or Remove a Physical Hard Disk for Hyper-V Virtual Machine

    information   Information
    Hyper-V enables running virtualized computer systems on top of a physical host. These virtualized systems (aka: guests) can be used and managed just as if they were physical computer systems, however they exist in a virtualized and isolated environment.

    Your Hyper-V virtual machines can also be connected to physical hard disks from the host computer—not just to virtual hard disks. (This is sometimes referred to as having a “pass-through” disk connected to a virtual machine.)

    This tutorial will show you how to add and remove physical hard disks to access from a Hyper-V virtual machine in Windows 8 and Windows 10.

    Note   Note
    Hyper-V is only available in the Window 8 Pro, Windows 8 Enterprise, Windows 10 Pro, Windows 10 Enterprise, and Windows 10 Education editions.

    You can add hard drives (ex: HDD and SSD) and removable USB hard drives, but you will not be able to add removable media (ex: USB flash drive) to a Hyper-V virtual machine.

    While you have a physical hard disk added to a Hyper-V virtual machine, you will not be able to create a checkpoint for the virtual machine.


    CONTENTS:
    • Option One: To Add Physical Hard Disk to Hyper-V Virtual Machine
    • Option Two: To Remove Physical Hard Disk from Hyper-V Virtual Machine





    Add or Remove Physical Hard Disk for Hyper-V Virtual Machine OPTION ONE Add or Remove Physical Hard Disk for Hyper-V Virtual Machine
    To Add Physical Hard Disk to Hyper-V Virtual Machine

    1. Open Disk Management (diskmgmt.msc).

    2. Right click on the online disk (ex: Disk 3 - "Internal HDD") you want to add to the VM, and click/tap on Offline. (see screenshot below)
    Note   Note
    It's required that the physical hard disk be in an offline state on the host computer to be able to add to the VM.


    Click image for larger version. 

Name:	Add_drive_to_Hyper-V_virtual_machine-1.png 
Views:	171 
Size:	71.5 KB 
ID:	90147

    3. Once the disk is offline, you can close Disk Management if you like.

    4. Open the settings of the Hyper-V virtual machine you want to add the disk to. (see screenshots below)
    Note   Note
    It doesn't matter if you currently have the virtual machine off or running.


    Name:  Hyper-V_VM_settings-1.png
Views: 3373
Size:  21.4 KB
    Click image for larger version. 

Name:	Hyper-V_VM_settings-2.jpg 
Views:	446 
Size:	148.3 KB 
ID:	90156

    5. In the VM's settings, click/tap on SCSI Controller in the left navigation pane, select Hard Drive on the right side, and click/tap on the Add button. (see screenshot below)

    Name:  Add_drive_to_Hyper-V_virtual_machine-3.png
Views: 2190
Size:  60.5 KB

    6. Select (dot) Physical hard disk on the right side, select the disk you want to add in the drop down menu, and click/tap on OK. (see screenshot below)

    Name:  Add_drive_to_Hyper-V_virtual_machine-4.png
Views: 2108
Size:  68.5 KB

    7. The disk will now be available to access in the virtual machine. (see screenshot below)

    Click image for larger version. 

Name:	Add_drive_to_Hyper-V_virtual_machine-5.jpg 
Views:	147 
Size:	123.7 KB 
ID:	90150






    Add or Remove Physical Hard Disk for Hyper-V Virtual Machine OPTION TWO Add or Remove Physical Hard Disk for Hyper-V Virtual Machine
    To Remove Physical Hard Disk from Hyper-V Virtual Machine

    1. Open the settings of the Hyper-V virtual machine you want to remove the disk from. (see screenshots below)
    Note   Note
    It doesn't matter if you currently have the virtual machine off or running.


    Name:  Hyper-V_VM_settings-1.png
Views: 3373
Size:  21.4 KB
    Click image for larger version. 

Name:	Hyper-V_VM_settings-2.jpg 
Views:	446 
Size:	148.3 KB 
ID:	90156

    2. In the VM's settings, select the disk you want to remove under SCSI Controller in the left navigation pane, and click/tap on the Remove button on the right side. (see screenshot below)

    Name:  Remove_drive_from_Hyper-V_virtual_machine-2.png
Views: 2132
Size:  66.9 KB

    3. click/tap on OK. (see screenshot below)

    Name:  Remove_drive_from_Hyper-V_virtual_machine-3.png
Views: 2094
Size:  61.2 KB

    4. The disk will now be removed from the virtual machine. (see screenshot below)

    Click image for larger version. 

Name:	Remove_drive_from_Hyper-V_virtual_machine-5.jpg 
Views:	99 
Size:	118.7 KB 
ID:	90154

    5. Open Disk Management (diskmgmt.msc).

    6. Right click on the offline disk (ex: Disk 3 - "Internal HDD") you removed from the VM, and click/tap on Online. (see screenshot below)
    Note   Note
    You will need to set the disk back to an online state to be able to access it from your host computer again.


    Click image for larger version. 

Name:	Remove_drive_from_Hyper-V_virtual_machine-4.png 
Views:	96 
Size:	66.2 KB 
ID:	90163

    7. Once the disk is back online, you can close Disk Management if you like.


    That's it,
    Shawn



  1. Posts : 12,144
    Windows 10 Pro
       14 Jul 2016 #1

    @Brink, regarding the note in Option One Step 4, this is the notification you get when trying to add physical drive when a generation 1 vm is running:
    Name:  2016_07_14_21_02_551.png
Views: 3281
Size:  19.7 KB

    VM should not be running when doing it.
      My ComputerSystem Spec


  2. Posts : 22,913
    64-bit Windows 10 Pro build 16257
    Thread Starter
       14 Jul 2016 #2

    Odd. The VM I used in the tutorial is a Gen 1 installation, and I didn't have any issue adding a physical hard disk while it was running.

    EDIT: Just to clarify, it doesn't matter if it's a Gen 1 or Gen 2 VM.

    Click image for larger version. 

Name:	gen1.png 
Views:	78 
Size:	18.9 KB 
ID:	90167
    Last edited by Brink; 14 Jul 2016 at 16:47.
      My ComputersSystem Spec


  3. Posts : 12,144
    Windows 10 Pro
       14 Jul 2016 #3

    Really odd. I have to always add physical disks when vm is off. Screenshot from build 14388.
      My ComputerSystem Spec


  4. Posts : 22,913
    64-bit Windows 10 Pro build 16257
    Thread Starter
       14 Jul 2016 #4

    Let's see if others get the same error when running a Gen 1. It'll be interesting.
      My ComputersSystem Spec


  5. Posts : 12,144
    Windows 10 Pro
       14 Jul 2016 #5

    OK, case cleared

    I have never tried to add any other disks but one external disk I have, which I move from PC to PC to move data (mostly installers and ISO files) between virtual machines on different hosts. It's at least 6 or 7 years old WD disk and acts occasionally a bit strange, only connecting after several USB disconnect / reconnect cable tries. I can connect it on a running Gen. 2 vm but not on a running Gen. 1 vm.

    Now looking at my own screenshot about error adding synthetic disk I was thinking a real HDD is not synthetic! Connected another USB disk to running Gen. 1 vm without issues.

    You are right, I am wrong, it's that simple. The culprit in my case is not the running vm but a failing disk.

    Sorry
      My ComputerSystem Spec


  6. Posts : 22,913
    64-bit Windows 10 Pro build 16257
    Thread Starter
       14 Jul 2016 #6

    Glad you found the culprit. I was wondering why it wouldn't work for you.
      My ComputersSystem Spec


  7. Posts : 12,144
    Windows 10 Pro
       14 Jul 2016 #7

    Thanks for a good tut
      My ComputerSystem Spec


  8. Posts : 22,913
    64-bit Windows 10 Pro build 16257
    Thread Starter
       14 Jul 2016 #8

      My ComputersSystem Spec

  9.    30 Jul 2016 #9

    Thanks guys for a great tutorial. Pretty sure I know answer to this by my testing but just in case...

    VMWARE automatically takes a disk offline when it is added to a vm, and automatically puts it back online when vm is shutdown or suspended.

    Is it possible to do the same with Hyper-V as it is a but of a nuisance having to keep using disk management. Perhaps a powershell command where I could set up a shortcut if automatic is not possible?

    Edit - have setup a couple of simple one-click batch files using diskpart. Not as slick as vmware but a lot less hassle than using disk management..

    I know this is basic stuff for you guys but for benefit of other users:-

    file 1 - diskoffline.txt (on d:\ root drive in my case)

    select disk 1
    offline disk

    file 2 - diskoffline.cmd

    diskpart /s d:\diskoffline.txt

    Then create a shortcut for diskoffline.cmd file on desktop.

    Do same to put online as well.

    file 3 - diskonline.txt (on d:\ root drive in my case)

    select disk 1
    online disk

    file 4 - diskonline.cmd

    diskpart /s d:\diskonline.txt

    Then create a shortcut for diskonline.cmd file on desktop.

    When you get a popup notification asking what you to tap and select want to do with the drive, tap it and select no action. Then you do not see notification again.

    It does not require admin permission to do this, so you can just click the shortcuts.

    I am sure there are smarter ways of doing this but this is easy and works.
    Last edited by cereberus; 30 Jul 2016 at 06:13.
      My ComputerSystem Spec


 
Page 1 of 2 12 LastLast

Related Threads
How to Create Shortcut of Hyper-V Virtual Machine in Windows 8 and 10 There's nothing wrong in running the Hyper-V Manager and launch your virtual machines from there. However, creating a shortcut for each vm you have you can start them fast...
UPDATE: Problem solved. See post #14's "long story" for steps that led to the findings above as the same steps can aid in hunting down this type of issue if neither of the above applies. Hello, I recently did an in place upgrade to Windows...
How to Remove Floppy Disk Drive in Windows Hyper-V Virtual Machine Hyper-V enables running virtualized computer systems on top of a physical host. These virtualized systems (aka: guests) can be used and managed just as if they were physical...
Hi There I am using windows 10 Pro, and had a virtual machine installed using Hyper-V with two virtual HDD in that VM. Recently I had some problem with my Windows 10 OS and had to reset my windows with keeping all the files and settings, and...
Hello everybody, recently I've installed Windows 8,1 Pro version on my laptop and today I'm trying to install Microsoft Office 2007 Enterprise. I've have it on CD but when I'm trying to run it there's a message that says : "Virtual hard disk...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 04:29.
Find Us