创建x11vnc系统进程

〇、前言

为方便使用vnc,所以寻找到一个比较好用的vnc服务端那就是x11vnc,索性就创建了一个系统进程

一、环境

系统:银河麒麟v4-sp2-server

软件:x11vnc【linux下】、VNCviewer【win下】

二、安装x11vnc

1、挂载光盘源并修改apt源

mount /dev/sr0 /mnt

vim /etc/apt/sources.list
deb [trusted=yes] file:///mnt juniper main

apt update

2、安装x11vnc

apt install x11vnc -y
# 到此就可以手动启动x11vnc了,可直接在终端执行x11vnx或者使用nohup后台运行

三、创建x11vnc系统进程

1、创建配置文件

vim /etc/systemd/system/x11vnc.service
[Unit]
Description=start x11vnc
After=syslog.target network.target

[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth guess
[Install]
WantedBy=multi-user.target

2、保存配置并设置开机启动

systemctl daemon-reload
systemctl enable x11vnc.service

四、查看使用

systemctl start x11vnc.service

root@Kylin:~# systemctl status x11vnc
● x11vnc.service - start x11vnc
   Loaded: loaded (/etc/systemd/system/x11vnc.service; enabled; vendor preset: enabled)
   Active: active (running) since 四 2021-09-16 21:52:30 CST; 2min 42s ago
 Main PID: 7708 (x11vnc)
   CGroup: /system.slice/x11vnc.service
           └─7708 /usr/bin/x11vnc -auth guess

9月 16 21:52:44 Kylin x11vnc[7708]: 16/09/2021 21:52:44 rfbProcessClientNormalMessage: ignoring unsupported encoding type
9月 16 21:52:44 Kylin x11vnc[7708]: 16/09/2021 21:52:44 Enabling full-color cursor updates for client 192.168.200.1
9月 16 21:52:44 Kylin x11vnc[7708]: 16/09/2021 21:52:44 Enabling NewFBSize protocol extension for client 192.168.200.1
9月 16 21:52:44 Kylin x11vnc[7708]: 16/09/2021 21:52:44 Switching from ZRLE to hextile Encoding for client 192.168.200.1
9月 16 21:52:44 Kylin x11vnc[7708]: 16/09/2021 21:52:44 client 1 network rate 1433.2 KB/sec (27867.9 eff KB/sec)
9月 16 21:52:44 Kylin x11vnc[7708]: 16/09/2021 21:52:44 client 1 latency:  0.5 ms
9月 16 21:52:44 Kylin x11vnc[7708]: 16/09/2021 21:52:44 dt1: 0.0183, dt2: 0.0284 dt3: 0.0005 bytes: 66670
9月 16 21:52:44 Kylin x11vnc[7708]: 16/09/2021 21:52:44 link_rate: LR_LAN - 1 ms, 1433 KB/s
9月 16 21:52:53 Kylin x11vnc[7708]: 16/09/2021 21:52:53 created selwin: 0x2c00032
9月 16 21:52:53 Kylin x11vnc[7708]: 16/09/2021 21:52:53 called initialize_xfixes()
lines 1-17/17 (END)

win下使用VNCviewer连接如下

image-20210916220052919

image-20210916220108657

image-20210916220125174

完成!收工

posted @ 2021-09-16 22:06  带着泥土  阅读(736)  评论(0编辑  收藏  举报