C H A P T E R  4

Peripherals for Sun Ray DTUs

This chapter contains information about selected USB, parallel, and serial devices and printing from Sun Ray DTUs.

There are two kinds of peripherals: serial and parallel. Serial peripherals enable RS-232-style serial connections to the Sun Ray DTU. Parallel peripherals enable printing and come in two types: adapters and direct USB-connected printers.

Third-party adapters are useful for supporting legacy serial and parallel devices.

Sun Ray Server Software recognizes a parallel printer with an adapter as a USB printer.

Device Nodes and USB Peripherals

Sun Ray Server Software creates a device directory called IEEE802.MACID in the /tmp/SUNWut/units directory. This directory contains the MAC address for each DTU on the interconnect. The IEEE802.MACID directory for each DTU contains dev and devices directories. The Sun Ray dev directory contains a representation of the logical topology of the devices connected to the DTU. The Sun Ray devices directory contains a representation of the physical topology of some of the devices connected to the DTU.

Note - Sun Ray Server Software does not create device nodes for every USB device. Some USB device drivers export their device interfaces through other mechanisms than a traditional UNIX device node.

Directories correspond to buses and hubs, and files correspond to ports. Hub directories are named according to the port on the upstream hub into which they are attached.

Device Nodes

In Sun Ray devices, device nodes are created for each serial or printer port on an attached USB device. The device nodes are created in the hub directory corresponding to the hub to which they are attached. They are named:

 manufacturer_name, model_name@upstream_hub_port

If the USB device has multiple identical ports (for example, two serial ports), the name is followed by :n where n is a numerical index, starting at 1.

The following is a typical device node path:

/tmp/SUNWut/units/IEEE802.MACID/devices/usb@1/hub@1/\manufacturer_name, model_name@3:1

TABLE 4-1 Definitions of Naming Conventions



physical topology

The physical topology is hub@port/hub@port and so on. The port refers to the port on the parent hub into which the device or child hub is plugged.

printer name 1, terminal name 1

The printer and terminal name in the Sun Ray devices directory is manufacturer, model@port with a colon separating the numerical index when the string just described is not unique in the directory.

printer name 2, terminal name 2

The printer and terminal name in the Sun Ray dev directory is the manufacturer and serial number concatenated with an alphabetic index when the serial number is not unique.

Device Links

Device links are created under the dev directory. A link to each serial node is created in dev/term, and a link to each parallel node is created in dev/printers.

Typical device links are:



where index is an increasing alphabetical character, starting at a.

If the manufacturer name is not available, the USB vendor and product ID numbers are used for the name of the device link.

Device Node Ownership

Some device nodes are owned by the user whose session is active on the DTU, while others may be owned by root or by other users that may have had previously active sessions on the DTU. Device permissions, access controls and ownership rules are determined by the class of device. For serial and parallel devices, only the user whose session is active on the DTU or the superuser have permission to use the attached device. If there is no user with an active session, superuser owns the serial and parallel device nodes. This rule may not hold for other classes of USB devices connected to the DTU.

Hotdesking and Device Node Ownership

The following description of the behavior of USB devices when sessions are connected and disconnected from a DTU applies only to USB serial and USB parallel devices. Other device classes may have different semantics regarding ownership and device lease times.

Changing the active session on a DTU changes the ownership of the device nodes to the user associated with the new session. A session change occurs whenever a user:

In a failover environment, you can use the utselect or utswitch command to change a session. A session change causes all devices currently open by a non-root user to be closed after 15 seconds. Any input or output to or from any affected device results in an error. Devices currently opened by the superuser remain unaffected by the session change.

Note - When a session is changed, any input or output in progress on a device node opened by a non-root user is cancelled after 15 seconds. If the original session is restored within 15 seconds, the ownership is not relinquished, and input and output continue uninterrupted.

Mass Storage Devices

Device Nodes and Links

Mass storage device nodes are block special nodes. They are created in the dev/dsk directory. Note that for mass storage devices, device nodes are not created in the devices directory and no device links are created.

Device nodes are named with a partition identifier suffix. The device node representing the whole disk does not have such a suffix. For example:

Disk operations such as eject should be directed at the whole disk. Partition operations such as mount should be directed at individual partitions. See TABLE 4-2 for examples.

Mount Points

When a mass storage device is plugged into the DTU, if it has an OS-recognizablefile system, it is automatically mounted on a directory under the user’s mount parent directory. The mount parent directory is located in $DTDEVROOT/mnt/. The user can also locate mount points by using the -l option to the utdiskadm command:

