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

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

相关推荐
cws2004012 分钟前
SQL Server 2008 群集配置指南(Windows 2008)-1
windows
序属秋秋秋16 分钟前
《Linux系统编程之开发工具》【实战:倒计时 + 进度条】
linux·运维·服务器·c语言·c++·ubuntu·系统编程
刘某的Cloud3 小时前
ceph osd down排查
linux·运维·ceph·系统·osd
安审若无8 小时前
图数据库neoj4安装部署使用
linux·运维·数据库
做运维的阿瑞8 小时前
CentOS DNS故障排查完整解决方案:从症状到根因的系统化诊断
linux·运维·centos
天地之于壹炁兮9 小时前
编程I/O入门指南:核心操作全解析
数据库·windows·microsoft
QT 小鲜肉9 小时前
【个人成长笔记】在 Linux 系统下撰写老化测试脚本以实现自动压测效果(亲测有效)
linux·开发语言·笔记·单片机·压力测试
深圳市恒讯科技9 小时前
英国服务器Windows系统远程桌面安装与优化
运维·服务器·windows
itachi-uchiha9 小时前
head和tail命令使用
linux·运维·服务器
馨谙10 小时前
SELinux 故障排除完全指南:从拒绝访问到快速修复
linux