openEuler-22.03-LTS 怎么安装x11vnc

openEuler-22.03-LTS 怎么安装x11vnc 有安装成功的么大神么 知道一下小白 谢谢了!!!

使用tigerVNC

1.下载vnc server:
[root@localhost bshang]# wget https://downloads.realvnc.com/download/file/vnc.files/VNC-Server-6.11.0-Linux-x64.rpm
–2023-12-27 14:08:00-- https://downloads.realvnc.com/download/file/vnc.files/VNC-Server-6.11.0-Linux-x64.rpm
Resolving downloads.realvnc.com (downloads.realvnc.com)… 65.8.161.81, 65.8.161.36, 65.8.161.14, …
Connecting to downloads.realvnc.com (downloads.realvnc.com)|65.8.161.81|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 14228028 (14M) [application/x-redhat-package-manager]
Saving to: ‘VNC-Server-6.11.0-Linux-x64.rpm’

VNC-Server-6.11.0-Linux-x64.rpm 100%[===================================================================================>] 13.57M 8.54MB/s in 1.6s

2023-12-27 14:08:03 (8.54 MB/s) - ‘VNC-Server-6.11.0-Linux-x64.rpm’ saved [14228028/14228028]

2.安装vnc server:
[root@localhost bshang]# rpm -ivh VNC-Server-6.11.0-Linux-x64.rpm
error: Failed dependencies:
xterm is needed by realvnc-vnc-server-6.11.0.47988-1.x86_64

3.安装vnc server的依赖:
[root@localhost bshang]# yum install xterm
Last metadata expiration check: 3:24:52 ago on Wed 27 Dec 2023 10:43:40 AM CST.
Dependencies resolved.

  1. 配置文件:/root/.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 &
fi

5:启动vnc server:
[root@localhost ~]# vncserver :1

WARNING: vncserver has been replaced by a systemd unit and is now considered deprecated and removed in upstream.
Please read /usr/share/doc/tigervnc/HOWTO.md for more information.

You will require a password to access your desktops.

Password:
Verify:
Would you like to enter a view-only password (y/n)? n
A view-only password is not used

New ‘localhost.localdomain:1 (root)’ desktop is localhost.localdomain:1

Creating default startup script /root/.vnc/xstartup
Creating default config /root/.vnc/config
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:1.log

6:使用vnc viewer进行链接其中vnc server的地址为:server ip:1

1 个赞

在 [openeuler 版本:24.03 LTS] 上以此方法安装失败,第4步找不到配置文件,新建配置文件后,第5步运行找不到命令。

今天tigervnc,进去黑屏,没招了 ,22.03

#复制vnc软件包到/root/tool/目录

cd /root/tool/vncrpm/
rpm -ivh xorg-x11-fonts-others-7.5-24.oe1.noarch.rpm 
rpm -ivh tigervnc-*.rpm --force --nodeps
cd /home/docker/
mkdir .vnc
chown -R docker:docker .vnc

# 启动文件内容
cat > /home/docker/.vnc/xstartup << EOF
#!/bin/bash
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 &
EOF

#修改权限
sudo chmod 777 .vnc/xstartup

su - docker -c "vncpasswd"

# 启动 docker的vnc服务
su - docker -c "vncserver -geometry 1440x900 :2"


systemctl stop firewalld.service
systemctl disable firewalld.service



#root账号添加vnc功能配置。

cat /root/.vnc/xstartup


#!/bin/sh

unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS

xrdb $HOME/.Xresources
#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 &