15.16. Printing

The Windows connector supports printing to the following printer configurations:

  • Network printers visible on the Windows server

  • Network printers visible on the Sun Ray server

  • Local printers attached to the Windows server

  • Local printers attached to the Sun Ray server

  • Local printers attached to the client

Here are some important notes about setting up printers for the Windows connector.

  • Network printers are not affected by hotdesking. Printers connected to clients are available for printing from any client connected to the same Sun Ray server.

  • For printers accessible through the Sun Ray server (network visible or local), you need to perform some initial configuration to make the printers accessible through the Windows connector.

15.16.1. How to Set Up Print Queues (Solaris)

This procedure describes how to set up a raw print queue on a Sun Ray server running Solaris so that a Windows system can access it. This procedure is typically needed for printers locally attached to the Sun Ray server.

If a network printer is visible on the Sun Ray server, this typically indicates that the queue has been set up already and you should not have to perform this task. These instructions pertain to raw print queues, which are print queues configured without a printer driver. Please consult your operating system documentation for instructions about setting up queues for PostScript drivers. See also the lp and lpadmin man pages.

  1. Specify the printer and printer device node using the lpadmin command.

    # /usr/sbin/lpadmin -p printer-name -v /tmp/SUNWut/units/IEEE802.mac-address/dev/printers/device node
    
  2. Enable the print queue.

    # /usr/bin/enable printer-name
    
  3. Accept the print queue.

    # /usr/sbin/accept printer-name
    

To update the Windows session with the available print queues on the Sun Ray server, you must restart the Windows connector with the relevant print queues specified on the command line. See Section 15.16.3, “How to Make Sun Ray Printers Available to a Windows Session” for details.

15.16.2. How to Set Up Print Queues (Linux)

This procedure describes how to set up a raw print queue on a Sun Ray server running Linux, so that it can be accessed by a Windows system. This procedure is typically needed for printers locally attached to the Sun Ray server.

If a network printer is visible on the Sun Ray server, the queue has been set up already and you should not have to perform this task. These instructions pertain to raw print queues, which is a print queue configured without a printer driver. Please consult your operating system documentation for instructions on setting up queues for PostScript drivers. See also the lp and lpadmin man pages.

  1. Uncomment the following line from the /etc/cups/mime.convs file:

    application/octet-stream application/vnd.cups-raw 0 -
  2. Uncomment the following line from the /etc/cups/mime.types file:

    application/octet-stream
  3. Restart the cups daemon.

    # /etc/init.d/cups restart
  4. 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.

    Note

    After rebooting, you might have to create the /dev/usb directory and re-create the soft link.

  5. To complete the procedure, set up a raw print queue.

    # /usr/sbin/lpadmin -p printer-name -E -v usb:/dev/usb/sunray-printer
    
  6. To complete this procedure for SuSE Linux:

    1. In the /etc/cups/cupsd.conf file, set the RunAsUser property to No.

    2. Restart the cups daemon.

      # /etc/init.d/cups restart

To update the Windows session with the available print queues on the Sun Ray server, you must restart the Windows connector with the relevant print queues specified on the command line. See Section 15.16.3, “How to Make Sun Ray Printers Available to a Windows Session” for details.

15.16.3. How to Make Sun Ray Printers Available to a Windows Session

The Windows session is aware only of the print queues specified in the command line when the Windows connector is started. To update the Windows session with the available print queues on the Sun Ray server, you must restart the Windows connector with the relevant print queues specified on the command line.

15.16.3.1. Before You Begin

  • Make sure the print queues are set up on the Sun Ray server. See Section 15.16.1, “How to Set Up Print Queues (Solaris)” and Section 15.16.2, “How to Set Up Print Queues (Linux)” for details.

  • Printer data is created on the Windows system, so make sure to specify the name of the printer's Windows driver and install it on the Windows system. If you make a printer available without specifying a driver, the Windows connector defaults to a PostScript driver.

  • To find the printer driver name on a Windows system, check the Windows Registry key at:

    MyComputer/HKEY_LOCAL_MACHINE/System/CurrentControlSet/Control/Print/Environments/Windows NT x86/Drivers/Version-3
    

    All printer drivers installed on the system is displayed on this list.

