Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
Redmond desk3 min

Why WSL 2 or Docker Keeps Filling Your Windows C: Drive

WSL 2 distributions live in Windows-hosted ext4.vhdx files, and Docker images or stopped containers can also take space. Find the growing resource before cleaning up.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If your C: drive keeps losing space while you use WSL 2 or Docker, the cause may be data stored in a virtual disk—not ordinary Windows files you can see in File Explorer. WSL 2 distributions use an ext4.vhdx virtual hard disk on a Windows drive, while Docker images and stopped containers can also consume storage. Check which resource is growing before deleting anything: Linux free space, the VHDX file’s size on Windows, and Docker resources are different things.

Why WSL 2 can use space on C:

Each WSL 2 Linux distribution is stored in a virtual hard disk file named ext4.vhdx. The file resides on a Windows drive, commonly under a distribution package’s LocalState folder, so files kept inside Linux can contribute to Windows drive usage. Microsoft says WSL automatically resizes the virtual hard disk as storage needs change.

As an Amazon Associate I earn from qualifying purchases.

The configured maximum is not the same as the amount of space the file currently occupies. Microsoft documents a default maximum virtual disk allocation of 1 TB for recent WSL releases. The default was 512 GB before WSL release 0.58.0, and 256 GB earlier. These figures describe maximum allocation, not an immediate C: drive footprint. Microsoft’s WSL disk-space guidance explains the distinction and the available management options.

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

How to find the WSL distribution using space

First identify the distribution you want to inspect. The Linux filesystem’s free-space report tells you how much space is free inside that filesystem; it does not, by itself, reveal the size of the VHDX file on Windows.

#1 Best Overall
Sale
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400) | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
  • 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.
  1. In PowerShell, list installed distributions with wsl --list --verbose. Note the distribution name exactly as shown.

  2. Use Microsoft’s documented PowerShell registry query to find that distribution’s BasePath, then append ext4.vhdx to locate its virtual disk. The resulting path is often beneath %LOCALAPPDATA%Packages...LocalState. Follow the command and naming details in Microsoft’s WSL disk-space instructions.

    Rank #2
    Sale
    Samsung T7 Portable SSD 1TB Titan Gray, USB 3.2 Gen 2, Up to 1,050MB/s | Reliable External Solid State Drive Storage for Gaming, Students, Professionals (MU-PC1T0T/AM)
    • 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³
  3. Check the VHDX file’s properties in Windows to see its host-side size. Separately, in the distribution, run df -h to inspect guest filesystem usage. These readings answer different questions.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  4. If the distribution is large, inspect its contents for data you recognize before removing anything. Package caches, build outputs, development environments, and personal files are examples to check—not a guarantee that any one category is responsible.

    Rank #3
    Sale
    Samsung T7 Portable SSD 2TB 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³

Why Docker can contribute to low disk space

Docker storage is another possible source. Microsoft Learn states that “Images and stopped containers consume disk space.” This does not mean Docker accounts for all unexplained C: usage, or that a particular Docker Desktop disk-image path applies to every setup. Diagnose WSL and Docker separately before cleanup.

Microsoft’s WSL container guidance shows these prune commands as removal operations for resources that are no longer needed:

Rank #4
Lexar ES3 1TB Portable SSD Silver, USB 3.2 Gen 2 up to 1050MB/s
  • Note: Magsafe is not available in this version
  • High-speed Data Transfer: Lexar external SSD ES3 supports USB 3.2 Gen 2 up to 1050MB/s read and 1000MB/s write to transfer files fast for more efficient work. (Performance may be lower if not supporting USB 3.2 Gen 2 on Mac and other systems)
  • Wide Compatibility: Lexar Portable SSD ES3 compatibility with iPhone 17 series (Not supported on iPhone 14 and older models), Android mobile devices, laptops, cameras, Xbox X|S, PS4, PS5, gaming console, and more
  • On The Go: Lexar external solid state drive ES3's thin, stylish, and durable design, weighs 42g and is only 10.5mm thick, making it smaller than a card and easily fits in your pocket. It comes with a Type-C cable for plug-and-play convenience
  • Data Safety First: Lexar SSD ES3 includes Lexar DataShieldTM 256-bit AES encryption software to protect files
  • wslc container prune removes stopped containers.

  • wslc image prune removes unused images.

Review what you rely on before pruning. These examples target stopped containers and unused images; they should not be treated as commands that remove all Docker Desktop data or necessarily shrink a Windows-hosted virtual disk file.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What cleanup does—and does not—do

Deleting files inside a Linux distribution or pruning Docker resources removes data at the relevant software layer. That is different from shrinking or compacting the VHDX file stored on Windows. The Microsoft disk-space guidance documents WSL disk management, including expansion, but does not establish a general compaction procedure for every installation.

Best Value
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

Before directly interacting with a WSL virtual disk, shut WSL down with wsl --shutdown. Microsoft warns that the VHD must not be in use for its documented disk workflow; shutting down is a safety prerequisite, not a cleanup command. See Microsoft’s guidance on mounting a Linux disk in WSL 2. Also check your installed WSL version: Microsoft says wsl --manage resize operations require WSL 2.5 or later, and the documented resize example expands virtual disk size rather than compacting it.

Docker Desktop storage paths need version-specific guidance

Do not apply a relocation or compaction procedure just because it describes a Docker image folder on Windows. Microsoft’s Docker client troubleshooting article discusses low disk space and an image-folder change for the Docker configuration it covers; it does not establish Docker Desktop’s current WSL 2 storage path or a universal procedure for moving or compacting that data. Use guidance that specifically matches your Docker Desktop version and storage configuration.

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.

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

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.