Default Hyper-V Storage Paths Explained

In my travels, I have noticed that the default storage paths used by Hyper-V can cause some confusion. To be honest, I don’t like how Hyper-V stores virtual machines by default; System Center Virtual Machine Manager (SCVMM) handles the folder structure in a much more attractive fashion. In this post, I will explain where Hyper-V stores virtual machine files by default, and how you can manipulate those settings to get a better configuration.

Hyper-V Storage Path Settings

There are two default storage paths defined in each host’s Hyper-V settings. You can find and edit these paths by opening Hyper-V Manager, connecting to and selecting your host, and choosing Hyper-V Settings from Actions. Here you will find two settings.

Virtual Hard Disks is the default storage location for any new virtual hard disk that you create. The default location is C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks. Checkpoints (AVHD or AVHDX files) will also be stored in this location.

Virtual Machines is where the XML file (named after the GUID of the virtual machine) for a virtual machine configuration will be stored. The default location for those XML files is C:\ProgramData\Microsoft\Windows\Hyper-V. BIN files (to reserve space for virtual machines that will enter a saved state when a host shuts down) and VSV files (a saved state) are stored in a subfolder that is named after the GUID of the virtual machine.

Sponsored Content

What is “Inside Microsoft Teams”?

“Inside Microsoft Teams” is a webcast series, now in Season 4 for IT pros hosted by Microsoft Product Manager, Stephen Rose. Stephen & his guests comprised of customers, partners, and real-world experts share best practices of planning, deploying, adopting, managing, and securing Teams. You can watch any episode at your convenience, find resources, blogs, reviews of accessories certified for Teams, bonus clips, and information regarding upcoming live broadcasts. Our next episode, “Polaris Inc., and Microsoft Teams- Reinventing how we work and play” will be airing on Oct. 28th from 10-11am PST.

When you think about it, both of those locations are pretty dumb. On a nonclustered host, you should never store virtual machines on the system drive. And who thinks it’s a good idea to bury virtual machine and virtual hard disks in program and profile folders?

The default Hyper-V storage paths
Virtual hard disks and virtual machines storage paths

Microsoft cannot predict what kind of storage you will supply and where it will be located so it is up to us to supply better paths. In the cause of a non-clustered host with internal storage I will have a second volume (RAID 10 array) labelled as the D: drive. I will create a folder there called Virtual Machines. I then edit the Hyper-V settings of the host, and reconfigure both the Virtual Hard Disks and the Virtual Machines folders to point to D:\Virtual Machines.

It’s a bit trickier when you are dealing with more complex installations. I could say that you should use SCVMM in those scenarios and it will do a good job and using the correct storage for you. But not everyone can afford System Center. So in that case, maybe you should reconfigure the default paths to the location of your preferred CSV or SMB 3.0 volume.

Virtual Machine File Locations

Once in a while I will visit a site and find that all of their virtual machine XML and virtual hard disk files are in a single folder and a rather untidy flat file structure. It takes some time to figure out what XML file is associate with what virtual machine, and the file is named after the GUID of the virtual machine. I would not classify myself as a clean freak, but I cannot stand this layout. And it really annoys me that Hyper-V steers you into this direction.

The below screenshot is taken from the New Virtual Machine Wizard in Hyper-V Manager. An administrator will enter the name of the new virtual machine. If they do not check the Store The Virtual Machine in a Different Location box, then they get a rather untidy collection of files.

New Virtual Machine Wizard
The New Virtual Machine Wizard

The next screenshot shows you what the Virtual Machines folder would look like. Each virtual hard disk was created using the wizard, so they are named after the attached virtual machine by default.

The default method of storing Hyper-V virtual hard disks
A flat, messy collection of virtual machine storage files

The contents of the Virtual Machine subfolder is a mess, as is the contents of the Snapshots subfolder. You will need to know the GUIDs of each virtual machine to know what file is owned by what virtual machine.

The default method of storing Hyper-V VM XML files

You can prevent this mess if you check the Store The Virtual Machine in a Different Location box in the New Virtual Machine Wizard. All you have to do is check that box, and the wizard will create a subfolder, named after the virtual machine, to store all of that virtual machines files. If you create 10 virtual machines, then you get 10 subfolders in the Virtual Machine path that is configured in Hyper-V Settings.

correct way to store Hyper-V VM files
Storing virtual machines in tidy subfolders

The virtual machine folder will contain two subfolders by default. Virtual Machines is where the XML file is stored. Virtual Hard Disks is where the virtual machine’s VHD or VHDX files are kept. And Snapshots is where the checkpoint (formerly known in Hyper-V Manager as a snapshot) is kept. The BIN and VSV files continue to be kept in a subfolder of Virtual Machines named after the GUID of the virtual machine.

So my advice is simple:

  1. Reconfigure the default storage paths in Hyper-V Manager.
  2. Always check the box to Store The Virtual Machine in a Different Location in the New Virtual Machine Wizard.

Related Topics:


Don't have a login but want to join the conversation? Sign up for a Petri Account

Comments (3)

3 responses to “Default Hyper-V Storage Paths Explained”

  1. Great insights. I briefly mentioned this problem in my own blog a while big, albeit no where near in as much detail. Whats worse is that SOMETIMES you get one behavior, and other times you don’t. Your advice on storing them in separate places is the simplest answer I’ve seen.

  2. I agree with this advice and follow it for managing VMs on Hyper-V hosts with shared storage as well as my personal Win 8.1 computer. I would perhaps caveat this advice for hosts without shared storage by advising that Live Migration won’t follow your naming convention by default. Using Live Migration (and you really should), if you want to move a VM sitting under a particular naming convention, i.e. not the default save locations for disk and machine, then you’ll have to recreate that naming convention on the destination host and select it during the Live Migration wizard. It’s a minor inconvenience but hopefully one that nudges you towards looking at shared storage and SMB3. If you haven’t already done so, check out Aiden’s many articles on a Scale Out File Server.

Leave a Reply

Aidan Finn, Microsoft Most Valuable Professional (MVP), has been working in IT since 1996. He has worked as a consultant and administrator for the likes of Innofactor Norway, Amdahl DMR, Fujitsu, Barclays and Hypo Real Estate Bank International where he dealt with large and complex IT infrastructures and MicroWarehouse Ltd. where he worked with Microsoft partners in the small/medium business space.
External Sharing and Guest User Access in Microsoft 365 and Teams

This eBook will dive into policy considerations you need to make when creating and managing guest user access to your Teams network, as well as the different layers of guest access and the common challenges that accompany a more complicated Microsoft 365 infrastructure.

You will learn:

  • Who should be allowed to be invited as a guest?
  • What type of guests should be able to access files in SharePoint and OneDrive?
  • How should guests be offboarded?
  • How should you determine who has access to sensitive information in your environment?

Sponsored by: