zoukankan      html  css  js  c++  java
  • CentOS 6使用VNC配置远程桌面

    首先,配置vncservers(注意,rootW为1,普通用户按2,3以此类推)

    [root@hadoop1001 hadoop]# vi /etc/sysconfig/vncservers 
    # VNCSERVERS="2:myusername"
    # VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"
    VNCSERVERS="2:hadoop"
    VNCSERVERARGS[2]="-geometry 1420x868 -nolisten tcp -localhost"

    生成xstartup+设置vncpasswd

    [hadoop@hadoop1001 ~]$ vncpasswd
    Password:
    Verify:

    启动vncserver,生成xstartup

    [hadoop@hadoop1001 ~]$ vncserver
    
    Warning: hadoop1001:1 is taken because of /tmp/.X1-lock
    Remove this file if there is no X server hadoop1001:1
    xauth:  creating new authority file /home/hadoop/.Xauthority
    
    New 'hadoop1001:2 (hadoop)' desktop is hadoop1001:2
    
    Creating default startup script /home/hadoop/.vnc/xstartup
    Starting applications specified in /home/hadoop/.vnc/xstartup
    Log file is /home/hadoop/.vnc/hadoop1001:2.log
    
    [hadoop@hadoop1001 ~]$ 

    修改xstartup

    [hadoop@hadoop1001 ~]$ vi /home/hadoop/.vnc/xstartup
    #xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & #注释这两行 #twm & # 添加下面一行 gnome -session &

    配置防火墙,放行VNC端口:

    [root@hadoop1001 ~]# vi /etc/sysconfig/iptables
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 5901:5910 -j ACCEPT

    添加vncserver自启动

    [root@hadoop1001 ~]# chkconfig vncserver on

    启动vncserver

    [root@hadoop1001 ~]# /etc/init.d/vncserver restart
    Shutting down VNC server: 2:hadoop                         [  OK  ]
    Starting VNC server: 2:hadoop 
    New 'hadoop1001:2 (hadoop)' desktop is hadoop1001:2
    
    Starting applications specified in /home/hadoop/.vnc/xstartup
    Log file is /home/hadoop/.vnc/hadoop1001:2.log
    
                                                               [  OK  ]
  • 相关阅读:
    wso2 CEP集成storm实验
    mybatis的decimal精度缺失
    计算时间偏移量小工具
    Blob写入文件
    java父子进程通信
    log4j2配置MDC分线程写日志
    结构体
    局部变量与全局变量
    ARM漏洞
    ARM承认芯片漏洞:披露修复细节
  • 原文地址:https://www.cnblogs.com/Richard-xie/p/3768055.html
Copyright © 2011-2022 走看看