手机版
你好,游客 登录 注册
背景:
阅读新闻

Fedora 使用 VNC 远程 Fedora 28 主机

[日期:2018-08-09] 来源:cnblogs.com/xuyaowen  作者:xuyaowen [字体: ]

问题重述:

      最近环境中需要使用 Fedora 28 来进行远程桌面,于是就重新配置了一下 VNC 在这里面做一下记录。

过程:

  yum 安装: 工作机上安装 vncviewer 远程主机上安装: vncserver

      连接远程桌面:

              连接远程桌面很简单,只要使用 vncviewer 主机名:桌面号

➜  regular vncviewer 10.66.65.15:1

画面的大小,可以通过窗口来进行拖动。当然你也可以进行配置初始窗口的大小:

和vncviewer相关的文件在: HOME/.vnc/default.tigervnc HOME/.vnc/default.tigervncHOME/.vnc/x509_ca.pem  $HOME/.vnc/x509_crl.pem 三个文件中,具体关于 vncviewer 相关可以 查看 man 手册。

        配置vnc 服务器:

        配置vnc 稍微麻烦了一点,但是当你具备了很好的阅读文档的能力,相对就容易很多。

vncserver is used to start a VNC (Virtual Network Computing) desktop. vncserver is a Perl script which simplifies the process of starting an Xvnc server. It runs Xvnc with appropriate options and starts a window manager on the VNC desktop.

vncserver can be run with no options at all. In this case it will choose the first available display number (usually :1), start Xvnc with that display num‐ber, and start the default window manager in the Xvnc session. You can also specify the display number, in which case vncserver will attempt to start Xvnc with that display number and exit if the display number is not available. For example:

    vncserver :13

editing the file $HOME/.vnc/xstartup allows you to change the applications run at startup (but note that this will not affect an existing VNC session.)

  这段,主要是说 vncserver 是 perl 写的脚本,用来控制Xvnc server 的,默认的情况下 每运行一次,依次打开一个服务器,1,2,3,4.... 等。但是你也可以特殊指定 vncserver 13; 编辑 $HOME/.vnc/xstartup 文件,可以允许你改变 在启动时运行的软件。

      运行vncserver :

不同用户身份运行vncserver脚本后,使用 vncviewer 进入的桌面也不同。

vncserver :1

      如果你还没有口令,那么在第一次运行的时候需要运行口令。   

    重新设置远程运行口令: 可以使用 vncserver

[root@linuxmi ~]# vncpasswd
Password:

  修改启动运行程序:如前面所说的 xstartup 文件, 你可以再启动其他程序,随着远程桌面启动的时候

[root@linuxmi ~]# vim ~/.vnc/xstartup

      查看 vncserver 服务:

[root@linuxmi ~]# vncserver -list

TigerVNC server sessions:

X DISPLAY #    PROCESS ID
:4        21475
:1        18261

  关闭服务:

[root@linuxmi system]# vncserver -kill :1

      当然,你也可以通过 pid 使用 kill -9 来进行终止。

  相关配置文件:

 $HOME/.vnc/xstartup

/etc/tigervnc/vncserver-config-defaults

/etc/tigervnc/vncserver-config-mandatory

$HOME/.vnc/config

$HOME/.vnc/passwd

$HOME/.vnc/host:display#.log     

$HOME/.vnc/host:display#.pid

但是 vnc 支持单用户远程,支持多用户远程登录可以使用xrdp 来进行操作。

更多Fedora相关信息见Fedora 专题页面 https://www.linuxidc.com/topicnews.aspx?tid=5

Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx

本文永久更新链接地址https://www.linuxidc.com/Linux/2018-08/153423.htm

linux
相关资讯       VNC 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款