author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Mon, 04 Jan 2021 10:48:34 +0200 | |
changeset 2497 | 8407a34a1b5d |
parent 2493 | e83847e718a0 |
child 2508 | fe9788ce44ba |
permissions | -rw-r--r-- |
2365 | 1 |
|
2 |
================================== |
|
3 |
WSL, Windows subsystem for Linux |
|
4 |
================================== |
|
5 |
.. contents:: |
|
6 |
:local: |
|
7 |
||
2457
9e6abc83e5d6
Windows Subsystem for Linux Documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2423
diff
changeset
|
8 |
Documentation |
2493
e83847e718a0
Fixed RST section format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2486
diff
changeset
|
9 |
============= |
2457
9e6abc83e5d6
Windows Subsystem for Linux Documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2423
diff
changeset
|
10 |
|
9e6abc83e5d6
Windows Subsystem for Linux Documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2423
diff
changeset
|
11 |
https://docs.microsoft.com/en-us/windows/wsl/ |
9e6abc83e5d6
Windows Subsystem for Linux Documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2423
diff
changeset
|
12 |
Windows Subsystem for Linux Documentation. |
9e6abc83e5d6
Windows Subsystem for Linux Documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2423
diff
changeset
|
13 |
https://github.com/sirredbeard/Awesome-WSL |
9e6abc83e5d6
Windows Subsystem for Linux Documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2423
diff
changeset
|
14 |
Awesome list dedicated to Windows Subsystem for Linux. |
2469
d6eb5318b6ff
Automatically Configuring WSL.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2459
diff
changeset
|
15 |
https://devblogs.microsoft.com/commandline/automatically-configuring-wsl/ |
d6eb5318b6ff
Automatically Configuring WSL.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2459
diff
changeset
|
16 |
Automatically Configuring WSL. |
2457
9e6abc83e5d6
Windows Subsystem for Linux Documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2423
diff
changeset
|
17 |
|
2365 | 18 |
wsl utility |
2493
e83847e718a0
Fixed RST section format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2486
diff
changeset
|
19 |
=========== |
2365 | 20 |
|
21 |
Run Linux command from default distro:: |
|
22 |
||
23 |
wsl ls |
|
24 |
wsl -e /bin/ls |
|
25 |
wsl --exec /bin/bash |
|
26 |
||
2366
55f48026a610
Run Linux command from specific distro.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2365
diff
changeset
|
27 |
Run Linux command from specific distro:: |
55f48026a610
Run Linux command from specific distro.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2365
diff
changeset
|
28 |
|
55f48026a610
Run Linux command from specific distro.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2365
diff
changeset
|
29 |
wsl -d ubuntu ls |
55f48026a610
Run Linux command from specific distro.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2365
diff
changeset
|
30 |
wsl -d debian -e /bin/ls |
55f48026a610
Run Linux command from specific distro.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2365
diff
changeset
|
31 |
wsl -d debian --exec /bin/bash |
55f48026a610
Run Linux command from specific distro.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2365
diff
changeset
|
32 |
wsl -distribution debian --exec /bin/bash |
55f48026a610
Run Linux command from specific distro.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2365
diff
changeset
|
33 |
|
2367
f295973a87a5
Run Linux command from specific user.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2366
diff
changeset
|
34 |
Run Linux command from specific user:: |
f295973a87a5
Run Linux command from specific user.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2366
diff
changeset
|
35 |
|
f295973a87a5
Run Linux command from specific user.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2366
diff
changeset
|
36 |
wsl -u user ls |
f295973a87a5
Run Linux command from specific user.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2366
diff
changeset
|
37 |
wsl --user root ls |
f295973a87a5
Run Linux command from specific user.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2366
diff
changeset
|
38 |
|
2459
607f6d056e26
Added link to docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2457
diff
changeset
|
39 |
Combining user & distro:: |
607f6d056e26
Added link to docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2457
diff
changeset
|
40 |
|
607f6d056e26
Added link to docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2457
diff
changeset
|
41 |
wsl -u root -d alpine -- ls |
607f6d056e26
Added link to docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2457
diff
changeset
|
42 |
|
607f6d056e26
Added link to docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2457
diff
changeset
|
43 |
https://docs.microsoft.com/en-us/windows/wsl/wsl-config |
607f6d056e26
Added link to docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2457
diff
changeset
|
44 |
Ways to run WSL. |
607f6d056e26
Added link to docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2457
diff
changeset
|
45 |
|
2368 | 46 |
wslconfig utility |
2493
e83847e718a0
Fixed RST section format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2486
diff
changeset
|
47 |
================= |
2368 | 48 |
|
49 |
List distros:: |
|
50 |
||
51 |
wslconfig /l |
|
52 |
wslconfig /list |
|
53 |
||
54 |
Set default distro:: |
|
55 |
||
56 |
wslconfig /s debian |
|
57 |
wslconfig /setdefault debian |
|
58 |
||
59 |
Terminate any running parts of distro:: |
|
60 |
||
2486 | 61 |
wslconfig /t debian |
2368 | 62 |
wslconfig /terminate debian |
63 |
||
2423
6a4fd5ccb340
Mounting external drives.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2368
diff
changeset
|
64 |
Mounting external drives |
2493
e83847e718a0
Fixed RST section format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2486
diff
changeset
|
65 |
======================== |
2423
6a4fd5ccb340
Mounting external drives.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2368
diff
changeset
|
66 |
|
6a4fd5ccb340
Mounting external drives.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2368
diff
changeset
|
67 |
:: |
6a4fd5ccb340
Mounting external drives.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2368
diff
changeset
|
68 |
|
6a4fd5ccb340
Mounting external drives.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2368
diff
changeset
|
69 |
sudo mkdir /mnt/f |
6a4fd5ccb340
Mounting external drives.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2368
diff
changeset
|
70 |
sudo mount -t drvfs f: /mnt/f |
2459
607f6d056e26
Added link to docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2457
diff
changeset
|
71 |
|
607f6d056e26
Added link to docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2457
diff
changeset
|
72 |
https://docs.microsoft.com/en-us/windows/wsl/wsl-config |
607f6d056e26
Added link to docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2457
diff
changeset
|
73 |
``/etc/wsl.conf`` configuration options. |