Published by


Brink's Avatar
Administrator

Posts: 23,656

Show Printable Version 


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

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.

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 be able 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
Click image for larger version. 

Name:	Virtual_Machines.png 
Views:	118 
Size:	46.5 KB 
ID:	91122





Change Hyper-V Virtual Machines Default Folder in Windows 10 OPTION ONE Change Hyper-V Virtual Machines Default Folder in Windows 10
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)

Click image for larger version. 

Name:	Hyper-V_Settings.png 
Views:	215 
Size:	67.3 KB 
ID:	91119

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)

Click image for larger version. 

Name:	Hyper-V_Virtual_machines.png 
Views:	169 
Size:	117.2 KB 
ID:	91123

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






Change Hyper-V Virtual Machines Default Folder in Windows 10 OPTION TWO Change Hyper-V Virtual Machines Default Folder in Windows 10
To Change Default Hyper-V Virtual Machines Folder using PowerShell

Note   Note
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'

Note   Note
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'


Click image for larger version. 

Name:	Hyper-V_Virtual_Machines_PowerShell-1.png 
Views:	75 
Size:	14.8 KB 
ID:	91120
Click image for larger version. 

Name:	Hyper-V_Virtual_Machines_PowerShell-2.png 
Views:	80 
Size:	19.2 KB 
ID:	91121


3. When finished, you can close PowerShell.



That's it,
Shawn