% /opt/SUNWut/bin/utdiskadm -l

Device Ownership and Hotdesking

When the user’s session disconnects from the DTU, the user loses access rights to the mass storage device, and all pending I/O to the device is aborted. This can cause the data on the device to be corrupted. Users should use utdiskadm -r to unmount all filesystems safely before hotdesking or unplugging the disk from the DTU. They should also close all references to files and directories in the mount point to ensure that the device in question is not busy.

caution icon Caution - Linux does not immediately write data to disks. Failure to run utdiskadm -rbefore unplugging mass storage devices will cause loss of data. Make sure your users run utdiskadm -rbefore they unplug any mass storage device.

% /opt/SUNWut/bin/utdiskadm -r device_name

Common Disk Operations

TABLE 4-2 is a summary of common disk operations and the commands used to perform them. Refer to the man pages for more information on the individual commands.


TABLE 4-2 Commands for Common Disk Operation on Linux Platforms




create file system


path of partition


utdiskadm -m

partition name


utdiskadm -u

mount point

prepare to unplug

utdiskadm -r

device alias

eject media

utdiskadm -e

device alias

check for media

utdiskadm -c

device alias

create fdisk table


path of whole disk

repair file system


path of partition

display file system

df -k

mount point

list devices

utdiskadm -l


Attached Printers

Sun Ray Server Software supports PostScripttrademark printers connected directly to a USB port on the Sun Ray DTU or connected through a USB-to-parallel port adapter. For non-PostScript printer support, refer to Non-PostScript Printers.

Note - The lp subsystem opens the device node as superuser for each print request, so print jobs are not affected by hotdesking.

Printer Setup

The following generic instructions may vary slightly from one operating system implementation to another but should provide enough information to enable an administrator to set up basic printing services.

procedure icon  To Set Up a Printer

1. Log in as superuser on a Sun Ray DTU.

2. To determine the MAC address of the DTU, press the three audio option keys to the left of the power key in the upper right corner of the keyboard.

The alphanumeric string displayed above the connection icon is the MAC address.

3. To locate the Sun Ray DTU, type:

# cd /tmp/SUNWut/units/*MAC_address
# pwd

The path to the extended MAC address for your particular Sun Ray DTU is displayed.

4. Locate the port for the printer by typing:

# cd dev/printers
# pwd

5. In the directory, locate the printer node.

6. Use the Linux administration tools to set up the printer.

Make sure to choose Other so that you can enter the device node from Step 4 above.

7. To verify that the printer has been set up correctly, type:

# lpstat -d printername

Note - For SLES 9, perform the following additional steps:

8. Create a soft link to the Sun Ray printer node in /dev/usb.

For example, if the device node is
/tmp/SUNWut/units/IEEE802.<mac-address>/dev/printers/<device node>,
then use the following command:

# ln -s \/tmp/SUNWut/units/IEEE802.<mac-address>/dev/printers/<device node> \/dev/usb/sunray-printer

Use this soft link (/dev/usb/sunray-printer) as the Device URI while creating the print queue.

9. Update /etc/cups/cupsd.conf to set the RunAsUser property to No.

10. Restart the cups daemon.

# /etc/init.d/cups restart

Non-PostScript Printers

Printers that do not use PostScript, such as engineering plotters, are best supported by third-party software. Low-cost inkjet printers require third-party software such as:

Check with the vendors for pricing and the precise printer models supported.


For a list of verified serial and parallel adapters, see:



libusb is an Open Source user space USB API that enables applications to access USB devices. It has been implemented for a number of operating environments including Linux, BSD Unix, and Solaris.

The Sun Ray libusb plugin libusbut.so.1 provides Sun Ray-specific support for libusb in Linux environments.

The SUNWlibusbut RPM delivers the Sun Ray libusb plugin libusbut.so.1 in /opt/SUNWut/lib. To build applications, use the usb.h header file from the existing server-side Linux libusb RPM.

The libusbut man page provided with SRSS 4.0 for Linux discusses options available for using the Sun Ray libusb plugin alongside the Linux server-side libusb support.

The Open Source libusb-based applications provided with the standard Linux distributions can be used to drive USB-based devices attached to Sun Ray DTUs. For example, for Sane, see www.sane-proj.org; for Gphoto, see www.gphoto.org.

Note - Sane can be used in Sun Ray implementations if built with threads enabled. Sane binaries with threads enabled are available at the Sun Download Center (SDLC), or they can be built from source.