How to change the default directory for hosting Hyper-V virtual machines in Windows 10
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).
- Virtual machine configuration files are stored in "C: ProgramDataMicrosoftWindowsHyper-V".
- 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
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).
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).
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 '
![]()
![]()
3. Once done, you can close PowerShell if you want.
See more:
- How to create and use Hyper-V checkpoints in Windows 10
- How to import Hyper-V virtual machines in Windows 10
- How to export Hyper-V virtual machines in Windows 10
- Setting up Ubuntu virtual machine with Hyper-V Quick Create on Windows 10
You should read it
- Monitor Hyper-V with the command line (Part 3): Check virtual machine status
- How to export Hyper-V virtual machines in Windows 10
- How to import Hyper-V virtual machines in Windows 10
- Instructions for fixing errors do not install VMware Tools
- Steps to install windows 11 on virtual machine, how to install windows 11 on VMware
- Collect the Process ID information or GUID of Hyper-V Virtual Machine
- Stealing virtual machines and virtual machine data
- Use the Virtual Machine Manager to quickly deploy Hyper-V
May be interested
- Monitor Hyper-V with the command line (Part 1): Install the monitoring libraryone of the obvious shortcomings of hyper-v is the ability to monitor virtual machines from windows powershell. although microsoft intends to provide this capability on windows server 8, users can fully monitor virtual machines from the command line interface at this time. the article will guide you to do this
- How to install Hyper-V in Windows Server 2012virtualization is one of the most important technological features. microsoft has invested in developing this feature and called it hyper-v.
- How to create a virtual machine repository for Hyper-V Quick Createquick create is a feature in hyper-v that allows users to set up new virtual machines with just a few mouse clicks.
- Monitor Hyper-V with the command line (Part 4)among the hardware resources that are usually assigned to virtual machines, perhaps the memory is most fixed. this tutorial will show you how to manage virtual machine memory through windows powershell.
- Monitor Hyper-V with the command line (Part 2): Basic monitoring commandsin this article, we will learn how to access the virtual machine list and see general information about virtual machines with simple powershell statements. we will also look at stop commands and start virtual machines from the command window.
- How to Change Default Folder in Windows Terminalby default, windows terminal will use your current user directory as the default directory when you open it. however, you can completely change this folder to any other folder on your windows pc.
- How to create a virtual machine in Windows Server 2012in this article, we will look at how to create a virtual machine. first, you need to open the hyper-v manager and then follow the steps below.
- How to fix the problem of not being able to start Windows 11 after enabling Hyper-VORhyper-v is microsoft's out-of-the-box solution for running virtual machines. while it may not have as many features as other hypervisors, it still gets the job done.
- Monitor Hyper-V with the command line (Part 3): Check virtual machine statusthe previous article showed you how to turn on and off the virtual machine with the command line. this article will introduce two methods of validating that virtual machines are running and responding.
- Create private cloud with Hyper-V (Part 4)the previous article showed users how to create executable image files and assign image files to windows deployment services. although the image file that we created can start immediately, it is not ready for use yet. because we are creating a private cloud with the ultimate goal of being able to create machines