OpenEuler安装远程桌面登录 VNC和GNOME的安装
OpenEuler安装远程桌面登录 VNC和GNOME的安装
参考文献
https://blog..net/weixin_43873801/article/details/108889967 https://bbs.huaweicloud.com/forum/thread-92796-1-1.html
安装GNOME桌面
添加软件源
vi /etc/yum.repos.d/openEuler.repo
在后面添加一下软件源地址
[base] name=base baseurl=https://repo.openeuler.org/openEuler-20.03-LTS/OS/x86_64/ enabled=1 gpgcheck=0
yum makecache
显示Metadata cache created就是成功了
开始安装
yum install gnome-shell gdm gnome-session gnome-terminal -y
设置GNOME桌面自启&修改启动级别
systemctl enable gdm.service systemctl set-default graphical.target
注意:如遇到了下面图片中的状况,加多一个步骤,把之前的图形化系统给修改掉! #因为我之前安装了ukui的图形化系统,所以会出现这种启动失败的情况,后面我把/etc/systemd/system/下的display-manager.service修改成display-manager.service.bak问题就解决了
Failed to enable unit: File /etc/systemd/system/display-manager.service already exists and is a symlink to /usr/lib/systemd/system/lightdm.service.
mv /etc/systemd/system/display-manager.service /etc/systemd/system/display-manager.service.bak
再执行
systemctl enable gdm.service
重启之后即可进入到GNOME系统中
reboot
安装VNC远程登录服务
安装VNC组件&xined守护服务
yum install -y xinetd yum install -y tigervnc-server-minimal
配置VNC守护服务
cat > /etc/xinetd.d/vncserver0 << EOF service vncserver0 { disable = no socket_type = stream protocol = tcp wait = no user = root server = /usr/bin/Xvnc server_args = -inetd -query localhost -geometry 1280x800 -depth 24 -once -fp unix/:7100 -securitytypes=none } EOF
配置GDM服务
cat > /etc/gdm/custom.conf << EOF # GDM configuration storage [daemon] # Uncomment the line below to force the login screen to use Xorg WaylandEnable=false [security] DisallowTCP=fals AllowRemoteRoot=true [xdmcp] Enable=true [chooser] [debug] # Uncomment the line below to turn on debugging #Enable=true EOF
sed -i /^vncserver0/d /etc/services cat >> /etc/services << EOF vncserver0 5900/tcp # VNC & GDM EOF
重启操作系统,使配置生效
reboot
查看验证服务是否在运行
查看监听
netstat -nlpt
5900端口在运行,已完成以上配置
查看Seliunx&Iptables&Firewalld状态
查看Seliunx状态
getenforce
如果是"Enforcing" 请输入
setenforce 0 sed -i s/^SELINUX=.*/SELINUX=permissive/g /etc/selinux/config
查看Iptables状态
systemctl status iptables
如在运行执行以下命令 永久关闭 #生产环境下勿使用该操作
systemctl stop iptables chkconfig iptables off
查看firewalld状态
systemctl status firewalld
如在运行执行以下命令 永久关闭 #生产环境下勿使用该操作
systemctl stop firewalld chkconfig firewalld off
使用VNC软件进行远程登录桌面
下载VNC远程登录桌面软件地址
https://www.realvnc.com/en/connect/download/viewer/
连接操作
VNC Server:VNC Server IP Address
Name:自定义名字
配置以上两项信息,即可完成登录
如登录不上,请检查VNC/GNOME服务是否安装正确,Seliunx/Firewalld/iptables是否关闭状态或者是放行状态!