欧拉系统中启用vncserver

在欧拉系统中需要使用vncserver的话,可以考虑安装tigervnc-server,具体操作步骤如下:

yum install tigervnc-server

然后修改.vnc/xstartup文件,在原有的基础上添加一部分内容,最终xstartup文件的完整内容如下:

#!/bin/sh

unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS

# Enable Fcitx Input Environment
export GTK_IM_MODULE="fcitx"
export QT_IM_MODULE="fcitx"
export XMODIFIERS="@im=fcitx"
fcitx-autostart &
# Launch the UKUI Desktop
lightdm &
ukui-session &
/etc/X11/xinit/xinitrc
# Assume either Gnome will be started by default when installed
# We want to kill the session automatically in this case when user logs out. In case you modify
# /etc/X11/xinit/Xclients or ~/.Xclients yourself to achieve a different result, then you should
# be responsible to modify below code to avoid that your session will be automatically killed
if [ -e /usr/bin/gnome-session ]; then
    vncserver -kill $DISPLAY
fi

此外需要修改一下安全配置,例如:

关闭防火墙:

systemctl stop firewalld.service
systemctl disable firewalld.service

关闭selinux:

setenforce 0
sed -i ‘s/^SELINUX=enforcing.*/SELINUX=disabled/’ /etc/selinux/config

如果是使用的dde,可以考虑换成如下的xstartup文件,笔者实际测试,桌面没有图标但是可以启动终端,由终端启动各种应用:

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
[-r $HOME/ .Xresources] && xrdb $HOME/ .Xresources
xsetroot -solid grep
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
#ukui-session & #ukui桌面(没有做验证)
exec dbus-launch startdde & #dde桌面
/etc/X11/xinit/xinitrc
# Assume either Gnome will be started by default when installed
# We want to kill the session automatically in this case when user logs out. In case you modify
# /etc/X11/xinit/Xclients or ~/.Xclients yourself to achieve a different result, then you should
# be responsible to modify below code to avoid that your session will be automatically killed
if [ -e /usr/bin/gnome-session ]; then
    vncserver -kill $DISPLAY
fi
此条目发表在Ubuntu, 其他分类目录,贴了, 标签。将固定链接加入收藏夹。

发表回复