Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

WSL 2 stores each Linux distribution in a Windows ext4.vhdx virtual hard disk. That file grows as the distro uses storage, but its physical size in Windows is different from the capacity and free space Linux reports. A 59.4 GB VHDX is one user’s case—not a typical WSL footprint—and a large virtual-disk limit does not mean Windows has already reserved that much space.

Why the Linux and Windows storage numbers differ

In WSL 2, Linux files live inside an ext4 filesystem held in a virtual hard disk file on Windows. Microsoft documents a default maximum virtual capacity of 1 TB for current WSL versions covered by its disk-space guidance; earlier defaults were 512 GB and 256 GB for specified older releases. These are virtual capacity limits, not the amount of Windows storage the VHDX currently occupies. Microsoft’s WSL disk-space guide explains the distinction.

Linux tools report filesystem usage within the virtual disk. Windows Explorer’s file size reports the VHDX’s host-side footprint. Deleting files inside Linux can free ext4 blocks without making the VHDX file smaller on Windows. The two measurements answer different questions: how full the Linux filesystem is, and how much physical storage its VHDX occupies.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check the distro’s Linux usage and Windows footprint

1. Identify the distribution and WSL version

In PowerShell or Command Prompt, run:

wsl --list --verbose

Note the exact distro name and whether it is running WSL 2. The name is needed for the disk-usage command and for locating its VHDX.

#1 Best Overall
Sandisk 2TB Extreme Portable SSD, Up to 1050MB/s, USB-C, USB 3.2 Gen 2, IP65 Water and Dust Resistance, Updated Firmware, External Solid State Drive, SDSSDE61-2T00-G25
  • Get NVMe solid state performance with up to 1050MB/s read and 1000MB/s write speeds in a portable, high-capacity drive(1) (Based on internal testing; performance may be lower depending on host device & other factors. 1MB=1,000,000 bytes.)
  • Up to 3-meter drop protection and IP65 water and dust resistance mean this tough drive can take a beating(3) (Previously rated for 2-meter drop protection and IP55 rating. Now qualified for the higher, stated specs.)
  • Use the handy carabiner loop to secure it to your belt loop or backpack for extra peace of mind.
  • Help keep private content private with the included password protection featuring 256‐bit AES hardware encryption.(3)
  • Easily manage files and automatically free up space with the SanDisk Memory Zone app.(5). Non-Operating Temperature -20°C to 85°C

2. Check Linux filesystem usage

Microsoft documents this command for the WSL system distribution:

wsl.exe --system -d <distribution-name> df -h /mnt/wslg/distro

If it does not work on your installation, Microsoft suggests trying:

Rank #2
Sandisk 1TB Portable SSD, Up to 800MB/s Read Speeds, Black (Old Model)
  • Solid state performance with up to 800MB/s read speeds in a portable drive. (Based on internal testing; performance may be lower depending on host device, interface, usage conditions and other factors. 1MB=1,000,000 bytes.)
  • Back up your content and memories on a storage solution that fits seamlessly into your mobile lifestyle.
  • Take it with you on your adventures—up to two-meter drop protection means this durable drive can take a beating. (Based on internal testing.)
  • Secure it to your belt loop or backpack for extra peace of mind thanks to the tough rubber hook.
  • From Sandisk, a brand professional photographers trust to take on assignments.
wsl df -h /

Replace <distribution-name> with the name shown by the list command. df reports capacity and usage from Linux’s filesystem perspective; it does not report the physical size of the Windows VHDX. See Microsoft’s WSL basic commands reference.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Locate the VHDX to inspect its Windows size

Microsoft provides this PowerShell registry lookup to identify the distribution’s VHDX path:

Rank #3
SSK Portable SSD 500GB External Solid State Hard Drive USB C Up to 1050MB/s
  • Capacity Display Variance: 500GB external ssd often appears as around 465GB on Windows. MacOS can show full 500 GB capacity. This is binary calculation difference and doesn’t affect SSD hard drive actual physical storage
  • 1050 MB/s Speed: Instantly access to your files with blazing-fast 10Gbps external SSD read up to 1050MB/s and write up to 1000MB/s. LED Light indicates USB SSD instant activity
  • Data Security: Solid state drives S.M.A.R.T. health diagnostics​ and adaptive TRIM optimizing data block management ensures consistent write speeds and extends the longevity of the portable SSD
  • USB-C & USB-A Cable: Both cables featuring rapid USB 3.2 Gen2, this USB SSD effortlessly bridges devices, enabling seamless cross-platform file transfers and backup between computers, smartphones, tablets and iPhone
  • Always Fast: No slowdowns for large file transfers. With SLC caching (25% of current available capacity allocated as high-speed cache), this external SSD delivers steady 10Gbps for transfers within the cache capacity
