author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Sat, 21 Nov 2020 21:55:33 +0200 | |
changeset 2466 | ebbf146d86c1 |
parent 2459 | 607f6d056e26 |
child 2469 | d6eb5318b6ff |
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 |
9e6abc83e5d6
Windows Subsystem for Linux Documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2423
diff
changeset
|
9 |
============= |
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. |
9e6abc83e5d6
Windows Subsystem for Linux Documentation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2423
diff
changeset
|
15 |
|
2365 | 16 |
wsl utility |
17 |
=========== |
|
18 |
||
19 |
Run Linux command from default distro:: |
|
20 |
||
21 |
wsl ls |
|
22 |
wsl -e /bin/ls |
|
23 |
wsl --exec /bin/bash |
|
24 |
||
2366
55f48026a610
Run Linux command from specific distro.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2365
diff
changeset
|
25 |
Run Linux command from specific distro:: |
55f48026a610
Run Linux command from specific distro.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2365
diff
changeset
|
26 |
|
55f48026a610
Run Linux command from specific distro.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2365
diff
changeset
|
27 |
wsl -d ubuntu ls |
55f48026a610
Run Linux command from specific distro.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2365
diff
changeset
|
28 |
wsl -d debian -e /bin/ls |
55f48026a610
Run Linux command from specific distro.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2365
diff
changeset
|
29 |
wsl -d debian --exec /bin/bash |
55f48026a610
Run Linux command from specific distro.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2365
diff
changeset
|
30 |
wsl -distribution debian --exec /bin/bash |
55f48026a610
Run Linux command from specific distro.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2365
diff
changeset
|
31 |
|
2367
f295973a87a5
Run Linux command from specific user.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2366
diff
changeset
|
32 |
Run Linux command from specific user:: |
f295973a87a5
Run Linux command from specific user.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2366
diff
changeset
|
33 |
|
f295973a87a5
Run Linux command from specific user.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2366
diff
changeset
|
34 |
wsl -u user ls |
f295973a87a5
Run Linux command from specific user.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2366
diff
changeset
|
35 |
wsl --user root ls |
f295973a87a5
Run Linux command from specific user.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2366
diff
changeset
|
36 |
|
2459
607f6d056e26
Added link to docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2457
diff
changeset
|
37 |
Combining user & distro:: |
607f6d056e26
Added link to docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2457
diff
changeset
|
38 |
|
607f6d056e26
Added link to docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2457
diff
changeset
|
39 |
wsl -u root -d alpine -- ls |
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 |
https://docs.microsoft.com/en-us/windows/wsl/wsl-config |
607f6d056e26
Added link to docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2457
diff
changeset
|
42 |
Ways to run WSL. |
607f6d056e26
Added link to docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2457
diff
changeset
|
43 |
|
2368 | 44 |
wslconfig utility |
45 |
================= |
|
46 |
||
47 |
List distros:: |
|
48 |
||
49 |
wslconfig /l |
|
50 |
wslconfig /list |
|
51 |
||
52 |
Set default distro:: |
|
53 |
||
54 |
wslconfig /s debian |
|
55 |
wslconfig /setdefault debian |
|
56 |
||
57 |
Terminate any running parts of distro:: |
|
58 |
||
59 |
wslconfig /s debian |
|
60 |
wslconfig /terminate debian |
|
61 |
||
2423
6a4fd5ccb340
Mounting external drives.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2368
diff
changeset
|
62 |
Mounting external drives |
6a4fd5ccb340
Mounting external drives.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2368
diff
changeset
|
63 |
======================== |
6a4fd5ccb340
Mounting external drives.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2368
diff
changeset
|
64 |
|
6a4fd5ccb340
Mounting external drives.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2368
diff
changeset
|
65 |
:: |
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 |
sudo mkdir /mnt/f |
6a4fd5ccb340
Mounting external drives.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2368
diff
changeset
|
68 |
sudo mount -t drvfs f: /mnt/f |
2459
607f6d056e26
Added link to docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2457
diff
changeset
|
69 |
|
607f6d056e26
Added link to docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2457
diff
changeset
|
70 |
https://docs.microsoft.com/en-us/windows/wsl/wsl-config |
607f6d056e26
Added link to docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2457
diff
changeset
|
71 |
``/etc/wsl.conf`` configuration options. |
607f6d056e26
Added link to docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2457
diff
changeset
|
72 |