How to change the default directory for hosting Hyper-V virtual machines in Windows 10

As we know, Hyper-V allows running virtual computer systems on a physical server. These virtualization systems (also known as guest clients) can be used and managed similarly as physical computer systems.

General information

As we know, Hyper-V allows running virtual computer systems on a physical server.These virtualization systems (also known as guest clients) can be used and managed similarly as physical computer systems, but in essence, they still exist in the environment. virtualization and isolation.

A virtual machine in Hyper-V includes several files that store its virtual hardware configuration and virtual storage (VHD and VHDX files).

  1. Virtual machine configuration files are stored in "C: ProgramDataMicrosoftWindowsHyper-V".
  2. Virtual hard drives are stored in "C: UsersPublic DocumentsHyper-VVirtual Hard Disk".

When you create a virtual machine in Hyper-V Manager, you can choose to use these default locations or just reposition the folder location on each virtual machine.

If you like, you can change these default locations within your server to easily use the location you set by default when creating a new virtual machine.

This article will show you how to set up the default directory to store virtual machine configuration files when importing or creating a new Hyper-V virtual machine in Windows 10.

Note that you must log on to the system as an administrator to change the default directory for Hyper-V virtual machine configuration files.

Example: Hyper-V virtual machine directory

Picture 1 of How to change the default directory for hosting Hyper-V virtual machines in Windows 10

Change the default Hyper-V virtual machine directory using the Hyper-V Manager

1. Open Hyper-V Manager

2. Select the Hyper-V server to which you want to change the default directory to store Hyper-V virtual machines there (for example: "BRINK-DESKTOP") in the left pane, and click the Hyper-V entry. Settings in the action pane on the right (see screenshot below).

Picture 2 of How to change the default directory for hosting Hyper-V virtual machines in Windows 10

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

Picture 3 of How to change the default directory for hosting Hyper-V virtual machines in Windows 10

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

Change the default Hyper-V virtual machine directory using PowerShell

1. Open PowerShell

2. Type the following command in PowerShell and press Enter (see screenshot below).

(Existing Hyper-V server)

 Set-VMHost - VirtualMachinePath ' full path of directory ' 

(Specific Hyper-V server)

 Set-VMHost -ComputerName ' Hyper-V server name -VirtualMachinePath' full path of directory ' 

Note

Replace the ' full path of the directory ' in the above commands with the actual full path of the directory in which you want to store Hyper-V virtual machine configuration files in it.

Replace the ' Hyper-V server name ' in the second command above with the actual host name you want to change the default virtual machine directory (eg "BRINK-DESKTOP").

For example:

 Set-VMHost - VirtualMachinePath ' D: Virtual Machines ' 

Or:

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

Picture 4 of How to change the default directory for hosting Hyper-V virtual machines in Windows 10

Picture 5 of How to change the default directory for hosting Hyper-V virtual machines in Windows 10

3. Once done, you can close PowerShell if you want.

See more:

  1. How to create and use Hyper-V checkpoints in Windows 10
  2. How to import Hyper-V virtual machines in Windows 10
  3. How to export Hyper-V virtual machines in Windows 10
  4. Setting up Ubuntu virtual machine with Hyper-V Quick Create on Windows 10
Update 26 May 2019
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile