阿里云不支持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
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。