This article explains how to remove a virtual Dev Drive (DevDrive.vhdx), after it’s stuck on your machine.
Dev Drives are separate drives in Windows, that are optimized for Developer workloads. Mostly installing npm packages, that is.
I’ve posted about the performance improvements before: Dev Drive performance increase in real life scenarios
Background
I’ve been using a Dev Drive for my npm -heavy workloads for about half a year now. It’s a big enough improvement to the slowest parts of each build – restoring npm packages – that it’s worth setting up.
Problem
However, in setting it up, I made the mistake of accepting the defaults – and back in the day, that meant generating a vhd instead of a dedicated partition.
The virtual disk files you (accidentally) create will be located under C:\Users\[you]\DevDrives, and no matter whether you’re using them or not, they’ll take up some space and be undeletable.

And despite not being in use, not being formatted, and not having a single file on it – it takes up some 860 Megabytes of space.
How? Beats me. But I want to get rid of it!
Found 99 solutions but the fix ain’t one
(jump straight to “Solution” if you don’t want to read me ranting)
Just like Dev Home was pretty useless in creating the Dev Drive, it’ll be absolutely useless in removing it. There is no actual “Dev Drive” configuration in Dev Home – it’ll take you to Control Panel, which in turn doesn’t make it obvious what to do.

Furthermore, it’s a bit unfortunate, but unlike what Copilot – and the internet, should you try to ask it – will tell you, “Disk Management” is also unable to help you at all.
See, you can see the virtual disk there – but you can’t actually modify it.
You COULD create a new volume and use it – that way, you’d be using a virtual disk instead of a “real” partition on a real disk. But I already have a real partition, so I just want to get rid of this virtual one.

I had obviously located the file before – a 860 Megabyte file that isn’t in use but can’t be removed sticks out like a sore thumb, when it’s forcibly injected into your personal documents – but removing it isn’t as easy as hitting “Delete” when the file is selected.

Nothing one can do about it.
I tried using File Locksmith – a fantastic Windows PowerToy for finding out which process is locking a file you want to use – but it could find no process using the file.

I haven’t used Windows Dev Home for a while (because why would I..), but I figured it has to be the one holding on to the file.
However, the wretched app doesn’t even start anymore. I just have to assume it’s incompatible with Windows 11 24H2 or something along those lines.
Which is pretty fair – a lot of stuff doesn’t work very well with 24H2. But this is a first-party app, that you’d hope someone actually did test on 24H2..
Anyway. Since it doesn’t even start, I guess it’s safe to remove it.
… but how?

Right – there’s no “Uninstall” option.
So we’ll remove it with PowerShell:
Get-AppxPackage -AllUsers -PackageTypeFilter Bundle -Name "*Windows.DevHome*" | Remove-AppxPackage -AllUsers
And this DOES remove the Dev Home.
However – removing the app doesn’t unlock the file.
I figured I’ll need to bring out the big guns.
Sysinternals Handle viewer is a great tool by Mark Russinovich – is a powerful utility that allows you to view and manage open file handles on a Windows system. I suspect it might be using the same implementation under the hood with the File Locksmith – but I gave it a go anyway.
.\handle64.exe C:\Users\anko\DevDrives\DevDrive.vhdx

Nothing.
So nothing is using the file, but it cannot be removed because it’s in use?
Gotcha, Windows.
Solution
No, the solution was not to turn it off and on again. Although I did try that, because it usually helps with pretty much any issue on Windows.
The actual solution was to unmount the damn drive that, while not in use or even formatted, was in reality still mounted to an empty, unused virtual drive.
Bah. It should’ve been obvious after opening the Disk Management, because the empty, unformatted virtual drive was there.
But now we’ll unmount and nuke it.
Unmount the drive using Control Panel
Navigate to System > Storage > Disks & volumes
Select your disk (it’ll be called “Msft Virtual Disk” – but you might have multiple ones so be sure to select the right one) and click “Properties”.

It should be unallocated if it’s not in use, so it could look something like this:

Navigating to the “Properties” of the virtual drive, click “Detach VHD”. As far as I know, this is the only way to see the file name of this drive – so double-check it before hitting “OK”!

Pay no mind to the changed file name – I recreated the drive to get these screenshots…

And after hitting “Ok”, you can finally remove the file that takes up space without doing anything.

And BOOM!
860 Megabytes of nothing is removed and available for your npm packages.
Yay!
- How to remove DevDrive.vhdx? - May 20, 2025
- How to disable Narrator.exe from narrating your life? - May 13, 2025
- Frontmatter Fields Not Populating When Setting Up Your BlazorStatic Website? Easy Fix! - May 6, 2025