Wednesday Apr 12, 2006

Disabling Screen Blanking

Some Sun Ray deployments require having data on the screen at all times. The DTUs are being used for monitoring the current state of something or displaying reference data.

In these scenarios it is important that the screens are always active, and usually there is no mouse or keyboard to wake them from power saving/screen saver mode.

When used in CAM mode to connect to Windows, there are two screen blanks that can happen, one through the X server on the Sun Ray server and one with the Windows screensaver. The Windows screensaver is easily fixed with right-click on background and choose "None" on the sceensaver tab.

Since in CAM mode there is no GUI to configure the X screensaver, the xset command with the appropriate entries needs to be run after the X Session is started.

The solution is to add a line to the beginning of your CAM application script to execute the "xset" command before launching the interop client. (SRCW, SGD, etc.)

The correct command is:


xset -dpms -fbpm s off

After adding this line to your CAM script, any new sessions will get the change but old sessions will need to be reset to receive the change.


/opt/SUNWut/sbin/utrestart -c

This currently is an all or nothing fix. It will turn off the sceensaving feature for all users at once. You could configure the Windows screensaver to blank the screen after a period of time for individual users, but this will not let the DTU go into low power mode.

There is the possibility of using a script similar to the Folllow-me-printing script to enable/disable screen blanking on a per-DTU basis if necessary.

Thursday Feb 23, 2006

CAM Chooser Application

Have you ever wanted to have a quick little "Click Here to Start XYZ" type script?  If so this is for you.

A lot of my customers find this useful in Controlled Access Mode when they don't want the applications running all the time (i.e. consuming resources), but want to give the user something easier than right clicking on the workspace menu to launch.  It even has a little bit of logic in it to center itself on the screen.

It also works great for full screen Windows deployments in non-smart card mode which as most of you know will time out after 120 seconds of sitting at the Windows login screen.

When the user clicks one of the application buttons the chooser box will disappear (as long as your application doesn't fork), and then reappear once the application exits.  If it is configured as a Critical application, when the user clicks the Restart button, the Sun Ray will cycle.  Particularly useful when launching a web browser so all the cache of the last users session are cleared out.

There are two scripts that make this happen, utsplash and utmsgbox.

utsplash will be your CAM Application and it will call the utmsgbox script.

utsplash is the script you will edit and customize.  You can also customize the icon, which is a unix pixmap. 

Hint: use /usr/dt/bin/sdtimage to convert a gif or jpeg into xpm format.

Here's an example of the customizable parts of utsplash

NOTE: This is only a part of the script. A tarball of the complete script is provided here.

PATH=$PATH:/usr/openwin/bin:.;export PATH
# TITLE - What you want the label Title to be
TITLE="Sun Ray...Powered by Sun"
#ICON - What icon to display
#Width of the Greeter
#Height of the Greeter
#Background color
#Font color
# Text for the 1st button - otherwise APP1 will be displayed
BTN1="MS Windows"
# Text for the 2nd button - otherwise APP2 will be displayed
# Text for the 3rd button - otherwise Restart will be displayed
# Get screen information to center the box
XWID=`/usr/openwin/bin/xwininfo -root|grep Width | awk -F: '{print $2}'|sed 's/ //'`
XHGT=`/usr/openwin/bin/xwininfo -root|grep Height | awk -F: '{print $2}' |sed 's/ //'`
XCTR=`expr $XWID / 2`
YCTR=`expr $XHGT / 2`
YCUT=`expr $HEIGHT / 2`
XCUT=`expr $WIDTH / 2`
GEOX1=`expr $XCUT - $XCTR`
GEOY1=`expr $YCUT - $YCTR`
GEOX=`echo $GEOX1 | sed 's/-//'`
GEOY=`echo $GEOY1 | sed 's/-//'`
# -- Define Messages ---
#Message to be displayed on first line of the greeter
MESSAGE1="Welcome to the Sun Ray Cafe"
#Message to be displayed on second line of greeter
MESSAGE2="Please select an application"
MSG=`printf "%s\\n\\n" "$MESSAGE1" "$MESSAGE2"`
#-- Applications to run when buttons pushed --

Dowload the sample scripts here. As always, have fun with it.

Wednesday Feb 22, 2006

CAM Mass Storage Workaround

Editors Note: This Workaround is no longer necessary in SRSS 4.0 and Kiosk Mode.

One of the first things I noticed when we released our support for USB Mass Storage on Sun Ray is that it didn't work in Controlled Access Mode.   It's a simple timing problem where processes responsible  for Mass Storage run prior to the hand off of the session to the CAM user.

You can use this work-around to enable USB Mass Storage support for your favorite CAM application, including passing this storage up to Windows Terminal Server as a mapped drive.

On each server in your Fail Over Group:

  • Create file called /usr/dt/config/Xsession.d/0200.SUNWut
  • Make sure root owns and perms are 700

# Work-around for CAM and Mass Storage
#set -x
for i in `/bin/cat /var/opt/SUNWbb/users.list`
echo $i
if [ ! -d /tmp/SUNWut/mnt/$i ];then
/bin/mkdir /tmp/SUNWut/mnt/$i
/bin/chown $i:other /tmp/SUNWut/mnt/$i
/bin/chmod 500 /tmp/SUNWut/mnt/$i
#End of Script

Have fun!

Wednesday Feb 15, 2006

Kiosk Mode Gotcha

Sun Ray has three application attributes for Controlled Access Mode (aka Kiosk/CAM).

They are Critical, Menu, Default.

Critical means that application automatically launches and to restart the session should the application exit.

Menu means that the application will only start if the user right clicks on the desktop and chooses the application from the workspace menu.

Default means that the application will automatically launch, but the session will not restart if the application exits. The user can also restart the application from the workspace menu.

Both Menu and Default mode rely on the included CAM application called dtsession, which is a locked down instance of CDE to give you a window manager and provide the workspace menu.

If you have any application defined as either Menu or Default and then remove dtsession as an "Application To Launch", your Sun Ray will continuously cycle. This is due to the fact that there is a requirement for one application to be set to critical, and even though the user cannot view or change the attribute of dtsession, it is set to critical. Trouble can occur because we allow you to remove dtsession and no matter how much debugging that you turn on, you'll never see any errors.

The only CAM application that can run without dtsession are those that are created with the attribute Critical. If any of the "Applications To Launch" are set to Menu or Default, you should leave dtsession enabled, otherwise you must have at least one other application set to the Critical attribute. Of course those applications with the attribute of menu won't work if you remove dtsession since you won't have the workspace menu to launch them from.

Since this just bit me in the you know what trying to troubleshoot a customer problem remotely (someone removed dtsession and failed to mention it and the only remaning app was set to Default), I think I'll file an RFE to introduce some logic that won't let you remove dtsession if your applications require it or you don't have any apps set to Critical.

Think Thin is a collection of bloggers that work with Oracle's Virtual Desktop portfolio of products.


« July 2016