A "USB Drive" daemon for Sun Ray sessions
**** THIS VERSION OF usbdrived IS DEPRECATED - see *** http://blogs.sun.com/danielc/entry/a_usb_drive_daemon_for1
A lot of people ask me the age-old question: how can I see thumb drives (and others)
attached to my Sun Ray on JDS/CDE/Windows? (it probably works unchanged for SLES and RHEL.)
The
inelegant, user-unfriendly solution that is always there for you (JDS/CDE):
Without doing any further work, the answer is quite trivial: SRSS mounts
the thumb drive on a non-trivial directory (non-trivial as in "not in
your home directory") - namely at:
/tmp/SUNWut/mnt/<user-name>
(mounted disk names and #s appear here)
You can then access this via the file manager - for example, in JDS, (right-click) Launch -> Browse Documents (Nautilus) and
point to this directory. Better yet - bookmark this directory
under Nautilus as soon as you can!
However, the above is typically unacceptable for customer deployments,
and until the time Solaris/JDS can handle this automatically, I've
scripted a couple of workarounds. See next section.
The
elegant solution: "USB Daemon (usbdrived)"
The following instructions will automate USB drive "show-up" so that
when
you insert a thumbdrive into your Sun Ray:
1) a file manager window (Nautilus) will automatically open up showing
the top-level directory of the USB drive, and
2) a link is created on your desktop, called "USB Drive" (I just
couldn't come up with a better name...)
Once you pull the drive out, the above disappear, so it's important to
make sure that any copying process is done before pulling it out.
(actually, the file manager window disappears only if its on the root
level of your USB drive. If anyone can tell me how to close any Nautilus window that's open on sub-directories, please let me know!)
The instructions here also integrate the script with utaction so that
disconnected users don't chew up unnecessary Sun Ray server resources.
HOW TO (Basic instructions for JDS):
These instructions assume that you'll install this for your user account. Extrapolate for server-wide deployment as required...
1) If you don't have one, create a bin directory in your home directory
- run this: mkdir $HOME/bin
2) copy usbdrived to your newly created "bin" and give it exec permissions
- run this: chmod +x $HOME/bin/usbdrived
[NOTE: THIS LINK IS DEPRECATED AND NOW POINTS TO BLOG ENTRY FOR V2!]
3) If you're running version 1.23 or better of utdiskadm, skip to step 6. To find out, this command will tell you the version number
- run this: head /opt/SUNWut/bin/utdiskadm | grep ident | awk '{ print $4 }'
4) If you're on version 1.22 or lower of utdiskadm you need to patch an 'alternate' version that includes a little fix: copy the standard utdiskadm to your bin directory (call it utdiskadm.fix)
and change one line (because, under certain circusmtances, logname returns nothing...) - the script will probe for an up-to-date utdiskadm and ignore yours when the system has been patched as required!
- run this: cp /opt/SUNWut/bin/utdiskadm $HOME/bin/utdiskadm.fix
vi $HOME/bin/utdiskadm.fix
find the line UTUSERNAME="`logname`"
change to UTUSERNAME=$USER
:wq (save the file ;)
5) If you are *not* placing the updated utdiskadm.fix file in your bin directory, update your "usbdrived" script to reflect the location of utdiskadm.fix.
6) add a line to your .profile (bash/ksh/sh) or .login (csh) in your home directory that will enable the daemon on card insertion (change the path accordingly if the script is not in your bin directory)
- run this: echo '/opt/SUNWut/bin/utaction -c "$HOME/bin/usbdrived start" -d
"$HOME/bin/usbdrived stop" -i &' >> $HOME/.profile (or .login if csh)
7) Log out, log in... That's it. (or you can run the above line to test as a one-off until you log out).
Under
CAM/CDE
If your are using
CAM/CDE, make sure you edit the script and change the USEJDS variable
to 0, so that:
1) Nautilus is not invoked automatically (though you can, but...)
2) The "USB Drive" link is created in the user's home dir and not the
Desktop dir, which doesn't exist
You can then add a CAM menu entry to open dtfile on this, such as "Open My USB Drive". You do this anyway without usbdrived by following the earlier section, but it won't open in the exact mount, but rather in the parent folder. These instructions are particularly useful for the next section...
Under
Windows
You need to run the daemon like above under either JDS
or CDE (whatever it is you are using underneath) and make sure you
start up uttsc with the appropriate -r option, e.g. -r
disk:U="$HOME/Desktop/USB Drive" for JDS. This will let you browse the U: drive
when there is something mounted, and it will allow for changing USB drives without disconnecting your Windows session, as usbdrived depends on utdiskadm to create the "USB Drive" link on demand.
Make sure that if you are using CAM with the Sun Ray Windows Connector,
you make USEJDS=0 in the usbdrived script.
Limitations
This only allows for one USB drived at a time to show up and be managed. That's enough for now ;)


