# WSL2 + Dev Drive on D: without filling C:

> Move WSL2's Ubuntu VHDX and your Windows-side projects and package caches to a D: Dev Drive on Windows 11 26H2 — with the ReFS limits Microsoft documents.

**Tested on**

- Build: 26300.9457
- Edition: Pro (26H2)
- Architecture: x64
- Evidence: E2
- Risk: R2
- Verified: 2026-10-28
- Test machine: PVE 9.2.2 VM 361; Windows 11 Pro 26H2 26300.9457; 8GB/4 vCPU; 128GB SATA data disk formatted as D: ReFS Dev Drive; WSL 3.0.3; Ubuntu 24.04

VM 361: D: is a trusted ReFS Dev Drive, Ubuntu 24.04 runs on WSL2 kernel 6.18, and ext4.vhdx is on D:. Click to open full size.

## The short answer

WSL2 stores each Linux distribution in a **VHDX**. By default that file lives under `%LOCALAPPDATA%` on C:. You can put it on D: instead, format D: as a **Dev Drive**, and keep C: for Windows itself.

This lab did exactly that on Windows 11 26H2:

| Item | Lab result |
|---|---|
| D: volume | **127.9GB ReFS**, label `DevDrive`, trusted developer volume |
| WSL | **3.0.3.0**, default version 2 |
| Distribution | **Ubuntu 24.04 LTS** |
| Kernel | **6.18.54.1-microsoft-standard-WSL2** |
| VHDX | `D:\WSL\Ubuntu\ext4.vhdx`, 1.25GB after first boot |
| User | `dev`, default in `/etc/wsl.conf` |

But get the expectation right before you copy commands:

> **Caution: Dev Drive does not make Linux files faster**
>
> Microsoft’s Dev Drive FAQ is explicit: WSL runs in a VHD, and **you should not expect a performance improvement when accessing Dev Drive project files from WSL**. The WSL `metadata` mount option is **not supported on ReFS**, the file system Dev Drive uses. Put the VHDX and Windows-side repositories/caches on D:; keep Linux repositories inside the ext4 VHDX, not on `/mnt/d`.

If speed is the only goal, leaving the VHDX on C: is simpler. This layout is about **capacity isolation**: the VHDX and Windows-side data live on D:, while Linux files stay inside ext4.

## Before you start

| Check | Requirement |
|---|---|
| Windows | Windows 11 22H2 build **22621.2338** or later for Dev Drive |
| Free space | At least **50GB** for the Dev Drive; 128GB is comfortable |
| Permissions | Local administrator; `fsutil` and disk formatting need elevation |
| Disk | A **new or unallocated** disk. Formatting destroys it |
| Virtualization | WSL2 needs virtualization; if Windows is itself a VM, nested virtualization must be enabled |
| Backup | Any existing data on the target disk is erased |

> **Danger: Verify the disk number first**
>
> `Initialize-Disk` and `Format-Volume` erase the selected disk. Run `Get-Disk` and match the disk by size and model before you touch it. Do not run these commands against Disk 0 on a working PC.

## Step 1 — Make D: a Dev Drive

Dev Drive is created **only at format time**. You cannot convert an existing NTFS volume in place, and C: cannot be a Dev Drive.

- [ ] **Inspect the new disk** (Terminal (admin))

  ```powershell
  Get-Disk | Format-Table Number,FriendlyName,PartitionStyle,OperationalStatus,Size
  Get-Volume | Format-Table DriveLetter,FileSystemLabel,FileSystem,DriveType,Size
  ```
  If D: is currently a CD/DVD drive, move that drive letter first. In the lab the 26H2 ISO held D:, so it was reassigned to Y: before the data disk was formatted.

  Expected: The new disk is Online, RAW or uninitialized, and has the size you expected.

- [ ] **Initialize, partition and format as Dev Drive** (Terminal (admin))

  ```powershell
  Initialize-Disk -Number 1 -PartitionStyle GPT
  New-Partition -DiskNumber 1 -UseMaximumSize -DriveLetter D
  Format-Volume -DriveLetter D -FileSystem ReFS -NewFileSystemLabel DevDrive -DevDrive -Confirm:$false
  ```
  Verify from an **elevated** PowerShell:

  ```powershell
  Get-Volume -DriveLetter D
  fsutil devdrv query D:
  ```

  Expected output includes `This is a trusted developer volume.` A normal, non-elevated shell can return `Access is denied` for `fsutil`; that is a permission issue, not a broken Dev Drive.

  Expected: D: is ReFS, labelled DevDrive, and fsutil reports a trusted developer volume.

The Settings path is equivalent: **System → Storage → Advanced storage settings → Disks & volumes → Create dev drive**. The command line is easier to document and repeat.

