Change Hyper-V Virtual Machines Default Folder in Windows 10  

    Change Hyper-V Virtual Machines Default Folder in Windows 10

    Change Hyper-V Virtual Machines Default Folder in Windows 10

    How to Change Default Folder to Store Hyper-V Virtual Machines
    Published by Category: Virtualization
    01 Jan 2021
    Designer Media Ltd

    How to Change Default Folder to Store Hyper-V Virtual Machines


    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.

    A virtual machine in Hyper-V consists of a few files that account for its virtual hardware configuration and the virtual storage (VHD and VHDX files). By default:

    • The virtual machine configuration files are stored in "C:\ProgramData\Microsoft\Windows\Hyper-V".
    • The virtual hard drives are stored in "C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks".

    When you create a virtual machine in Hyper-V Manager, you are able to select to use these default locations or specify a folder location on a per virtual machine basis.

    If you like, you could change these global default locations within your hosts to make it easier to use your locations by default instead when creating new virtual machines.

    This tutorial will show you how to specify the default folder to store virtual machine configuration files when importing or creating a new Hyper-V virtual machine in Windows 10.

    You must be signed in as an administrator to change the default folder for Hyper-V virtual machine configuration files.



    Contents

    • Option One: To Change Default Hyper-V Virtual Machines Folder using Hyper-V Manager
    • Option Two: To Change Default Hyper-V Virtual Machines Folder using PowerShell



    EXAMPLE: Hyper-V Virtual Machines folder
    Change Hyper-V Virtual Machines Default Folder in Windows 10-virtual_machines.png





    OPTION ONE

    To Change Default Hyper-V Virtual Machines Folder using Hyper-V Manager


    1 Open Hyper-V Manager.

    2 Select the Hyper-V host (ex: "BRINK-DESKTOP") in the left pane you want to change the default folder to store Hyper-V virtual machines for, and click/tap on Hyper-V Settings in the right Actions pane. (see screenshot below)

    Change Hyper-V Virtual Machines Default Folder in Windows 10-hyper-v_settings.png

    3 Click/tap on Virtual Machines in the left pane, click/tap on the Browse button on the right, navigate to and select the folder you want to use, click/tap on Select Folder, and click/tap on OK. (see screenshots below)

    Change Hyper-V Virtual Machines Default Folder in Windows 10-hyper-v_virtual_machines.png

    4 When finished, you can close Hyper-V Manager if you like.






    OPTION TWO

    To Change Default Hyper-V Virtual Machines Folder using PowerShell


    For more details about the Set-VMHost command used in this option, see: Set-VMHost


    1 Open an elevated PowerShell.

    2 Type the command you want to use below into the elevated PowerShell, and press Enter. (see screenshot below)

    (Current Hyper-V host)
    Set-VMHost -VirtualMachinePath 'Full path of folder'

    OR

    (Specific Hyper-V host)
    Set-VMHost -ComputerName 'Hyper-V host name' -VirtualMachinePath 'Full path of folder'

    Substitute Full path of folder in the commands above with the actual full path of the folder you want to store Hyper-V virtual machine configuration files in.

    Substitute Hyper-V host name in the second command above with the actual host name (ex: "BRINK-DESKTOP') you want to change the default virtual machines folder for.

    For example:

    Set-VMHost -VirtualMachinePath 'D:\Virtual Machines'

    OR

    Set-VMHost -ComputerName 'BRINK-DESKTOP' -VirtualMachinePath 'D:\Virtual Machines'

    Change Hyper-V Virtual Machines Default Folder in Windows 10-hyper-v_virtual_machines_powershell-1.png
    Change Hyper-V Virtual Machines Default Folder in Windows 10-hyper-v_virtual_machines_powershell-2.png


    3 When finished, you can close PowerShell.


    That's it,
    Shawn






  1. Posts : 2
    Windows 10 Pro
       #1

    They've changed things on us in the 1903 Update - when starting, under the Hyper-V settings you can change location of the config and vhd locations
      My Computer


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

    Fast Turtle said:
    They've changed things on us in the 1903 Update - when starting, under the Hyper-V settings you can change location of the config and vhd locations
    Hello Fast Turtle, and welcome to Ten Forums.

    I still see the same as Option One in the tutorial for this in 1903. Is this what you meant?
      My Computers


  3. Posts : 2
    Windows 10 Pro
       #3

    Under the Action menu - Select the Hyper-V Settings and you can change the default locations where the local machine server places both the VHD and Config files for all new VM's. Version I'm using is 10.0.18362.1 so they may have added things
      My Computer


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

    That looks to be the same as Option One in the tutorial here and below.

    Change Hyper-V Virtual Hard Disks Folder in Windows 10
      My Computers


  5. Posts : 316
    Pro 20H2
       #5

    Change Hyper-V Virtual Machines Default Folder in Windows 10-dirstructure.jpg
    ......................................................................................(I hope that you have seen that redundancy.)

    Am I overlooking some advantage of the default scheme?
      My Computer


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

    Hello @thename,

    I certainly prefer to have my VM's stored on a separate hard drive than the drive Windows is on.

    I like to keep everything for one VM in its own separate folder to make it easier to keep up with.
      My Computers


 

Tutorial Categories

Change Hyper-V Virtual Machines Default Folder in Windows 10 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 10:42.
Find Us




Windows 10 Forums