开发者社区> 问答> 正文

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

阿里云不支持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






展开
收起
瑞金 2015-07-19 15:36:03 17032 0
8 条回答
写回答
取消 提交回答
  • Re阿里云不支持VNC吗?我装了几次都是黑屏!大神帮看看代码!
    大神,请问你是怎么搞定的?
    2016-10-24 17:32:44
    赞同 展开评论 打赏
  • Re阿里云不支持VNC吗?我装了几次都是黑屏!大神帮看看代码!
    VNC server在哪里搞的
    2015-11-29 12:32:57
    赞同 展开评论 打赏
  • 爱好建站
    出个教程吧 我也需要
    2015-07-29 12:51:26
    赞同 展开评论 打赏
  • 解决方案工程师,负责为企业规划上云迁移方案和云上架构设计,在网站建设开发和云计算领域有多年经验,专注于Linux平台的系统维护以及应用部署。致力于以场景化的方式让云计算,用更加通俗易懂的方式让更多人体验云计算,让云端的计算更质朴的落地。
    LZ分享一下教程吧!
    2015-07-29 08:31:05
    赞同 展开评论 打赏
  • 回楼主瑞金的帖子
    请问可以分享一下是怎么解决的吗?
    2015-07-28 21:44:01
    赞同 展开评论 打赏
  • Re阿里云不支持VNC吗?我装了几次都是黑屏!大神帮看看代码!
    服务器是拿来看的
    2015-07-22 23:49:01
    赞同 展开评论 打赏
  • 没用过这个,楼主搞定了吗?
    2015-07-19 21:15:22
    赞同 展开评论 打赏
  • Re阿里云不支持VNC吗?我装了几次都是黑屏!大神帮看看代码!




    搞高成功了! 这个云挺酷的!
    2015-07-19 21:09:21
    赞同 展开评论 打赏
滑动查看更多
问答排行榜
最热
最新

相关电子书

更多
阿里云云原生 Serverless 技术实践营 PPT 演讲 立即下载
阿里云产品十月刊 立即下载
基于阿里云构建博学谷平台实时湖仓 立即下载