System Administration Guide: Virtualization Using the Solaris Operating System
Previous Next

Starting VNC

How to Set Up VNC to Provide a Solaris Guest Graphical Login

This procedure shows how to start VNC on demand from inetd, displaying the dtlogin login screen.


Caution - When using this method, you must restart the service, which will kill all current dtlogin sessions.


  1. Become superuser, or assume the Primary Administrator role.
  2. Enable XDMCP connections on dtlogin by removing -udpport 0 from the arguments.
    # svccfg -s cde-login
    svc:/application/graphical-login/cde-login> setprop dtlogin/args=""
  3. (Optional) If you are not running vncviewer locally on the control domain, set X11-server to listen to the tcp port as described in Example 40-7.

    The VNC listen facility should be used with caution due to security considerations.

  4. Restart the service.
    # svccfg -s cde-login setprop 'dtlogin/args=""'
    # svcadm restart cde-login
  5. Add xvnc service to /etc/services if it is not already there.
    # printf "vnc-server\t5900/tcp\t\t\t# VNC Server\n" >> /etc/services
  6. Enable the Xvnc inetd service.
    # svcadm -e xvnc-inetd
  7. Connect from another machine and verify that you see the login screen and can log in to a desktop session.
    # vncviewer hostname:0

How to Start VNC at System Boot

This procedure starts VNC at system boot from the dtlogin, displaying the dtlogin login screen.

  1. Become superuser, or assume the Primary Administrator role.
  2. Add an instance of x11-server service called display1 for configuration, and configure it to run Xvnc.
    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: "/usr/X11/bin/Xvnc"
    
    
    svccfg -s application/x11/x11-server:display1 addpropvalue options/server: '"SecurityTypes=None"'
  3. Configure dtlogin to start it.
     mkdir -p /etc/dt/config
    cp /usr/dt/config/Xservers /etc/dt/config/Xservers
    echo "   :1   Local local_uid@none root /usr/X11/bin/Xserver :1" >> /etc/dt/config/Xservers
    pkill -HUP dtlogin
  4. Connect from another machine and verify that you see the login screen and can log in to a desktop session.
    # vncviewer hostname:0

How to Start VNC Manually

Starting VNC manually displays the session of the user. A VNC password is required.


Caution - A VNC password should be different from a UNIX login password. A VNC password is not securely encoded on disk or across the network. Do not use a valuable password.


  1. Start VNC manually.
    % /usr/bin/vncserver -httpd
  2. From another machine, open a web browser.
  3. Go to http://hostname:5802/.

    The number 5802 after the colon assumes that the VNC server said it was starting on display :2. If another display number was listed, change 5802 to 5800 plus the display ID.

  4. Enter the password you provided to the vncserver script. Verify that you see a simple desktop session in the viewer.

How to Start a GNOME Session

  • Use the following to start the GNOME session.
    # /bin/sh
    # mkdir <your homedir>/.vnc
    # echo "#!/bin/sh\n/usr/bin/dbus-launch /usr/bin/gnome-session" > <your homedir>/.vnc/xstartup

How to View the VNC Man Pages

You can use the man command to view the man pages.

  • man Xvnc

  • man vncviewer

  • man vncpasswd


Note - Live linkss to these man pages cannot be made from this book.


The MANPATH variable is normally set for you in desktop login sessions. If the entry is not found, check your MANPATH environment variable and add the path to the X11 man pages if necessary.

  1. View the MANPATH:
    echo $MANPATH
    /usr/share/man:/usr/dt/man:/usr/openwin/share/man
  2. If necessary, add the path to the X11 man pages.
    setenv MANPATH /usr/share/man:/usr/dt/man:/usr/openwin/man:/usr/X11/man
Previous Next