## Step 2 — Install WSL2

On a normal Windows 11 PC, the supported path is:

- [ ] **Install WSL without a distribution** (Terminal (admin))

  ```powershell
  wsl --install --no-distribution
  ```
  Reboot if Setup asks. Then check:

  ```powershell
  wsl --version
  wsl --status
  ```

  Expected: WSL installs; a reboot may be required for Virtual Machine Platform.

> **Note: This lab image had no Store WSL package**
>
> `wsl --install` returned exit 1 on the clean 26H2 image because the Store WSL package was absent; enabling `Microsoft-Windows-Subsystem-Linux` and `VirtualMachinePlatform` by DISM was not enough. The lab installed the official **WSL 3.0.3 x64 MSI** from [Microsoft’s WSL releases](https://github.com/microsoft/WSL/releases) and verified its SHA-256 against the GitHub release asset digest before installing. A normal PC should try `wsl --install` first; use the MSI only when the supported path is unavailable.

## Step 3 — Put Ubuntu on D:

If the distribution list is reachable, one command does it:

- [ ] **Install Ubuntu directly to D:** (Terminal (admin))

  ```powershell
  wsl --install -d Ubuntu --location D:\WSL\Ubuntu --no-launch
  ```
  `--location` must be an absolute path. `--no-launch` avoids the interactive first-run prompt until you are ready.

  Then start it once to create your Linux user:

  ```powershell
  wsl -d Ubuntu
  ```

  Expected: Ubuntu is registered and its ext4.vhdx is created under D:\WSL\Ubuntu.

If `wsl --install` cannot fetch the distribution list, use Ubuntu’s official rootfs and import it. This is also the reproducible path for an offline or restricted network.

- [ ] **Fallback: import the official Ubuntu rootfs** (Terminal (admin))

  ```powershell
  New-Item -ItemType Directory D:\WSL -Force
  curl.exe -L -o D:\WSL\ubuntu-24.04.rootfs.tar.gz `
    https://cloud-images.ubuntu.com/wsl/releases/24.04/current/ubuntu-noble-wsl-amd64-wsl.rootfs.tar.gz
  
  # Compare with SHA256SUMS from the same directory before importing
  Get-FileHash D:\WSL\ubuntu-24.04.rootfs.tar.gz -Algorithm SHA256
  
  wsl --import Ubuntu D:\WSL\Ubuntu D:\WSL\ubuntu-24.04.rootfs.tar.gz --version 2
  ```
  Create a normal user, set it as the default, and stop the distro:

  ```powershell
  wsl -d Ubuntu -u root -e useradd -m -G sudo -s /bin/bash dev
  wsl -d Ubuntu -u root -e passwd dev
  wsl -d Ubuntu -u root -e bash -c "printf '[user]\ndefault=dev\n' > /etc/wsl.conf"
  wsl --terminate Ubuntu
  ```

  Expected: Ubuntu is registered as WSL2; the VHDX is on D:.

The lab used the fallback: the distribution list URL (`raw.githubusercontent.com`) was reset, so `wsl --install -d Ubuntu` could not run. The 24.04 rootfs was verified against Ubuntu’s `SHA256SUMS` before import.

## Step 4 — Verify the VHDX is on D:

- [ ] **Check WSL version, distro version and VHDX path** (Terminal (admin))

  ```powershell
  wsl --list --verbose
  Get-Item D:\WSL\Ubuntu\ext4.vhdx | Select-Object FullName,Length
  wsl -d Ubuntu -e bash -lc "grep PRETTY_NAME /etc/os-release; uname -r; whoami; df -h /"
  ```

  Expected: VERSION is 2; the kernel ends in -microsoft-standard-WSL2; ext4.vhdx is under D:\WSL\Ubuntu.

Lab output:

```text
NAME      STATE     VERSION
* Ubuntu  Stopped   2

PRETTY_NAME="Ubuntu 24.04 LTS"
6.18.54.1-microsoft-standard-WSL2
dev
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdd       1007G  1.2G  955G   1% /
```

The VHDX grows on demand; the 1007G inside the distro is virtual capacity, not 1TB reserved on D:.

## Step 5 — Decide what actually goes on D:

Dev Drive is for **source repositories, package caches, build output and intermediate files** — not for installing applications and SDKs. Keep the tools on C:; put their data on D:.

```text
D:\
├─ Dev\                 Windows-side repositories
├─ packages\
│  ├─ npm\              npm cache for Windows Node
│  ├─ pip\              pip cache for Windows Python
│  └─ cargo\            Cargo home for Windows Rust
└─ WSL\
   └─ Ubuntu\
      └─ ext4.vhdx      Linux files live inside this VHDX
```

For Windows tools, redirect caches only if you actually use them:

```powershell
setx /M npm_config_cache D:\packages\npm
setx /M PIP_CACHE_DIR D:\packages\pip
setx /M CARGO_HOME D:\packages\cargo
```

For WSL, do the opposite: keep repositories inside the Linux file system, for example `~/code`, not under `/mnt/d/Dev`. `/mnt/d` is a Windows file system view; it has different permissions and is slower for Linux workloads.

## Step 6 — Know the ReFS limits

| Limit | What it means in practice |
|---|---|
| `metadata` mount option unsupported | Do not add `metadata` to WSL automount options for D:; Linux ownership/permissions on `/mnt/d` will not behave like ext4 |
| No Linux performance gain | A VHDX on Dev Drive is still a VHD; Microsoft says not to expect Dev Drive speedups for WSL files |
| No application installs | Dev Drive is for project data, not SDKs/apps; keep tool installs on C: |
| Minimum 50GB | Smaller volumes cannot be Dev Drives |
| Format-time only | You cannot convert an existing NTFS D: into a Dev Drive without erasing it |
| Trust is per machine | Moving a Dev Drive VHD/disk to another PC loses the trusted designation until re-designated |

> **Note: Do not move an existing distro with this page**
>
> This is a **fresh install** recipe. Moving an existing WSL distribution is a different operation with its own backup and rollback requirements; it was not tested in this run.

## Troubleshooting

| Symptom | Likely cause | First move |
|---|---|---|
| `HCS_E_HYPERV_NOT_INSTALLED` or “virtualization is not enabled” | Virtual Machine Platform off, firmware virtualization off, or Windows is a VM without nested virtualization | Enable the Windows features; on a VM expose SVM/VT-x and SLAT to the guest. The lab needed PVE `cpu: host` instead of a `qemu64` baseline |
| `WSL_E_LOCAL_SYSTEM_NOT_SUPPORTED` | `wsl.exe` was launched as SYSTEM (for example by a service/agent) | Run WSL as the logged-in user, or from an interactive scheduled task with the user’s token |
| `WININET_E_CONNECTION_RESET` while fetching the distribution list | `raw.githubusercontent.com` blocked or reset | Use the official Ubuntu rootfs + `wsl --import` path above |
| `fsutil devdrv query` returns `Access is denied` | Shell is not elevated | Open PowerShell as Administrator |
| `ERROR_ALREADY_EXISTS` on import | A distro named Ubuntu is still registered | `wsl --unregister Ubuntu` destroys its data; or import under a new name |
| `Initialize-Disk` fails | Disk is offline, read-only, or already initialized | Check `Get-Disk`; do not force a disk that contains data |
| `Format-Volume -DevDrive` fails | Less than 50GB unallocated, or the volume was already formatted | Create at least 50GB of unallocated space; Dev Drive must be the original format |

## What this page verified

| Claim | Evidence |
|---|---|
| D: is a 127.9GB ReFS Dev Drive, trusted, with WdFilter attached | E2, VM 361 screenshot + `fsutil devdrv query` |
| WSL 3.0.3 runs Ubuntu 24.04 as WSL2 | E2, `wsl --list --verbose`, kernel `6.18.54.1-microsoft-standard-WSL2` |
| The Ubuntu VHDX is on D: | E2, `D:\WSL\Ubuntu\ext4.vhdx` |
| `wsl --install` Store path is not universal | E2, it failed on this image; rootfs import succeeded |
| Dev Drive speeds up Linux files | **Not claimed**; Microsoft says the opposite |
| Docker Desktop, VS Code, Node, Claude Code, Codex | **Not tested** in this run |
| Moving an existing WSL distro to D: | **Not tested** |

## Related pages

- [First 10 minutes on a new Windows 11 PC](https://windows.homes/en/windows/start/first-hour/) — updates, drivers and BitLocker before development.
- [Clean install Windows 11 26H2](https://windows.homes/en/windows/install/clean/) — the base image used for this lab.
- [Windows on Arm](https://windows.homes/en/windows/platform/arm64/) — WSL2 on Arm is a different architecture path.

## Sources

- [Microsoft Learn — Set up a Dev Drive on Windows 11](https://learn.microsoft.com/en-us/windows/dev-drive/)
- [Microsoft Learn — Basic commands for WSL](https://learn.microsoft.com/en-us/windows/wsl/basic-commands)
- [Microsoft Learn — Install WSL](https://learn.microsoft.com/en-us/windows/wsl/install)
- [Ubuntu — WSL 24.04 rootfs image](https://cloud-images.ubuntu.com/wsl/releases/24.04/current/)
- [Microsoft — WSL releases](https://github.com/microsoft/WSL/releases)

---

Source: https://windows.homes/en/windows/dev/wsl2/
