VcXsrv设置
![](https://img.haomeiwen.com/i9009376/43f47f193c63b6f4.png)
![](https://img.haomeiwen.com/i9009376/79bfc65aefcbd697.png)
![](https://img.haomeiwen.com/i9009376/8867b30932bd5cda.png)
- 勾选Disable access control
- 如果有两个显示器的化需要按照图片中的Additional parameters设置:
-nodecoration -wgl -multimonitors -screen 0 3840x1080
点击Save configuration另存为multi.xlaunch
- 点击Save configuration另存为multi.xlaunch
编写直接开启Xfce4的脚本
在你喜欢的位置创建ubuntu.bat,需要与multi.xlaunch同一路径
在ubuntu.bat中输入:
.\multi.xlaunch
ubuntu1804.exe run "export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0;cd /home/jwfeng/;export LIBGL_ALWAYS_INDIRECT=1; xrandr --fb 3840x1042;xrandr --setmonitor VIRT-LEFT 1920/406x1042/220+0+0 default; xrandr --setmonitor VIRT-RIGHT 1920/406x1042/220+1920+0 none; startxfce4 > ~/.xfce4.log 2>&1
这样就可以利用xrandr在VcXsrv中建立两个虚拟显示器,具体的分辨率设置可以在WSL中通过xrandr命令查看:
![](https://img.haomeiwen.com/i9009376/c78136c41cda7565.png)
分屏效果与windows类似,可以在两个显示器之间拖动窗口。
![](https://img.haomeiwen.com/i9009376/bbf503afe0ee831a.png)
网友评论