Sunday, January 17, 2010

Scanner Sharing over Network CAN Work in Ubuntu 9.10!

Can't sleep so I thought I'd share today's Linux-wrangling experience.

I have a Xubuntu 9.10 system designated as my file/print/everything else server. It has an HP All-In-One Deskjet F4135 printer/scanner combo attached to it. I wanted to be able to acquire images from my scanner directly to Gimp (image editing application) on my laptop from the comfort of my couch without having to bother with remote desktop connections, file transfers, etc., so I decided to share my scanner over the network. I had done this a few years back via xinetd, but after reading this link I was under the impression that they had greatly simplified the process of setting up a scanner as a network resource.

I followed the directions, then went to test my newly network-enabled scanner, but got nothing. I poked and prodded and checked help forums for a while, but got nothing. I even tried the old method of setting up a network scanner (via xinetd) but still nothing. Eventually I came across a suggestion on the sane FAQ page to run the sane daemon in debug mode by adding the "-d" flag. I ran it with the saned user, but still got nothing. I decided to try running as root and I was able to connect! After a little more poking around I found where my USB port was located in the file system - /dev/bus/usb/001 and saw that its owner was root but group was "lp". This is why I was able to share my scanner as root but not as saned - saned is neither root nor is it in the lp group, so it didn't have access to the scanner. I added the saned user to the lp group, restarted the saned daemon (under the saned user) then bam, network scanner access.

All this to say, scanner sharing over your LAN is as easy as the Ubuntu guide would lead you to believe, you just need to run the following command:
sudo adduser saned lp
...and you should be good to go. Just remember to restart the server daemon:
sudo /etc/init.d/saned restart

I found a bug report a few minutes ago indicating this has been a bug since Ubuntu 8.04. You can read there for more information. If I had read it earlier it would have saved me a lot of headache, but I wouldn't have had the satisfaction of figuring it out myself :)

No comments: