-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
拥抱 WSLg #47
Comments
直接卸载就完事, 如果卸载不掉, 可以试试我从知乎淘来的一个脚本 |
参考我之前这里的说明, WSLg环境依然有效, 主要就是用魔改的 |
后来定位到其实是 AMD 核显驱动的问题, 换 |
用这个工具关闭: dControl.zip 或者随便选择装一个安全软件, 比如 |
scoop reset * |
看这里: zsh-users/zsh-autosuggestions#238 (comment) # 粘贴到.zshrc再source一下即可
# This speeds up pasting w/ autosuggest
# https://github.com/zsh-users/zsh-autosuggestions/issues/238
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
}
pastefinish() {
zle -N self-insert $OLD_SELF_INSERT
}
zstyle :bracketed-paste-magic paste-init pasteinit
zstyle :bracketed-paste-magic paste-finish pastefinish |
|
据说自带的OpenSSH有问题,需要先卸后装 sudo apt remove openssh-server
sudo apt install openssh-server 修改 sshd 配置文件 Port 2222 #设置ssh的端口号, 由于22在windows中有别的用处, 尽量不修改系统的端口号
PermitRootLogin yes # 可以root远程登录
PasswordAuthentication yes # 允许密码验证登录
AllowUsers dancingline # 远程登录时的用户名 重启服务 sudo service ssh --full-restart Windows端口转发(保存为.ps1 后缀, 直接运行即可, 会自动申请管理员权限)
if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{
$arguments = "& '" +$myinvocation.mycommand.definition + "'"
Start-Process powershell -Verb runAs -ArgumentList $arguments
Break
}
# 找到WSL2的IP
$ip = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $ip -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ) {
$ip = $matches[0];
echo "Found IP $ip"
# 端口转发,listenport和listenaddress表示监听的端口和IP,connectport和connectaddress表示转发到的端口和IP
iex "netsh interface portproxy add v4tov4 listenport=2222 listenaddress=* connectport=2222 connectaddress=$ip";
# 展示已有的
iex "netsh interface portproxy show all;"
}
else { echo "The ip address of WSL2 cannot be found!"; } 完事以后就可以从局域网 or 外网直接 ssh 链接了 ssh root@x.x.x.x -p 2222 |
好了,我宣布WSLg就是个锤锤,投奔Linux怀抱
这里喷IO慢的仔细一看基本都是项目在Windows里, 然后 runtime 在 WSL, 这他喵跨着9p不卡才怪
解决方法也很简单, runtime IDE什么的一股脑统统丢 WSL 里不就完了, 啥? 嫌空间不够用? WSL挂载磁盘了解下? 直接就是原生磁盘IO的性能
PyCharm 全局搜索框调不出来或者一闪而逝此坑已填: https://youtrack.jetbrains.com/issue/IDEA-265390
这个issue里找到了神仙解法: 狂按快捷键, 直到全局搜索框出来为止, 然后 pin 住, 就欧了...方法是从CSDN淘的 , 装好
fcitx
后, 这段丢到bashrc 或 zshrc 或 profile 里, 然后启动GUI前运行fcitx-autostart
即可, 只需要运行一次老老实实按官方说明去装一下支持wslg的显卡驱动即可, 直观的感受是拖拽WSL的GUI应用窗口不会撕裂, 也明显不卡顿了, 纵享丝滑
后续的Windows更新可能会把装好的vGPU驱动替换成正常驱动, 从而导致WSLg GUI 应用丢掉 OpenGL 加速支持, 会显得比较卡, 暂时的解决办法是从组策略禁用Windows更新驱动程序
Win + R -> gpedit.msc -> 计算机配置 -> 管理模板 -> Windows组件 -> Windows更新 -> 管理从Windows更新提供的更新 -> Windows更新不包括驱动程序 -> 启用 -> 应用
这个也就是一个小脚本解决的事情, 以我常用的 proxychains(wsl中使用host代理) 为例
~
设置 -> Ubuntu -> 常规 -> 命令行 ->
wsl.exe -d Ubuntu-20.04 --cd ~
The text was updated successfully, but these errors were encountered: