How to Change Default Folder to Store Hyper-V Virtual Machines
InformationHyper-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.
- 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
OPTION ONETo 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)
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)
4. When finished, you can close Hyper-V Manager if you like.
OPTION TWOTo Change Default Hyper-V Virtual Machines Folder using PowerShell
NoteFor 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'
(Specific Hyper-V host)
Set-VMHost -ComputerName 'Hyper-V host name' -VirtualMachinePath 'Full path of folder'
NoteSubstitute 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.
Set-VMHost -VirtualMachinePath 'D:\Virtual Machines'
Set-VMHost -ComputerName 'BRINK-DESKTOP' -VirtualMachinePath 'D:\Virtual Machines'
3. When finished, you can close PowerShell.
- How to Setup and Use Hyper-V in Windows 10 for OS Virtualization
- How to Export Hyper-V Virtual Machines in Windows 10
- How to Import Hyper-V Virtual Machines in Windows 10
- How to Change Default Folder to Store Hyper-V Virtual Hard Disks