Skip to content

Commit 98b3ae0

Browse files
Update wsl2-mount-disk.md
1 parent 0b2c3eb commit 98b3ae0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

WSL/wsl2-mount-disk.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ If `Diskpath` is omitted, all attached disks are unmounted and detached.
170170
You can also mount virtual hard disk files (VHD) into WSL using `wsl --mount`. To do this, you first need to mount the VHD into Windows using the [`Mount-VHD`](https://docs.microsoft.com/powershell/module/hyper-v/mount-vhd) command in Windows. Be sure to run this command in a window with administrator privileges. Below is an example where we use this command, and also output the disk path
171171

172172
```powershell
173-
Write-Output "\.\\PhysicalDrive$((Mount-VHD -Path .\ext4.vhdx -PassThru | Get-Disk).Number)"
173+
Write-Output "\\.\PhysicalDrive$((Mount-VHD -Path .\ext4.vhdx -PassThru | Get-Disk).Number)"
174174
```
175175

176176
You can use the output above to obtain the disk path for this VHD and mount that into WSL following the instructions in the previous section.

0 commit comments

Comments
 (0)