WSL: Difference between revisions

From Omnia
Jump to navigation Jump to search
No edit summary
 
Line 20: Line 20:


ref [https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-10#3-download-ubuntu]
ref [https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-10#3-download-ubuntu]
== Convert WSL and Windows Paths ==
<pre>
$ wslpath
Usage:
    -a    force result to absolute path format
    -u    translate from a Windows path to a WSL path (default)
    -w    translate from a WSL path to a Windows path
    -m    translate from a WSL path to a Windows path, with '/' instead of '\'
EX: wslpath 'c:\users'
</pre>
Windows path from WSL:
<pre>
$ wslpath 'c:\users'
/mnt/c/users
</pre>
WSL path from Windows:
<pre>
$ wslpath -w '/'
\\wsl.localhost\Ubuntu\
</pre>
== keywords ==

Revision as of 15:46, 3 November 2023

Windows Subsystem for Linux

NOTE: THERE IS TOO MUCH OVERHEAD FOR WSL, DON'T ENABLE!

Enable

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

ref: https://www.tenforums.com/tutorials/46769-enable-disable-windows-subsystem-linux-wsl-windows-10-a.html

Disable

Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

ref: https://www.tenforums.com/tutorials/46769-enable-disable-windows-subsystem-linux-wsl-windows-10-a.html

Install Ubuntu

wsl --install -d ubuntu

ref [1]

Convert WSL and Windows Paths

$ wslpath
Usage:
    -a    force result to absolute path format
    -u    translate from a Windows path to a WSL path (default)
    -w    translate from a WSL path to a Windows path
    -m    translate from a WSL path to a Windows path, with '/' instead of '\'

EX: wslpath 'c:\users'

Windows path from WSL:

$ wslpath 'c:\users'
/mnt/c/users

WSL path from Windows:

$ wslpath -w '/'
\\wsl.localhost\Ubuntu\

keywords