阿里云不支持VNC吗?我装了几次都是黑屏!大神帮看看代码!-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

阿里云不支持VNC吗?我装了几次都是黑屏!大神帮看看代码!

瑞金 2015-07-19 15:36:03 15192
阿里云不支持VNC吗?我装了几次都是黑屏!


大神帮看看下面的代码!



tigervnc-1.1.0-16.el6.centos.x86_64








/root/.vnc/xstartup 配置文件
export LANG
export SYSFONT
vncconfig -iconic &
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
OS=`uname -s`
if [ $OS = 'Linux' ]; then
  case "$WINDOWMANAGER" in
    *gnome*)
      if [ -e /etc/SuSE-release ]; then
        PATH=$PATH:/opt/gnome/bin
        export PATH
      fi
      ;;
  esac
fi
if [ -x /etc/X11/xinit/xinitrc ]; then
  exec /etc/X11/xinit/xinitrc
fi
if [ -f /etc/X11/xinit/xinitrc ]; then
  exec sh /etc/X11/xinit/xinitrc
fi
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &



/etc/sysconfig/vncservers 配置文件 # The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own).  You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted!  For a secure way of using VNC, see this URL:
# https://access.redhat.com/knowledge/solutions/7027

# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.

# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel.  See the "-via" option in the
# `man vncviewer' manual page.

VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 800x600"


root      1916     1  0 15:24 ?        00:00:00 /usr/bin/Xvnc :1 -desktop iZ944u3esqbZ:1 (root) -auth /root/.Xauthority -geometry 800x600 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5901 -fp catalogue:/etc/X11/fontpath.d -pn
root      1930     1  0 15:24 ?        00:00:00 vncconfig -iconic
root      2164  2110  0 15:31 pts/0    00:00:00 grep vnc


  下面是我的操作过程! 安装包        yum install tigervnc tigervnc-server -y

安桌面        yum groupinstall -y "X Window System"

开机服务    chkconfig --list

设置开机    chkconfig vncserver on

创建配置    vncserver

修改密码    vncpasswd

进入目录    cd /root/.vnc/

修改配置    vim xstartup

后面的TWM换成    gnome-session &  

重启服务    service vncserver restart

增加用户名    vim /etc/sysconfig/vncservers
        VNCSERVERS="1:root"
        VNCSERVERARGS[1]="-geometry 800x600"

再次重启    service vncserver restart


检查端口    ps -ef |grep vnc

查看        cat /root/.vnc/xstartup
查看        cat /etc/sysconfig/vncservers






Linux Shell 开发工具 数据安全/隐私保护
分享到
取消 提交回答
全部回答(8)
  • 勤一门
    2016-10-24 17:32:44
    Re阿里云不支持VNC吗?我装了几次都是黑屏!大神帮看看代码!
    大神,请问你是怎么搞定的?
    0 0
  • 广工第一帅
    2015-11-29 12:32:57
    Re阿里云不支持VNC吗?我装了几次都是黑屏!大神帮看看代码!
    VNC server在哪里搞的
    0 0
  • 零云科技
    2015-07-29 12:51:26
    出个教程吧 我也需要
    0 0
  • 妙正灰
    2015-07-29 08:31:05
    LZ分享一下教程吧!
    0 0
  • yangzhen
    2015-07-28 21:44:01
    回楼主瑞金的帖子
    请问可以分享一下是怎么解决的吗?
    0 0
滑动查看更多
开发与运维
使用钉钉扫一扫加入圈子
+ 订阅

集结各类场景实战经验,助你开发运维畅行无忧

推荐文章
相似问题
推荐课程