win11 WSL 运行 Linux GUI 应用

操作前最好对windows做一下检查更新(省的遇到问题怀疑是版本问题),注意现在的版本中直接就能使用gui程序,不需要安装vcxsrv(x-server)之类的东西。deepseek等AI给出的方案比较老,不太合适。

  • 我的环境信息
    系统版本信息

步骤

安装并更新WSL

WSL 版本信息

安装Ubuntu 20.04

wsl --install -d Ubuntu-24.04

安装完成之后换一下源,/etc/apt/sources.list

deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

更新一下源

sudo apt update

安装一个带GUI的程序

参考微软官方示例

sudo apt install gnome-text-editor -y

运行程序遇到问题

遇到的问题

解决办法

参考微软社区

sudo apt install libgles2

效果展示

效果展示

posted @ 2025-06-06 11:09  周文靖  阅读(186)  评论(0)    收藏  举报