Skip to content

Instantly share code, notes, and snippets.

@vunhatchuong
Last active December 16, 2024 00:59
Show Gist options
  • Select an option

  • Save vunhatchuong/65579362fab318af1a80225f22f422c1 to your computer and use it in GitHub Desktop.

Select an option

Save vunhatchuong/65579362fab318af1a80225f22f422c1 to your computer and use it in GitHub Desktop.
WSL Setup Notes

Vietnamese input not working.

sudo nano /etc/locale.gen

Uncomment:

#en_US.UTF-8 UTF-8

Generate

sudo locale-gen

Clipboard not working

Install win32yank from scoop

scoop install win32yank

Connect Windows machine MySQL server from WSL

Install MySQL

Windows machine

Install server, workbench and shell from MySQL Website.

WSL

Install MySQL-Client

yay -S mysql-clients80

Setup mirrored mode networking

Create .wslconfig

touch %UserProfile%\.wslconfig

Add these values into .wslconfig

[wsl2]
networkingMode=mirrored

Check if set correctly from WSL

wslinfo --networking-mode

Set Hyper-V firewall

Enter the command in Powershell with admin privileges.

Set-NetFirewallHyperVVMSetting -Name '{40E0AC32-46A5-438A-A0B2-2B479E8F2E90}' -DefaultInboundAction Allow

Then restart with wsl --shutdown.

In WSL, test connection with mysql -h 0.0.0.0 -u your_username -p

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment