【问题标题】:How to configure vnc server in linux (Cent OS7)?如何在 linux (Centos 7) 中配置 vnc 服务器?
【发布时间】:2017-04-17 19:51:57
【问题描述】:

如何在 Linux (Cent OS7) 服务器中配置 vnc 服务器以从 windows 和 Linux 机器访问。

我尝试过使用 Tiger VNC,但每次重新启动系统后它都无法正常工作。请推荐Tiger VNC以外的其他方法。

【问题讨论】:

标签: linux centos vnc-server


【解决方案1】:

给出在 centOs 中安装和配置 VNC 服务器的步骤:

  1. ~]# yum install tigervnc-server
  2. ~]# cp /usr/lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
  3. ~]# vim /etc/systemd/system/vncserver@:1.service

在此文件中将 USER 替换为 riddhi

ExecStart=/usr/sbin/runuser -l USER -c "/usr/bin/vncserver %i -geometry 1280x1024"
PIDFile=/home/USER/.vnc/%H%i.pid
  1. ~]# systemctl daemon-reload
  2. ~]# su - riddhi
  3. ~]$ vncpasswd //update password for user riddhi
  4. ~]# systemctl start vncserver@:1.service
  5. ~]# systemctl enable vncserver@:1.service

现在从 Windows 连接到 centO:

  1. IP:ip address:5901

  2. 密码:password of vncpasswd

【讨论】:

    【解决方案2】:

    从您的措辞来看,Tiger VNC 在您重新启动之前似乎工作正常。这是因为该服务未设置为自动启动 VNC。

    按照找到的指南 here(特别是第 3 步),您将编写自己的 .service 文件,您需要做的就是运行:

    sudo systemctl enable whateveryoucalledyour.service

    每次开机都会自动启动。

    【讨论】:

      猜你喜欢
      • 2014-12-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多