Closed chendelin1982 closed 1 year ago
为VNC设置桌面环境
vim ~/.vnc/xstartup
内容如下:
#!/bin/sh
unset SESSION_MANAGER
#unset DBUS_SESSION_BUS_ADDRESS #测试中发现如果去掉该行注释 桌面不会出现
export XKL_XMODMAP_DISABLE=1
export XDG_CURRENT_DESKTOP="GNOME-Flashback:GNOME"
export XDG_MENU_PREFIX="gnome-flashback-"
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey #设置背景色
vncconfig -iconic &
gnome-terminal & #连接后会直接打开一个terminal窗口
nautilus & #连接后会直接打开一个文件窗口
gnome-session --session=gnome-flashback-metacity --disable-acceleration-check &
增加xstartup文件执行权限:
sudo chmod +x ~/.vnc/xstartup
背景: 目前有 Gnome,KDE, MATE, Xfce 4种桌面,CentOS已经全部通过测试。 Ubuntu Gnome, MATE, Xfce 4 通过了测试,目前只有KDE未通过测试。
KDE 发展到现在,kde-plasma-desktop是目前的最新版本,所有我们认为如下两个桌面都是可行的,优先kde-plasma-desktop Install by
sudo apt install kde-full
```
sudo apt install kde-plasma-desktop
```
按照目前的安装方式,远程xrdp是ok的,vnc可以连接但是灰屏。可能是连接时,无法找到对应的桌面,需要配置启动的plasma桌面?
通过shell脚本解决,不需要使用ansible: ubuntu 下kde-plasma-desktop 的vnc连接灰屏问题。
I can login by VNC but desktop is gray