
WSL 入门笔记
Windows 10 升级到 1809 后 Windows Subsystem for Linux 已经相当成熟了。本文主体操作参考很不错的图文教程:玩转 WSL 并配置Linux下的开发调试环境。
但该教程在实际操作中有些坑,好不容易搞定了,记录如下。
换源
用 vi 打开的话很难将新的源放进去,不知道是 Bug 还是我不会用 vi,但无论如何打开 vi 进行编辑肯定不是最方便方法,至少不能跨版本适用,所以建议直接通过命令行替换:
sudo sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
sudo sed -i 's/security.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
sudo sed -i 's/http:/https:/g' /etc/apt/sources.list
上面是换成中科大的源,当然还可以换成清华的,163的,阿里的,看个人爱好。
虽然 vi 打开只能看到 archive.ubuntu.com 但如果没有第二行将 security.ubuntu.com 也替换掉,很快将报错。
第三行使用加密网络防止运营商搞鬼。
然后执行更新命令:
sudo apt update
sudo apt upgrade
安装图形界面
sudo apt-get install xrdp
sudo apt-get install xubuntu-desktop
这两行命令没有问题,但切记要将 xrdp 默认的 3389 端口改成自定义的,如 3390:
sudo sed -i 's/3389/3390/g' /etc/xrdp/xrdp.ini
否则远程桌面将无法连接,网上查了很久才发现是端口冲突的原因,坑爹的微软错误提示。
如上修改后再启动服务:
echo xfce4-session >~/.xsession
sudo service xrdp restart
现在远程桌面连接时,计算机一栏应填写:127.0.0.1:3390。
顺便一提,开头的知乎教程最后用 PyCharm 配置 SSH 远程环境本身没错,但需要 PyCharm 专业版,免费的社区版至少在目前最新的 2018.3.2 版中还没有这个功能。
Leave WSL 入门笔记 to:
Read more #cn posts
Best Posts From ivysrono
We have not curated any of ivysrono's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.