Centos 7 VNC Remote Desktop Cannot Connect To Entity Session

On Centos 7, if you implement remote desktop using Tigervnc or XRDP, there is a problem: The local connection to the remote server is not the user session that the physical machine is currently logged in, but a new and isolated session. So what do we need to do to connect to the entity session, what should we do? X11vnc! It can help us achieve this.

centos 7 x11vnc remote desktop

Centos 7 VNC Remote Desktop Cannot Connect To Entity Session

Install

# yum -y install x11vnc

Set Password

# x11vnc -storepasswd

Enter VNC password:

Verify password:

Write password to /root/.vnc/passwd? [y]/n y

Password written to: /root/.vnc/passwd

Setting x11vnc Startup

  1. Create a new startVnc.sh file
    # touch /etc/rc.d/init.d/startVnc.sh
  2. Edit the startVnc.sh file
    # vim /etc/rc.d/init.d/startVnc.sh
  3. Add the following content, save and exit
    #!/bin/bash
    #chkconfig: 345 88 14
    nohup x11vnc --reopen --forever -rfbauth ~/.vnc/passwd &
  4. Create a new startVnc.service file
    # touch /usr/lib/systemd/system/startVnc.service
  5. Edit the startVnc.service file
    # vim /usr/lib/systemd/system/startVnc.service
  6. Add the following content, save and exit
    [Unit]
    Description=start vnc service
    Requires=graphical.target
    After=graphical.target
    [Service]
    Type=forking
    User=root
    Group=root
    Restart=always
    TimeoutSec=5
    IgnoreSIGPIPE=no
    KillMode=process
    GuessMainPID=no
    RemainAfterExit=no
    ExecStart=/etc/rc.d/init.d/startVnc.sh
    [Install]
    WantedBy=graphical.target
  7. Setting x11vnc startup
    # systemctl enable /usr/lib/systemd/system/startVnc.service
  8. Reboot
    # reboot
  9. Check if x11vnc is successfully started
    # netstat -anp | grep 5900

Configuration completed

Now, try connecting to this server with other vnc clients. How about? Is it successful?

0 0 votes
Article Rating
赞(0) 打赏
未经允许不得转载:iemblog » Centos 7 VNC Remote Desktop Cannot Connect To Entity Session
Subscribe
Notify of
guest

0 COMMENTS
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
免责声明:本站大部分下载资源收集于网络,只做学习和交流使用,版权归原作者所有,请在下载后24小时之内自觉删除,若作商业用途,请购买正版,由于未及时购买和付费发生的侵权行为,与本站无关。本站发布的内容若侵犯到您的权益,请联系站长删除,我们将及时处理! Disclaimer: Most of the download resources on this site are collected on the Internet, and are only used for learning and communication. The copyright belongs to the original author. Please consciously delete within 24 hours after downloading. If you use it for commercial purposes, please purchase the original version. If the content posted on this site violates your rights, please contact us to delete it, and we will deal with it in time!

联系我们 Contact us

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏

0
Would love your thoughts, please comment.x
()
x