wsl2

windows访问wsl

\\wsl$\ubuntu

wsl访问windows

explorer.exe .

window terminal 设置copyOnSelect

wsl 访问外网不通

先打开wsl, 然后连接VPN, 再然后用下面的命令

If you are using Cisco AnyConnect VPN, Open a PowerShell with Administrator rights after connecting to the VPN.
Run the command

Get-NetAdapter | Where-Object {$_.InterfaceDescription -Match "Cisco AnyConnect"} | Set-NetIPInterface -InterfaceMetric 6000

这个方法只支持window store商店里发布的linux, 对于自己导入的wsl image不生效.
metric越大, 优先级越低

域名解析服务器的问题,检查/etc/resolv.conf

chattr +i /etc/resolv.conf chattr保护此文件不可修改 不可删除
yum install e2fsprogs

连接VPN后, 域网络通了, 本机又不通了

换行符问题

https://code.visualstudio.com/docs/remote/troubleshooting#_resolving-git-line-ending-issues-in-wsl-resulting-in-many-modified-files
https://git-scm.com/docs/gitattributes
创建一个.gitattributes文件

* text=auto eol=lf
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf

git config --global core.autocrlf input

posted @ 2021-01-08 14:01  funny_coding  阅读(281)  评论(0编辑  收藏  举报
build beautiful things, share happiness