
WSL2 使用VcXsrv图形界面
WSL
Issues found on WSL
项目地址:https://gitcode.com/gh_mirrors/ws/WSL
·
文章目录
前言
xfce4是一个轻量级的类Unix的桌面系统,提供桌面环境;
VcXsrv/Xming提供图形界面,使在windows子系统wsl里的操作能够图形化显示.
一、Ubuntu环境下
1.安装Xfce4桌面环境,在Ubuntu终端运行一下命令
sudo apt update && sudo apt upgrade -y
sudo apt install xfce4
sudo apt-get install xfce4 xfce4-goodies
注:安装的时候选择gdm3即可
二、windows环境下
1.安装VcXsrv Windows X Server
下载地址:https://sourceforge.net/projects/vcxsrv/files/latest/download
安装步骤:

可选安装位置,安装即可

二、运行GUI桌面
1.windows下运行XLaunch程序
选择如下:
(1).Display settings: One large window,display number -1表示显示器从0开始排序。

(2).How to start clients: Start no client

(3).Disable access control: Yes Disable access control ,这是允许所有客户程序都能连接这个 VcXsrv。

4)完成配置

然后window下会出现VcXsrv 的黑色窗口,里面没有内容。

注:以后每次启动都要对以上前三步进行配置,比较麻烦。
解决方案:在第四步里,点击“Save configuration”按钮,将配置信息保存为*.xlaunch文件,以后启动时,双击这个文件,可以直接打开窗口无需配置。
2.ubuntu下启动桌面GUI
(1)在Ubuntu终端输入
export DISPLAY=10.25.3.2 :0
此处10.25.3.2需要查看windows IP地址,改为这个地址;
具体操作 win+r,输入ipconfig即可查看
(2)重新加载配置文件
source ~/.bashrc
(3)启动xfce4
// A code block
var foo = 'bar';
startxfce4
此时先前的黑色窗口会出现桌面GUI

Issues found on WSL
最近提交(Master分支:6 个月前 )
8c61f09e
* Add super user detection; a powershell approach is used
* use the 'id' command
* avoid stderr warning & wsl alias 1 个月前
ae780d11
1 个月前
更多推荐




所有评论(0)