RSS Feed

Arch Linux with Canon iP1600 printer (virtualisation)


Finally, I solved the problem doing printing with my Arch Linux with Canon iP1600 printer. It is an old printer. With several tries of those drivers mentioned in forums and other discussions, I never success to use this printer with Arch Linux. That is why, whenever I want to print, I need to reboot into Windows 7, print, then reboot into Arch Linux again. This is really troublesome.

However, recently, I found a possible solution. That is using hardware virtualisation. Actually, it is using the guest OS to detect the printer, then print from the guest OS. So, my guest OS is still Windows. Meaning that, Linux is still not working with Canon iP1600. But, this solution avoid rebooting for different OSes.

Hardware virtualisation can use either VirtualBox or QEMU. VirtualBox is easier to be used. QEMU can be used with Qemu Launcher.  VirtualBox provides easier way for USB virtualisation. Just go to the setting and add the USB device that you want to virtualise. But make sure the user is in “vboxusers” group. Besides that, we need to know the vendor ID and product ID of the USB device (that’s printer). When booting into the guest OS, such as Windows XP, then we can detect the USB printer. Now, I can print as I like.

For the QEMU, it is a little problematic. This is because the virtualisation of the device requires that the driver of the device is unloaded from the kernel. The next problem is that several options need to be added to the command-line for the hardware virtualisation. I tried this on the USB pendrive only, not with the USB printer.

The command is something like this:

qemu -boot d -m 512 -hda 'xp.img' -usb -usbdevice host:0951:1625

0951 is vendor ID and 1625 is product ID, we can get this with “lsusb”

Now, go back to the problem of unloading the driver from the kernel. This is something which cannot be done through command-line (based on what I know). Therefore, I solved this by writing a small command-line using libusbx (a fork of libusb) API.  Yes, only through the API, I can manage to unload the driver (or module) from the kernel. (I uploaded the pre-compiled command, it is available here. The command also allows to re-attach the module to the kernel.)

With this, my USB pendrive can be detected in the guest OS in QEMU. I think it will also work with the USB printer. However, I choose VirtualBox rather than QEMU, because of the ease of use.

VirtualBox is very good. For me, the greatest limitation of the hardware virtualisation is the graphic card. I am still cannot using VirtualBox to play the 3D games yet. If this can be solved, then I can never boot into Windows anymore.

About Allen Choong

A cognitive science student, a programmer, a philosopher, a Catholic.

One response »

  1. Pingback: Arch Linux and Canon PIXMA iP1600 « Allen's Blog 2.0

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: