This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
code:wsl [2017/11/07 23:02] hansek created |
code:wsl [2024/09/30 22:20] (current) hansek |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== WSL hints ====== | + | ====== WSL 2 hints ====== |
| - | ===== SSH settings | + | ====== |
| + | |||
| + | Source: https:// | ||
| + | |||
| + | <code bash> | ||
| + | sudo systemctl disable snapd.service | ||
| + | sudo systemctl disable snapd.socket | ||
| + | sudo systemctl disable snapd.seeded.service | ||
| + | sudo systemctl mask snapd.service | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== / | ||
| + | |||
| + | < | ||
| + | [automount] | ||
| + | enabled = true | ||
| + | # options = " | ||
| + | options = " | ||
| + | mountFsTab = true | ||
| + | crossDistro = true | ||
| + | |||
| + | [Interop] | ||
| + | appendWindowsPath = false | ||
| + | |||
| + | [network] | ||
| + | generateHosts = true | ||
| + | generateResolvConf = false | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Manualy free RAM ===== | ||
| + | |||
| + | Source: https:// | ||
| + | |||
| + | <code bash> | ||
| + | sudo su | ||
| + | sync; echo 3 > / | ||
| + | </ | ||
| + | |||
| + | //older way// | ||
| + | source: https:// | ||
| + | |||
| + | <code bash> | ||
| + | echo 1 > / | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Sync linux time with windows issue ===== | ||
| + | |||
| + | source: https:// | ||
| + | |||
| + | <code bash> | ||
| + | sudo hwclock -s | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Outdated stuff for WSL 1 ===== | ||
| + | |||
| + | ==== 1803 ==== | ||
| + | |||
| + | === Chmod/Chown === | ||
| + | Source: https:// | ||
| + | |||
| + | <code bash> | ||
| + | sudo umount /mnt/c | ||
| + | sudo mount -t drvfs C: /mnt/c -o metadata | ||
| + | |||
| + | sudo chmod 600 .ssh/ | ||
| + | sudo chowin $USER .ssh/ | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | ==== 1709 ==== | ||
| + | === SSH settings | ||
| Source: https:// | Source: https:// | ||
| + | Modern Windows installations may have built-in SSH server that has to be stopped, because it prevents OpenSSH from listening to port 22. | ||
| + | For example, from the elevated powershell one may run: | ||
| + | <code powershell> | ||
| + | Get-Service -Name ssh* | Stop-Service -Force | ||
| + | Get-Service -Name ssh* | Set-Service -StartupType Disabled | ||
| + | </ | ||
| + | If you get a message "Could not load host key: / | ||
| + | <code bash> | ||
| + | sudo ssh-keygen -A | ||
| + | </ | ||