User Tools

Site Tools


Sidebar

code:wsl

WSL 2 hints

Disable Snap

Source: https://haydenjames.io/remove-snap-ubuntu-22-04-lts/

sudo systemctl disable snapd.service
sudo systemctl disable snapd.socket
sudo systemctl disable snapd.seeded.service
sudo systemctl mask snapd.service

/etc/wsl.conf

[automount]
enabled = true
# options = "metadata,uid=1000,gid=1000,umask=0022,fmask=11,case=off"
options = "metadata,uid=1000,gid=1000,umask=0022"
mountFsTab = true
crossDistro = true

[Interop]
appendWindowsPath = false

[network]
generateHosts = true
generateResolvConf = false

Manualy free RAM

Sync linux time with windows issue

Outdated stuff for WSL 1

1803

Chmod/Chown

Source: https://blogs.msdn.microsoft.com/commandline/2018/01/12/chmod-chown-wsl-improvements/

sudo umount /mnt/c
sudo mount -t drvfs C: /mnt/c -o metadata
 
sudo chmod 600 .ssh/id_rsa
sudo chowin $USER .ssh/id_rsa

1709

SSH settings

Source: https://www.jetbrains.com/help/pycharm/configuring-remote-interpreters-via-wsl.html

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:

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: /etc/ssh/ssh_host_rsa_key”, you may need to regenerate keys. In bash prompt type

sudo ssh-keygen -A
code/wsl.txt · Last modified: 2024/09/30 22:20 by hansek