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
    19 Apr 2020
    Designer Media Ltd

    How to Add or Remove a Physical Hard Disk for 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 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





    OPTION ONE

    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)

    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.

    Add or Remove Physical Hard Disk for Hyper-V Virtual Machine-add_drive_to_hyper-v_virtual_machine-1.png

    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)

    It doesn't matter if you currently have the virtual machine off or running.

    Add or Remove Physical Hard Disk for Hyper-V Virtual Machine-hyper-v_vm_settings-1.png
    Add or Remove Physical Hard Disk for Hyper-V Virtual Machine-hyper-v_vm_settings-2.jpg

    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)

    Add or Remove Physical Hard Disk for Hyper-V Virtual Machine-add_drive_to_hyper-v_virtual_machine-3.png

    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)

    Add or Remove Physical Hard Disk for Hyper-V Virtual Machine-add_drive_to_hyper-v_virtual_machine-4.png

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

    Add or Remove Physical Hard Disk for Hyper-V Virtual Machine-add_drive_to_hyper-v_virtual_machine-5.jpg






    OPTION TWO

    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)

    It doesn't matter if you currently have the virtual machine off or running.

    Add or Remove Physical Hard Disk for Hyper-V Virtual Machine-hyper-v_vm_settings-1.png
    Add or Remove Physical Hard Disk for Hyper-V Virtual Machine-hyper-v_vm_settings-2.jpg

    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)

    Add or Remove Physical Hard Disk for Hyper-V Virtual Machine-remove_drive_from_hyper-v_virtual_machine-2.png

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

    Add or Remove Physical Hard Disk for Hyper-V Virtual Machine-remove_drive_from_hyper-v_virtual_machine-3.png

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

    Add or Remove Physical Hard Disk for Hyper-V Virtual Machine-remove_drive_from_hyper-v_virtual_machine-5.jpg

    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)

    You will need to set the disk back to an online state to be able to access it from your host computer again.

    Add or Remove Physical Hard Disk for Hyper-V Virtual Machine-remove_drive_from_hyper-v_virtual_machine-4.png

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


    That's it,
    Shawn






  1. Posts : 17,661
    Windows 10 Pro
       #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:
    Add or Remove Physical Hard Disk for Hyper-V Virtual Machine-2016_07_14_21_02_551.png

    VM should not be running when doing it.
      My Computer


  2. Posts : 68,652
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #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.

    Add or Remove Physical Hard Disk for Hyper-V Virtual Machine-gen1.png
    Last edited by Brink; 14 Jul 2016 at 16:47.
      My Computers


  3. Posts : 17,661
    Windows 10 Pro
       #3

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


  4. Posts : 68,652
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #4

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


  5. Posts : 17,661
    Windows 10 Pro
       #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 Computer


  6. Posts : 68,652
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #6

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


  7. Posts : 17,661
    Windows 10 Pro
       #7

    Thanks for a good tut :)
      My Computer


  8. Posts : 68,652
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #8

      My Computers


  9. Posts : 15,441
    Windows10
       #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 Computer


 

Tutorial Categories

Add or Remove Physical Hard Disk for Hyper-V Virtual Machine Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  Related Discussions
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 08:01.
Find Us




Windows 10 Forums