deepin安装vnc服务

测试环境

  • deepin 20.3, deepin 20.9

安装x11vnc

sudo apt install x11vnc

设置x11vnc密码

  • 设置密码
    x11vnc -storepasswd
  • 复制到系统目录
    sudo mv ~/.vnc/passwd /etc/x11vnc.pwd

创建服务

sudo vim /etc/systemd/system/x11vnc.service

[Unit]
Description=Remote desktop service (VNC)
Requires=display-manager.service
After=display-manager.service
 
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth guess -forever -rfbauth /etc/x11vnc.pwd -rfbport 5900 -shared
ExecStop=/usr/bin/killall x11vnc
 
[Install]
WantedBy=multi-user.target

启动服务

  • 刷新服务配置
    sudo systemctl daemon-reload
  • 启动服务
    sudo systemctl restart x11vnc
  • 服务设置为自启动
    sudo systemctl enable x11vnc

查看服务状态

启动成功见以下提示
sudo systemctl status x11vnc

● x11vnc.service - Remote desktop service (VNC)
   Loaded: loaded (/etc/systemd/system/x11vnc.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2022-01-14 23:48:25 CST; 6s ago
 Main PID: 10169 (x11vnc)
    Tasks: 1 (limit: 4915)
   Memory: 6.1M
   CGroup: /system.slice/x11vnc.service
           └─10169 /usr/bin/x11vnc -auth guess -forever -rfbauth /etc/x11vnc.pwd -rfbport 5900 -shared

1月 14 23:48:29 john-PC x11vnc[10169]: 14/01/2022 23:48:29
1月 14 23:48:29 john-PC x11vnc[10169]: The VNC desktop is:      john-PC:0
1月 14 23:48:29 john-PC x11vnc[10169]: PORT=5900
1月 14 23:48:29 john-PC x11vnc[10169]: ******************************************************************************
1月 14 23:48:29 john-PC x11vnc[10169]: Have you tried the x11vnc '-ncache' VNC client-side pixel caching feature yet?
1月 14 23:48:29 john-PC x11vnc[10169]: The scheme stores pixel data offscreen on the VNC viewer side for faster
1月 14 23:48:29 john-PC x11vnc[10169]: retrieval.  It should work with any VNC viewer.  Try it by running:
1月 14 23:48:29 john-PC x11vnc[10169]:     x11vnc -ncache 10 ...
1月 14 23:48:29 john-PC x11vnc[10169]: One can also add -ncache_cr for smooth 'copyrect' window motion.
1月 14 23:48:29 john-PC x11vnc[10169]: More info: http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching

使用vnc viewer远程

posted @ 2020-05-21 09:53  jiftle  阅读(6011)  评论(0编辑  收藏  举报