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

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

相关推荐
正在努力的小河42 分钟前
Linux设备树简介
linux·运维·服务器
荣光波比44 分钟前
Linux(十一)——LVM磁盘配额整理
linux·运维·云计算
LLLLYYYRRRRRTT1 小时前
WordPress (LNMP 架构) 一键部署 Playbook
linux·架构·ansible·mariadb
轻松Ai享生活1 小时前
crash 进程分析流程图
linux
大路谈数字化3 小时前
Centos中内存CPU硬盘的查询
linux·运维·centos
luoqice4 小时前
linux下查看 UDP Server 端口的启用情况
linux
倔强的石头_5 小时前
【Linux指南】动静态库与链接机制:从原理到实践
linux
赏点剩饭7785 小时前
linux中的hostpath卷、nfs卷以及静态持久卷的区别
linux·运维·服务器
神鸟云5 小时前
DELL服务器 R系列 IPMI的配置
linux·运维·服务器·网络·边缘计算·pcdn
herderl5 小时前
**僵尸进程(Zombie Process)** 和**孤儿进程(Orphan Process)**
linux·运维·服务器·网络·网络协议