Windows10系统下的WSL+Ubuntu图形桌面配置

1. Windows下安装VcXsrv

 

2. WSL Ubuntu下安装xfce desktop
sudo apt-get install xfce4-terminal
sudo apt-get install xfce4

3. ~./bashrc末尾添加Display信息

export DISPLAY=:0.0
export LIBGL_ALWAYS_INDIRECT=1

执行下面命令,使修改生效配置
source ~/.bashrc

4. Windows上打开XLaunch
选择“Multiple Window”,Display number填写0。其他设置为默认

 

5. 在WSL Ubuntu中输入startxfce4可以启动Ubuntu桌面。

修改 WSL Ubuntu 18.04 默认源为阿里云镜像

Win10 Windows Store 中下载的 WSL Ubuntu 18.04 默认的源 apt install 下载速度异常缓慢,想替换成国内阿里云的镜像源。

 

确认默认源

首先查看默认的源的地址

sudo vim /etc/apt/sources.list

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ bionic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://archive.ubuntu.com/ubuntu/ bionic universe
deb http://archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates universe

...

修改默认源

首先将原配置文件备份

sudo cp /etc/apt/sources.list /etc/apt/sources.list.20181013

然后 VIM 打开,替换

:%s/security.ubuntu/mirrors.aliyun/g
:%s/archive.ubuntu/mirrors.aliyun/g

更新

sudo apt update

再使用 apt install 速度就快多了