windows wsl ubuntu系统安装桌面可视化

参考:

https://www.bilibili.com/read/cv33557374/

1)首先先安装好wsl ubuntu系统

2)安装 Ubuntu 桌面版

bash 复制代码
sudo apt purge -y acpid acpi-support modemmanager

sudo apt-mark hold acpid acpi-support modemmanager 

sudo apt install ubuntu-desktop 

3)配置显示管理器

安装 Xfce4 桌面环境:

bash 复制代码
sudo apt install xfce4 xfce4-goodies 

在 Ubuntu 终端中设置 DISPLAY 环境变量:

bash 复制代码
export DISPLAY=$(awk '/nameserver / {print$2; exit}' /etc/resolv.conf 2>/dev/null):0 

使用sudo 启动 Xfce 会话:

bash 复制代码
sudo startxfce4 

启动报错sudo startxfce4

/usr/bin/startxfce4: X server already running on display 127.0.0.42:0

xrdb: Connection refused

xrdb: Can't open display '127.0.0.42:0'

xfce4-session: Cannot open display: .

Type 'xfce4-session --help' for usage.sudo startxfce4

/usr/bin/startxfce4: X server already running on display 127.0.0.42:0

xrdb: Connection refused

xrdb: Can't open display '127.0.0.42:0'

xfce4-session: Cannot open display: .

Type 'xfce4-session --help' for usage.

修改:

如果输出为空或不正确,你可以手动设置 DISPLAY 变量:

bash 复制代码
export DISPLAY=:0

4)修改后重新启动

bash 复制代码
sudo startxfce4

桌面可以看到,但是背景是透明的

相关推荐
极客小张2 分钟前
基于正点原子Linux开发板的智能监控与家电控制系统设计:深度解析Video4Linux和TCP/IP技术栈
linux·运维·c++·物联网·网络协议·tcp/ip·算法
sunxunyong3 分钟前
Linux 删除文件不释放空间问题处理
大数据·linux·运维·服务器
只对您心动1 小时前
【C高级】有关shell脚本的一些练习
linux·c语言·shell·脚本
lldhsds1 小时前
linux下的分布式Minio部署实践
linux·minio·分布式对象存储
OH五星上将2 小时前
OpenHarmony(鸿蒙南向开发)——小型系统内核(LiteOS-A)【内核通信机制】上
linux·嵌入式硬件·harmonyos·openharmony·鸿蒙开发·liteos-a·鸿蒙内核
沈艺强3 小时前
伊犁linux 创建yum 源过程
linux·运维·服务器
拾光师3 小时前
linux命令行快捷键
linux·运维·服务器
Dola_Pan5 小时前
Linux文件IO(二)-文件操作使用详解
java·linux·服务器
城南云小白7 小时前
Linux网络服务只iptables防火墙工具
linux·服务器·网络
咩咩大主教7 小时前
C++基于select和epoll的TCP服务器
linux·服务器·c语言·开发语言·c++·tcp/ip·io多路复用