15.16.3.2. Steps

  • To specify a printer's Windows driver:

    % /opt/SUNWuttsc/bin/uttsc -r printer:printer-name="windows-printer-driver-name" hostname.domain
    

    where printer-name is a valid raw print queue on the Sun Ray server and windows-printer-driver-name is the name of the printer exactly as shown on the Windows server. Double quotes are required around the name of the printer.

  • To make a printer available without specifying a driver:

    % /opt/SUNWuttsc/bin/uttsc -r printer:printer-name hostname.domain
    

    where printer-name is a valid raw print queue on the Sun Ray server.

  • To make multiple printers available:

    % /opt/SUNWuttsc/bin/uttsc -r printer:printer1=driver1,printer2=driver2 hostname.domain
    

15.16.4. How to Maintain the Printer Cache File

The Sun Ray server maintains a cache in the Sun Ray data store of printer configurations that users set up on the Windows system. The Sun Ray server presents the appropriate configuration to the Windows system when a user reconnects using the Windows connector.

The uttscprinteradm CLI helps administrators to maintain this information. It can be used to list the available information and to perform cleanup in case of user or printer deletion. See the uttscprinteradm man page for further information.

15.16.5. How to Set Up Follow-Me Printing

This procedure describes how to set up Follow-Me Printing, which retains the user's default printer for a Windows session regardless of the Sun Ray Client being used.

Note

Implementation of Follow-Me Printing relies on technology not available by default and non-public Sun Ray interfaces as well as the use of certain public Sun Ray interfaces for purposes other than their intended use. For these reasons, this feature is not a supported feature.

  1. For each Sun Ray Client of interest, specify a printer in the Sun Ray data store.

    1. Log in to the Admin GUI.

    2. Click Desktop Units.

    3. Click the Sun Ray Client for which you want to set up Follow-Me Printing.

    4. Click Edit and add the printer's name to the Other Information field.

  2. Create a shell script that queries the printer name stored in the Sun Ray data store for the current Sun Ray Client and writes that name to the user's $HOME/.printers file.

    For example:

    #!/bin/sh
    if [ 'uname' = Linux ] ; then
    theFlag="-P"
    fi
    theMACAddress='cd $theFlag $UTDEVROOT ; /bin/pwd | sed 's/.*?............?/1/''
    thePrinter='/opt/SUNWut/sbin/utdesktop -o |
    grep $theMACAddress |
    /usr/bin/awk -F, '{print $3}''
    echo "_default $thePrinter" > $HOME/.printers
  3. Use utaction to invoke the script above on an initial connection and subsequently whenever a user moves from one Sun Ray Client to another.

    Provide the following scripts based on the user's login manager:

    • dtlogin login manager - Xsession.d script

    • Gnome Display Manager (GDM) - xinitrc.d script

      For example, you might create the script /usr/dt/config/Xsession.d/1100.SUNWut for dtlogin or /etc/X11/xinit/xinitrc.d/1100.SUNWut for GDM as follows:

      #!/bin/sh
      /opt/SUNWut/bin/utaction -i -c path-to-script &
      

      where path-to-script is the path to the script you created to retrieve the printer name in step 2.

    Note

    The name 1100.SUNWut is chosen purposely in this case to ensure that the script is run or sourced after the existing script 0100.SUNWut. The 0100.SUNWut script is responsible for setting $UTDEVROOT, which is needed by the first sample script in step 2.

    Note

    For information about the bundled gdmgreeter, see the kiosk man page.

  4. Modify your Kiosk session script arguments to redirect the printer to Windows.

    You may modify these arguments through the Admin GUI. In this example you need to add the argument -r printer:_default to the existing arguments, resulting in an argument list similar to the following:

    -t 1800 -- -m -b -r printer:_default myHost
    

    where myHost corresponds to the server argument passed to uttsc.