Epson V500 and 64bit Linux

Some days ago my old and beloved Pentium IV mother board left me, after a heart-rending lament from sata bus. Being quite difficult to find a replacement for such a motherboard, I’ve bought a brand new MoBo and a new processor as well, a nice 64bit amd. After some tweaking, my pc was up and running again..almost.

The problem was that I had a Epson V500 scanner of which I was pretty satisfied, but that uses binary drivers. I know that this one good reson for not using those devices under linux, but until my machine was 32bit based I’ve had no big problems. I don’t know why hardware vendors keeps providing people with closed-source binary drivers, a self-destructive attitude that I fail to understand, but that’s it. Anyway, when I tried to install linux drivers for my scanner my gentoo installer warned me that it was impossible to have iscan working on a 64bit os, and that maybe also with sane the result won’t be different. A bit disappointing, I can assure you. In fact, this time even google was not helpful.

After some thinking I found a working solution; it’s a complex, overkill, heavyweight solution…but extremely fun to implement. I really hope that someone will tell me a more elegant and simple solution or, even better, Epson will decide to make a 64bit driver….or maybe to open all the drivers. Seeesshh. Ok, stop dreaming and let’s talk about a solution, quite straightforward. Epson drivers wants a 32bit machine? Fine, let’s give it to them.

In few words, I’ve installed a kvm 32bit virtual machine. In this machine I’ve installed iscan epson drivers and saned; saned, in turn, can make the scanner available on network. So the main (host) machine can access the scanner, using some sane frontend via network interface. Basically the virtual machine acts as a big (huge, in fact) driver for the scanner.

Of course there is more than one way to accomplish this, once the basics are clear. I’ll detail here what I’ve done, but YMMV, as usual.

First, install a virtual machine. You have different choices among vm, xen and kvm being the more promising. Judging from the documentation kvm seemed more easy and straightforward to install so I’ve chosen it. Kvm has another big advantage over “competitors”: it’s mainstream, that means that it’s available on stock vanilla linux kernels. No time to waste with patching or being stuck waiting for someone to patch latest Linus kernel.

Kvm site can give you directions on how to install it, as well as your distro site. I’m using gentoo, if you are using Gentoo as well, go here for a nice howto. A couple of hints: the suggested command line

kvm -hda gentoo-i386.img -cdrom livecd-i686-installer-2007.0.iso -boot d

didn’t worked for me, as the gentoo live cd I’ve chosen to install won’t work with the 128MB of ram, the default for kvm: it will choke on depmod, with a nice OOM Killer shot. To add a -m 1G can be overkill, but it worked for me. I guess that 256 or 512m can be enough, anyway the command line becomes

kvm -1G -hda gentoo-i386.img -cdrom livecd-i686-installer-2007.0.iso -boot d

With the help of gentoo howto I manged to install a working 32bit machine. You need network as well, so look here. Of the different network arragements suggested here, I’ve chosen public bridge: your driver must be available to host machine, and maybe to other networked hosts.

Once your virtual machine is installed and boots with a working network, you need to install iscan and sane with your usual distro tools. With gentoo I suggest to place a “-X” use flag in make.conf: you don’t need X or other graphical interfaces in a vm that basically will be acting as a driver, so you can get rid of a lot of graphic libraries and other similar crap. If you don’t use Gentoo…well, never mind.

Now you have to fire up your new virtual machine, providing it with the USB interface to access the scanner. kvm has a command line option to activate USB device; I use theĀ  vendor_ID and product_ID to pass the right device to virtual machine. Launch lsusb on host machine to get your scanner data:

kefk ~ # lsusb
[...]
Bus 002 Device 005: ID 04b8:0130 Seiko Epson Corp.
[...]

the command line to fire up kvm machine becomes:

kvm -m 1G -hda gentoo-i386.img -net nic,macaddr=DE:AD:BE:EF:15:5 -net tap -usb -usbdevice host:04b8:0130

being gentoo-i386.img the image created with the installation above.

At this point, scanimage -L should show you the scanner.

Almost done. Besides sane, you need xinetd as well, so install it. Once again, gentoo provides you with a nice howto for sane setup; look at paragraph “9″. Of course you will have to configure xinet.d to start at boot (rc-update add xinetd default on gentoo), but anyone that installed linux machines should be quite familiar with that details.

On the host machine you will need to install some sane frontend (xsane, etc..) as well as iscan (It will take care of sane configuration). Be careful to correctly set the virtual machine IP in /etc/sane.d/net.conf on host machine, otherwise the frontent will never be able to find the networked scanner.

Now all should be set: fire up kvm with the above command line, then launch xsane on host machine. After some seconds spent searching for the scanner, xsane will prompt you with the usual interface: start scanning :)

You can be proud: you installed a full featured virtual machine to use it as a scanner driver. Cool. I really hope that someone will come out with a better solution!!

As improvement, you can use virtio drivers in kvm for hd and network device, but this is not needed for the “scanner driver” use; please refer to kvm pages for a lot of useful hints oh how to play with virtual machines.

Please: let me know if you have improvements to suggest…

Print This Post Print This Post

1 comment so far ↓

#1 Stephen on 07.01.09 at 05:24

You may be aware of it by now, but iscan comes in 64 bit these days.

Leave a Comment

Powered by WP Hashcash