Skip to content

Instantly share code, notes, and snippets.

View yefengwu's full-sized avatar
💭
I may be slow to respond.

frank yefengwu

💭
I may be slow to respond.
View GitHub Profile
@yefengwu
yefengwu / vhd4wsl2.md
Created August 11, 2024 00:54 — forked from lseongjoo/vhd4wsl2.md
Creating virtual hard disk (VHD) for WSL2

Creating additional virtual hard disk (VHDX) for WSL2 with ext4 filesystem

Lines starting with # mean the commands have to be executed by root user under Linux shell (WSL distro). All other commands have to be executed under Windows-PowerShell as Administrator.

Make VHDX disk file and mount it under Windows

New-VHD support.vhdx -SizeBytes 25GB -Dynamic -BlockSizeBytes 1MB
Write-Output "\\.\PhysicalDrive$((Mount-VHD -Path support.vhdx -PassThru | Get-Disk).Number)"