Get-ChildItem HKCU:SoftwareMicrosoftWindowsCurrentVersionLxss | ForEach-Object { Get-ItemProperty $_.PSPath } | Select-Object DistributionName, BasePath

Use the matching distribution name and base path to identify ext4.vhdx, then inspect the file’s properties in Windows. Treat the path as identification only: Microsoft warns against modifying, moving or accessing WSL files in AppData with Windows tools or editors because doing so can corrupt the distribution. Its disk-space guide includes this warning.

Why deleting Linux files may not shrink the VHDX

Removing files frees space inside the ext4 filesystem, but the host-side virtual disk may retain the space it had grown to occupy. Automatic shrinking is not safe to assume on every installation: behavior depends on WSL version and configuration.

Rank #4
Sale
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
  • Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

When sparse VHD can reclaim host storage

Microsoft’s September 18, 2023 description of sparse VHDs says that, with the feature enabled, WSL virtual hard disks can shrink automatically as well as grow. That is a feature-specific statement, not a guarantee that every existing installation is configured to shrink.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For an existing distro, the 2023 post describes this command:

Best Value
Sale
Samsung T7 Portable SSD 1TB Titan Gray, USB 3.2 Gen 2, Up to 1,050MB/s
  • MADE FOR THE MAKERS: Create; Explore; Store; The T7 Portable SSD delivers fast speeds and durable features to back up any endeavor; Build your video editing empire, file your photographs or back up your blogs all in an instant
  • SHARE IDEAS IN A FLASH: Don’t waste a second waiting and spend more time doing; The T7 is embedded with PCIe NVMe technology that brings fast read and write speeds up to 1,050/1,000 MB/s¹, making it almost twice as fast as the T5
  • ALWAYS MAKE THE SAVE: Compact design with massive capacity; With capacities up to 4TB, save exactly what you need to your drive – from large working files to game data and everything in between
  • ADAPTS TO EVERY NEED: Whether using a PC or mobile phone, count on the T7 for extensive compatibility²; It’s a true team player when it comes to heavy-duty application usage or file-saving
  • HI RESOLUTION VIDEO RECORDING: Record Ultra High Resolution (4K 60fs) videos directly onto the T7 Portable SSD with your favorite camera or mobile devices; Supports iPhone 15 Pro Res 4K at 60fps video and more³
wsl --manage <distro> --set-sparse true

Replace <distro> with the distribution name. The WSL configuration reference lists sparseVhd under general settings, with a default of false; setting it to true makes newly created VHDs sparse automatically. Check the current behavior and availability for your installed WSL release before relying on this feature. Sources: Microsoft’s September 2023 WSL update and WSL configuration reference.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose the operation that matches the problem

Goal Documented approach Important distinction
Find out whether Linux or the VHDX is using the space Compare Linux df output with the VHDX file size in Windows. These figures measure different things.
Reduce host-side VHDX size over time Check whether sparse VHD behavior is available and enabled for your WSL version and distro. Do not assume all installations shrink automatically.
Give a distro more virtual disk capacity On WSL releases 2.5 and higher, use the documented resize command after shutting down WSL. This command enlarges the virtual disk; it is not a shrink operation.
Back up or move a distro Use WSL export/import, including the option to choose a new installation location. Do not unregister the original until you have verified the exported backup.

Enlarge a disk only when Linux needs more capacity

Microsoft documents wsl --manage <distro> --resize <size> for WSL releases 2.5 and higher. Shut down WSL before using it. This changes disk capacity upward; it does not compact a VHDX or reclaim Windows storage. Follow the current Microsoft disk-space instructions for the supported workflow.

Move or back up a distro with export and import

Microsoft’s FAQ documents exporting a distribution and importing it at a selected location, which can help when the system drive is short on room. Unregistering a distro permanently removes its existing data, so verify the exported backup before running an unregister command. See the WSL FAQ for the export/import example and warnings.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not treat disk expansion as compaction

The documented resize command addresses a virtual disk that needs more capacity. Microsoft’s disk-space guide documents expansion, but does not provide a universal manual VHDX-compaction procedure for every Windows edition, WSL version and configuration. Avoid applying a generic compaction recipe without checking that it is supported for your system and following current Microsoft instructions. Never manipulate the distro’s VHDX directly with Windows tools in its AppData location.

Quick Recap

Bestseller No. 2
Sandisk 1TB Portable SSD, Up to 800MB/s Read Speeds, Black (Old Model)
Sandisk 1TB Portable SSD, Up to 800MB/s Read Speeds, Black (Old Model)
From Sandisk, a brand professional photographers trust to take on assignments.
$188.90
SaleBestseller No. 4
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$129.99

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.