Posted by Alex Collins on June 20, 2007 at 08:41 AM PDT #
Posted by bhlackey on June 20, 2007 at 11:57 AM PDT #
It create link on usb key insert and delete them on usb key remove for any number key. Tested with a U3 one too.
The script can be found at usbdrived3
We'll try to improve it, if you create another version please let us know
Bye bye
Frank Contrepois
Posted by Frank Contrepois on June 21, 2007 at 08:01 AM PDT #
Posted by danielc on June 21, 2007 at 07:21 PM PDT #
Posted by danielc on June 21, 2007 at 07:33 PM PDT #
To Create the mount points correctly you need this little script. I don't take credit for the work, Brad Lackey from Sun gave me this.
CAM_Storage_Fix.tar.gz
If you are using Kiosk Mode think carefully about the implications of using this script. A user may be able to browse your entire file system.
Posted by Alex Collins on June 22, 2007 at 01:29 AM PDT #
Posted by Carl Eberling on June 25, 2007 at 07:05 AM PDT #
Posted by The dot in ... --- ... on March 27, 2008 at 06:24 AM PDT #
Is there a way to have USB devices mounted read-only? vold (on a workstation) can be told to do so, but I didn't find out how that can be done with a Sun Ray...
Posted by Norbert Hanke on July 03, 2008 at 07:38 AM PDT #
There is a third party solution, which implements direct USB passthrough from Sun Ray to Windows Terminal Server and XP.
Allows to connect printers to Terminal Server with native Windows drivers, and virtually any USB device to virtual XP machine.
Posted by Pavel Tatarintsev on April 21, 2009 at 06:31 AM PDT #
Pavel, can you please share with us who this third party is? I am more than curious.
Posted by Daniel Cifuentes on April 22, 2009 at 07:19 AM PDT #
This is Russian company I work for - UBTec. The solution is called NETUSB. And it specifically designed for Sun Rays.
You can reach me by phone +7 918 531 81 95, or +7 863 295 31 00 ext.513 or e-mail: tatarintsev AT ubtec.ru
Posted by Pavel Tatarintsev on April 22, 2009 at 12:14 PM PDT #
Dear Sun/Oracle,
SunRay is great technology, good approach... thin of the thinness clients (ultra thin client).
But it's a weak product. Sometimes technology people need to go out get some beers, relax and develop cool product. Here are the essentials:
USB 2.0 or even 3.0 - MUST. Other wise don't include USB port at all. For those who don't use it. To make it even more attractive add flash card reader. Also we need more USB's 2 spare ports at least. Keyboard USB extensions does not work. Not enough voltage.
Multimedia. 2 way sound (mic/playback) all way to windows through RDP.
Video acceleration. Any DVD player in these days can decode DivX, Mpeg-2, Mpeg-4. Make it 30W instead 4W but users need multimedia on their desktops. You tube full screen should scream.
Power save button. 4W is 4W. put an extra button for power save. Go green.
Cheers and good luck.
Posted by Saul Pr on May 22, 2009 at 07:04 AM PDT #