阿里云服务器远程桌面安装
环境说明: CentOS 8.3
一、安装桌面环境
root用户下执行命令:
yum grouplist
yum groupinstall -y "Server with GUI"
成功安装桌面包后,运行下列命令启用图形模式:
systemctl set-default graphical
reboot
二、安装VNC Server
安装tigerVNC
yum install -y tigervnc-server
配置
修改配置文件/etc/tigervnc/vncserver.users, 按照说明添加用户映射。
修改配置文件/etc/tigervnc/vncserver-config-defaults, 添加session=gnome选项(如果使用gnome桌面)
设置vnc远程密码,切换到vnc用户下执行 vncpasswd
命令
启动
systemctl start vncserver@:x.service
把x替换成用户映射中的相关数字。
服务启动成功后, 使用客户端VNC-viewer连接服务器。
服务器端口号一般为5900+x, 具体可以使用命令netstat -ant查看。
报错“Cannot open display”
By default, CentOS 8 uses Wayland as the default X server. For the VNC logins to work, you need to force the login screen to use Xorg server by uncommenting the line #WaylandEnable=false, on the /etc/gdm/custom.conf configuration file.
sed -i 's/#WaylandEnable/WaylandEnable/' /etc/gdm/custom.conf
然后重启使生效
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)