zoukankan      html  css  js  c++  java
  • Linux下开启VNCserver服务(远程连接)

    Linux下开启VNCserver服务(远程连接)

    实验环境:centos6.8 
    可支持 linux连linux linux连Windows

    1、检查系统是否安装了vnc 和 vncserver, rpm -qa | grep vnc如果没有安装那就行自行下载安装(我这里用yum安装了,vncserver安装需要安装依赖包xorg-x11-fonts-misc)
    (1)安装vnc yum -y install vnc  
    (2)安装vncserver依赖包 yum -y install xorg-x11-fonts-misc
    (3)安装vncserver yum -y install tigervnc-server

    2、配置vncservers文件
    [root@oracle ~]# vim /etc/sysconfig/vncservers
    VNCSERVERS="1:root" (本行注释去掉并改为当前格式)
    VNCSERVERARGS[1]="-geometry 1024x768"(本行雷同上一个括号)

    3、配置xstartup文件
    编辑配置之前,需要使用vncserver命令创建默认配置文件
    [root@oracle ~]# vncserver
    输入口令:123456 (密码要求最少六位)
    确认口令:123456
    Linux下开启VNCserver服务(远程连接)
    [root@oracle ~]# vim /root/.vnc/xstartup
    gnome-session & set starting GNOME desktop (在最后增加这一行,表使用gnome界面,否则是xfce界面)
    然后保存退出:x
    Linux下开启VNCserver服务(远程连接)

    4、设置远程登录口令
    [root@oracle ~]# vncpasswd
    Password: 123456
    Verifu: 123456
    Linux下开启VNCserver服务(远程连接)

    5、启动vncserver服务  
    (1)主服务器启动 service vncserver start
    Linux下开启VNCserver服务(远程连接)

    (2)启动多个界面(如果只要一界面,这步可省略)
    [root@oracle ~]# vncserver :2 (启动root登录的第二个界面)
    Linux下开启VNCserver服务(远程连接)

    6、停止vncserver服务
    service vncserver stop(停止start时候所启动的界面:1,其它另启的界面:2不停止)
    vncserver -kill :1 (停止某个界面,要用kill命令来杀掉界面1的进程)
    vncserver -kill :2 (停止某个界面,要用kill命令来杀掉界面2的进程)
    注:通过 #service vncserver status 命令可以查看出有多少个进程pid号,表示启动了多少个界面。
    7、让vncserver服务随机启动
    默认状态下,vncserver服务不是开机自动启动,需要手工启动。
    chkconfig --list vncserver
    Linux下开启VNCserver服务(远程连接)
    chkconfig vncserver on
    Linux下开启VNCserver服务(远程连接)
    保存后,重启测试。

    8、客户端登录vncserver服务
    (1)先安装vncviewer来远程登录,
    (2)然后在地址栏输入“主机地址:1”(即主机IP加界面号的方式)
    确定后输入登录口令。

    蓦然回首,那人却在,灯火阑珊处。
  • 相关阅读:
    Restart
    Tired
    Money,Right or Nation?
    End
    Cooperation
    【kooboo】代码块
    [kooboo]创建站点过程
    [kooboo] 使用 SQL Server 进行持久化 方法
    两种实现模式,还是选择2,少一层继承。
    读取进程内所有用户Session
  • 原文地址:https://www.cnblogs.com/linux-186/p/14216984.html
Copyright © 2011-2022 走看看