(on Wikipedia)
https://github.com/Microsoft/WSL
https://learn.microsoft.com/en-us/windows/wsl/about [ 1 ]
A way to run Linux commandline software from a specialized console, similar to how a command prompt runs DOS or PowerShell.
It works well, but it's imperfect.
- aka wsl
-
Sometimes mis-named Bash on Ubuntu on Windows or Bash on Windows
- Not related to Git on Windows.
See also:
- Virtualization
-
XLaunch to run GUI Linux software.
-
- 2024-05-04 - Still in regular use.
- 2022-07-06 - on Windows 11
-
2022-07-06 - I used to use Windows Subsystem for Linux
Usage and Troubleshooting ∞
Installation ∞
https://learn.microsoft.com/en-ca/windows/wsl/install-manual [ 2 ]
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart :: Download and install the kernel: :: https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi :: Install Debian: wsl --install --distribution Debian wsl --set-default-version 2 :: Reboot, e.g. :: shutdown -r
Running GUI Linux software on Windows Subsystem for Linux ∞
Either the functionality is built in or I forgot how I did it.
You can also use XLaunch.
your virtual disk ∞
It is called ext4.vhdx
It is located in a directory like %userprofile%\AppData\Local\Packages\TheDebianProject.DebianGNULinux_RANDOMSTRING\LocalState
Note that RANDOMSTRING
is randomly generated and unique to you, so go to %userprofile%\AppData\Local\Packages\
and search for TheDebianProject.DebianGNULinux
or whatever is appropriate for your distribution. You could also stay in that Packages
directory and search for ext4.vhdx
in all directories to find it.
Mount it with VirtualBox or VMWare
Remember that Windows does not understand ext2/ext3/ext4 so you can't read it within Windows directly.
Mount a disk ∞
Unknown. See https://learn.microsoft.com/en-us/windows/wsl/wsl2-mount-disk
Mounting your virtual disk
Mounting another drive letter (e.g. a USB stick) ∞
2024-05-04 on Windows 11
Example with A:
\sudo \sh -c '\mkdir /mnt/a ; \mount -t drvfs a: /mnt/a'
File system becomes read-only or gives an i/o error ∞
Especially if basic features give some sort of i/o error with something basic like df.
This appears to be associated with running out of disk space while wsl2 is running.
In a regular Windows terminal:
:: Shutdown wsl --shutdown :: Reset wsl --terminate Debian :: Start wsl :: If that restart doesn't work, try a reset: wsl --set-version Debian 2 :: Start wsl :: Consider a reinstallation. This will not remove any of your user data or configuration (e.g. [[dotfiles]]) :: Remove wsl --unregister Debian :: Reinstall wsl --install :: Reset wsl --set-version Debian 2 :: Start wsl
Last updated 2024-05-04 at 09:19:22
some virtual disk notes
added troubleshooting notes for a read-only filesystem problem.