openEuler配置vnc

环境:
OS:oe2203sp4

1.安装DDE桌面环境
[root@hxl ~]# dnf -y install dde
[root@hxl ~]# systemctl set-default graphical.target
[root@hxl ~]# reboot

 

2.安装vnc
[root@hxl ~]#dnf install tigervnc-server -y

 

3.关闭防火墙
systemctl status firewalld.service
systemctl stop firewalld.service
systemctl disable firewalld.service
vi /etc/selinux/config
set "SELINUX=disabled" and comment the rest lines.

 

4.添加用户

[root@cos8 yum.repos.d]# vi /etc/tigervnc/vncserver.users
# TigerVNC User assignment
#
# This file assigns users to specific VNC display numbers.
# The syntax is <display>=<username>. E.g.:
#
# :2=andrew
# :3=lisa
:1=oracle

 

5.修改

[root@19c ~]# more /etc/tigervnc/vncserver-config-defaults
## Default settings for VNC servers started by the vncserver service
#
# Any settings given here will override the builtin defaults, but can
# also be overriden by ~/.vnc/config and vncserver-config-mandatory.
#
# See HOWTO.md and the following manpages for more details:
#     vncsession(8) Xvnc(1)
#
# Several common settings are shown below. Uncomment and modify to your
# liking.

# session=gnome
# securitytypes=vncauth,tlsvnc
# geometry=2000x1200
# localhost
# alwaysshared
session=gnome

 

6.配置VNC密码
su - oracle
[oracle@cos8 ~]$ vncpasswd
Password:
Verify:
Would you like to enter a view-only password (y/n)? y
Password:
Verify:

 

7.修改文件,加入如下内容

su - oracle
vi /home/oracle/.vnc/xstartup

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
exec dbus-launch startdde &

 

8.启动服务

发现启动失败,需要重启服务后再次启动才能成功.
[root@cos8 yum.repos.d]#systemctl start vncserver@:1
[root@cos8 yum.repos.d]#systemctl status vncserver@:1

 

9.查看端口是否启动

[root@19c ~]# ss -nlp|grep 5901
tcp   LISTEN 0      5                                         0.0.0.0:5901             0.0.0.0:*     users:(("Xvnc",pid=2200,fd=6))                                             
tcp   LISTEN 0      5                                            [::]:5901                [::]:*     users:(("Xvnc",pid=2200,fd=7))

 

posted @ 2024-07-05 09:36  slnngk  阅读(12)  评论(0编辑  收藏  举报