Scanning and Scanner Serving for GNU/Linux and Windows

This document explains how to setup a scanner for use in Debian GNU/Linux. It goes on to describe how to enable that scanner for remote use from workstations running Debian GNU/Linux, other unices or Microsoft Windows.

Introduction to the SANE Project

The SANE (Scanner Access Now Easy) project ( produces the following groups of software:


Debian unstable package page:

This package includes:


Debian unstable package page:

This package includes:


XSane is available for Unix and Windows. The XSane project web site is at, the Debian unstable package page at

Setting it up using Debian GNU/Linux

Install Scanner Software (Debian-specific)

Install 'sane', which includes all the software from the SANE project mentioned above.

Setup the Machine for Local Scanning

How the scanners attached and what your system uses to access it

There are a number of different interfaces your scanner can be attached to

There are a number of different methods used by the system to access the scanner, depending on interface and possibly Linux kernel version

There are a number of different locations for the scanner, depending on interface and means of accessing the scanner

We need to identify the means being used to access your scanner and its location. You can use either of the following, whilst root

Test the scanner

scanimage -d backend-name:location --format tiff > image.tif.
For example:


The backend is specific to the scanner manufacturer and sometimes the model.. The means of accessing the scanner must be defined in the backed configuration file. The backend configuration file is /etc/sane.d/backend-name.conf. The backend for most Hewlett Packard scanners is called 'hp' (the project page is at: The backend for most Epson scanners is called 'epson' (the project page is at

For USB scanners, where the system uses libusb and where the backend knows the scanner, using just 'usb' in the backend configuration file should be enough to use the scanner; this instructs the backed to scan for all Epson scanners it knows.

For USB scanners, where the system uses libusb, if the backend doesn't know your scanner, for example if its a newer model, you'll have to put the vendor and product IDs, as reported by sane-find-scanner -v, into the backend configuration file. The output from sane-find-scanner -v should have given you a vendor ID and product ID.
(The documentation in the configuration file says to use the syntax 'usb <product ID> <device ID>', which is different wording to that given by sane-find-scanner. sane-find-scanner uses the term 'vendor' to mean the same as the configuration file's 'product' and 'product' to mean the same as the configuration file's 'device'. The configuration file also leaves out the leading zeros (i.e. usb 0x04b8 0x0103) displayed by sane-find-scanner, but you can either use them or leave them out.

For USB scanners, where the system uses devfs, you use one of the locations listed earlier.

For SCSI scanners, use the name of the generic SCSI device that the scanner is connected to, for example /dev/sg3 or /dev/scanner, or just scsi BACKEND-NAME.


For a detailed description of each backend's configuration file, see the relevant backend manual page, called 'sane-<backend-name>' (e.g., sane-epson and sane-hp).


If the system uses libusb and the backend knows your scanner, permissions should be setup correctly for you automatically. (see and possibly for background on this.

Note: need to add here how to setup permissions if the system uses libusb and the backend doesn't know the scanner. See (see

If the system uses devfs, set permissions in the configuration file /etc/devfs/conf.d/scanner (/etc/devfs/perms on some non-Debian systems), in the following manner (your specific location may differ to these examples):

Changes to the permissions of the device itself are lost when disconnecting and re-connecting the device or restarting the system.

Note: it may be necessary to set devfs permissions using chgrp scanner /dev/sg3 and either chmod g+rw /dev/sg3 or chmod o+rw /dev/sg3.

Setup the Machine as a Remote Scanner Server - saned

saned is the SANE (Scanner Access Now Easy) daemon that allows remote clients to access image acquisition devices available on the local host.

  1. configuration file: saned.conf - contains a list of accepted clients
  2. add this to /etc/inetd.conf:
    sane stream tcp nowait saned.saned /usr/sbin/saned saned
  3. The Debian package automatically adds this for you to /etc/services:
    sane 6566/tcp # SANE network scanner daemon
    (Note: Debian uses 'sane' where as the SANE project's documentation uses 'sane-port'. It looks as though 'sane-port' will be replaced in the IANA ports specification with 'sane')

Scanning from a Remote Location


We don't think scanimage can be used remotely.

XSane (Unix)

Package(s): xscan

XSane (Windows)

Package(s): xscan

To install in Windows: extract the zip archive to C:\sane. Do not place it in any other place, XSane will only work when placed in C:\sane.

"XSane future plans: free installation path; autodetect language; may be xsane-win32 without cygwin.dll on native win32 mode; may be later we make a sane-WIN32 version so that the backends do work too." -

"Viewer-Mode: is completly usable (does gocr run on windows?)" -

[Note: elaborate on copy, fax, email and OCR]

Other Software


Project web site:

A raster image scan program for KDE.


Project web site:

"QuiteInsane is a graphical frontend for SANE (Scanner Access Now Easy). It can save an image to a file in a variety of image formats, send an image to a printer or do OCR (Optical Character Recognition) using gocr."

SaneTwain (Windows only)

Project web site:

Requires SaneTwain.ds be copied to %WINDIR%\twain_32. This is then picked up by programs looking for a Twain driver. The program ScanImage.exe can be used to run the scanning software directly, however you'll want to weigh up the different interfaces of xscan and SaneTwain (which has a native Windows GUI; also, in a rough test of memory comsumption on startup, SaneTwain used 5MB RAM, xsane 13MB; xsane is cross platform).

(when the server isn't available its difficult to use - first time it loaded it asked for the address, then on subsequent loads it looked without asking then hung when it didn't find the device.)


Project web site:

Scanner Software Integration into Other Software


" includes a simple scan interface that uses SANE" (is this just on GNU/Linux?) Insert -> Picture -> Scan -> Request... - for us this loaded SaneTwain, presumably bcos it looks for a Twain source. If it only supports Twain on Windows then its probably worth having SaneTwain installed as well as XSane.



Further Info

SANE Frequently Asked Questions:

/usr/share/doc/sane-utils/README.debian - information on permissions

various documents in file:////usr/share/doc/xsane/html/ or file:////usr/share/doc/xsane-common/html/

sane-usb(5) man page

sane-scsi(5) man page

SANE Search Engine Server:


XSane newsletter and mailing list:


open-source character recognition:

A few scanning tips by Wayne Fulton:

Scanning Negatives with GIMP:


permissions? read readme.linux

The home of the Epson SANE backend is at Their documentation says it supports Epson GT-8500 but the SANE projefct's doesn't list it. latest advertised epson backend is version 0.2.34 from 2003-02-15
from the sane-backends source code, 1.0.15 includes "SANE Epson Backend v0.2.43 - 2004-10-16"

Optical Character Recognition (OCR)


Project web site:

can't get gocr to work with xsane

To Do

Checkout scsiadd:

Checkout scsiaddgui (not available in Debian):

SANE_DEBUG_=255 gimp