SANE

SANE - Scanner Access Now Easy enables the use of scanners on Linux. It provides drivers for many different scanners, a daemon to manage access to all scanners attached to the system, and a command-line frontend application which implements basic scanning functionality.

Backend
SANE backends (a.k.a. drivers) are provided by the package.

The SANE project maintains a searchable list of supported (and some unsupported) devices. Find your scanner on that list, and note the values provided for Backend and (if it's a USB scanner) USB id, which will be needed for configuration.

In, set SANE_BACKENDS to a space-separated list of the backends that need to be installed, as obtained from the list on the SANE project website.

To see all supported backends, run:

or look on the SANE project's website.

Ensure that the proper USE flags are set to support your scanner's features, e.g. if it is a USB scanner, set the  flag.

It may also be necessary to change the kernel configuration to allow it to detect the scanner, e.g. for a USB scanner, USB support needs to be enabled in the kernel.

There is usually no need to explicitly install the backend package since it will be pulled in as a dependency of the frontend, but those who would like to do so anyway can run:

Frontend
The package provides one frontend application,. Most users will want to install another one. The SANE project maintains a list of frontends, many of which are available in Portage.

XSane is a capable default option. To install XSane or any frontend, check their USE flags. For example:

Install the package:

Configuration
Installing SANE creates the group. Any user account that is to access the scanner needs to get added to this group.

After changing the group membership, the affected user(s) will need to log out and into the system again.

In many cases, SANE simply works without any further configuration needed. To test this, ensure that the scanner is connected and powered on, and run

If the scanner is identified, as in the example above, everything is fine.

Troubleshooting
If is unable to identify the scanner, it will look like this:

In most cases, the first step to take in resolving this issue is to run  as root.

If the output does not contain a line saying that the scanner was detected, it probably will not work with SANE.

Assuming does find the scanner, as in the example above, there are a few things to check. First, try running as a non-root user. If it fails to detect the scanner when run this way, that means the problem is most likely permissions on the device node. The man page for the device type will have more information on how to handle this. For USB scanners:

For SCSI scanners:

Make sure that the correct device was identified, e.g. in the example above, check that the USB vendor and product numbers listed in the output match the USB id obtained from the SANE website. If not, it means that SANE is detecting something other than the scanner.

If the correct device is detected, it may be necessary to edit the configuration file for the corresponding SANE backend. These configuration files are located in. Each backend that gets installed has an associated configuration file with the same name, for example. The man page for the backend will have more information on what edits may be necessary, for example

Scanning over the network
SANE includes a daemon,, which allows other computers to use attached scanners over the network. To enable this feature, some configuration has to be done on both the server and client.

Server settings
There are two possible ways to configure your SANE server. The saned approach is the simplest of the two.

saned
Update to include the IP address or subnet of the clients that will be accessing this scanner server.

Add to your default runlevel and start it.

xinetd
The scanner daemon is called, by default, it listens to port 6566.

When using xinetd instead of starting the server directly, remember to enable saned by setting to  and allow your network to access the daemon :

If you want to access the server locally, also add to the allowed clients.

Don't forget to (re)start :

Client settings
Make sure to add the respective USE flag to be able to find scanners on the network:

Recompile the package:

This will generate the file :

Uncomment and replace the line  with either the hostname or the IP address of the sane server.

Check, if the server can be found now: