Friday May 23, 2008 Changing OpenSolaris 2008.05 to use Xvnc for the default X server rather than Xorg is really simple. OpenSolaris 2008.05 uses GDM as the graphical login manager. GDM starts the X server using /usr/X11/bin/X (a symlink to Xserver). The Xserver program in /usr/X11/bin uses SMF to store its configuration properties. This includes the location of the "real" (or "virtual" in our case) X server program.
To switch to Xnvc:
$ pfexec svccfg -s x11-server
svc:/application/x11/x11-server> setprop options/server = "/usr/X11/bin/Xvnc"
svc:/application/x11/x11-server> setprop options/server_args = astring: ("-SecurityTypes" "None")
svc:/application/x11/x11-server> setprop options/tcp_listen = true
svc:/application/x11/x11-server> end
$ pfexec svcadm restart gdm
Now use your VNC client to connect using the IP address of your OpenSolaris machine. You will get the OpenSolaris login screen. Note that we disabled VNC level security above, so lets now change things so that VNC only works over SSH port forwarding. We do this by telling the Xvnc server to only listen locally.
$ pfexec svccfg -s x11-server
svc:/application/x11/x11-server> setprop options/server_args = astring: ("-SecurityTypes" "None" "-localhost")
svc:/application/x11/x11-server> end
$ pfexec svcadm restart gdm
Now to connect we need to do somethink like this:
remotehost$ ssh -n -f -L5900:localhost:5900 opensolarishost sleep 100 remotehost$ vncviewer localhost
To switch back to a local X server:
$ pfexec svccfg -s x11-server svc:/application/x11/x11-server> setprop options/server = "/usr/X11/bin/Xorg" svc:/application/x11/x11-server>setprop options/server_args= "" svc:/application/x11/x11-server> setprop options/tcp_listen = false svc:/application/x11/x11-server>end $ pfexec svcadm restart gdm( May 23 2008, 05:46:10 PM BST ) Permalink Comments [2]