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

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

相关推荐
Sleepy MargulisItG1 分钟前
Linux 基础开发工具详解(Yum, Vim, GCC, Make, GDB, Git)
linux·git·vim
猫豆~6 小时前
软件包管理——2day
linux·运维
大白菜13249 小时前
进程的信号
linux
XH-hui9 小时前
【打靶日记】群内靶机Secure
linux·网络安全
Shingmc39 小时前
【Linux】进程控制
linux·服务器·算法
视觉装置在笑7139 小时前
Shell 变量基础与进阶知识
linux·运维
Web极客码10 小时前
如何通过命令行工具检查 Linux 版本信息
linux·运维·服务器
欢鸽儿10 小时前
Vitis】Linux 下彻底清除启动界面 Recent Workspaces 历史路径
linux·嵌入式硬件·fpga
繁华似锦respect11 小时前
C++ 智能指针底层实现深度解析
linux·开发语言·c++·设计模式·代理模式
hweiyu0012 小时前
Linux 命令:dd
linux