在Nevada和OpenSolaris上设置使用xvnc

来源:互联网 发布:淘宝二手电脑可以买吗 编辑:程序博客网 时间:2024/05/29 08:06

xvnc是Solaris,OpenSolaris支持远程桌面。这在xvm中广泛应用。这里总结了几种设置xvnc的方法,供参考:

 

1. http://blogs.sun.com/timthomas/entry/script_to_configure_vnc_server

 

Script to Configure VNC Server in Solaris 10 5/08 and Solaris Express (Nevada)

 

I have been using a script for a while to configure VNC server displays for Solaris Express (Nevada) and I just found out that the same script works on Solaris 10 5/08 (Solaris 10 Update 5) as it includes Xvnc also.

I always do a  full install of Solaris. If you don't, then maybe Xvnc will not be installed on your system. You can easily check:

# pkginfo | grep  xvnc
system      SUNWxvnc                         X11/VNC server

You run the below script once after OS installation is complete. It sets up two VNC displays and you connect to them with a  VNC client as <hostname>:1 and <hostname>:2 . The second display is shared.

#!/bin/sh
#
# config_Xvnc_s10+snv.sh
#
# Run this script once after OS installation is completed.
#
# This has been tested with Solaris 10 5/08 and Solaris Express (Nevada) b87 onwards
#

#add vnc display 1
svccfg -s application/x11/x11-server add display1
svccfg -s application/x11/x11-server:display1 addpg options application
svccfg -s application/x11/x11-server:display1 addpropvalue options/server astring: "/usr/X11/bin/Xvnc"
svccfg -s application/x11/x11-server:display1 addpropvalue options/server_args astring: '"SecurityTypes=None"'

#add vnc display 2, which is shared
svccfg -s application/x11/x11-server add display2
svccfg -s application/x11/x11-server:display2 addpg options application
svccfg -s application/x11/x11-server:display2 addpropvalue options/server astring: "/usr/X11/bin/Xvnc"
svccfg -s application/x11/x11-server:display2 addpropvalue options/server_args astring: '"SecurityTypes=None"'
svccfg -s application/x11/x11-server:display2 addpropvalue options/server_args astring: '"-alwaysshared"'

# Configure dtlogin to start it
if [ ! -d /etc/dt/config ] ; then
        mkdir -p /etc/dt/config
fi
if [ ! -f /etc/dt/config/Xservers ] ; then
        cp /usr/dt/config/Xservers /etc/dt/config/Xservers
fi

echo "   :1   Local local_uid@none root /usr/X11/bin/Xserver :1" >> /etc/dt/config/Xservers
echo "   :2   Local local_uid@none root /usr/X11/bin/Xserver :2" >> /etc/dt/config/Xservers

pkill -HUP dtlogin

#End

The displays persist when you disconnect the VNC client, so you can come back to a session at  later time and all the windows and applications will be as you left them. Any jobs you kicked off will have continued to run.

You can get VNC client software from http://www.realvnc.com. There is a Free Edition and an enhanced Personal Edition for which you need a license.

If you have an older release of Solaris 10 than 5/08 then take a look at my earlier blog entry about how to configure VNC.

 

Note:

 

One thing is missed in the article, you need to change permission of
authorization file as "chmod +r /etc/.vnc/passwd".
Sample configuration file /etc/dt/config/Xservers,
==================================================
   :0   Local local_uid@console root /usr/X11/bin/Xserver :0 -nobanner
   :1   Local local_uid@none root /usr/X11/bin/Xserver :1 -geometry 1680x1050 -rfbauth /etc/.vnc/passwd
   :2   Local local_uid@none root /usr/X11/bin/Xserver :2 -geometry 1280x1024 -rfbauth /etc/.vnc/passwd
==================================================

2. 简单的方法。

 

1). $ vncserver
2). edit .vnc/xstartup

        #!/bin/sh

        #[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
        #xsetroot -solid grey
        #vncconfig -iconic &
        #xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
        #twm &
        gnome-session

3). vncserver :1 -alwaysshared -deferupdate 100 -geometry 1440x900 -depth 16

4). to kill vnc :1
        $ vncsever kill :1

原创粉丝点击