天天看點

建立x11vnc系統程序

〇、前言

為友善使用vnc,是以尋找到一個比較好用的vnc服務端那就是x11vnc,索性就建立了一個系統程序

一、環境

系統:銀河麒麟v4-sp2-server

軟體:x11vnc【linux下】、VNCviewer【win下】

二、安裝x11vnc

1、挂載CD光牒源并修改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連接配接如下

建立x11vnc系統程式

繼續閱讀