printing from Windows virtual machine on linux host

Thursday, April 03, 2008

It's great to be able to use a printer that you have defined in your linux host from within virtualised Windows guest OS (where the printer is either connected directly to your box or over a network). This post assumes you've already setup networking between your guest and host.

Firstly in your printer settings on the host, make sure access hasn't been restricted (open access by default on Ubuntu).
Find the name of the printer that you want to access (ie not the Description which is what appears in network browsing)

Then on the virtual windows machine (for XP):
Choose Add Printer
Select network printer
Select Printer on Internet
For the url, use:

http://{host ip}:631/printers/{CUPS printer name}
It won't be able to install missing drivers if they're not found (ie can't load the linux drivers into Windows), so find the drivers from somewhere and select the Have Disk option to point Windows at the .inf file.
Should be away laughing!

This howto is has more direct CUPS fiddling than is needed for Ubuntu now, but I got key information from there to find out the above.

run a open-source virtual machine with qemu

I use the awesome qemu open-source processor emulator, that lets you run virtual OSs (guests) on a host computer (on my Xubuntu box, in my case). Qemu has the power to have guest os's think they're on a box with entirely different processor types (eg have a PowerPC guest on a x86 box). But what I've found awesome is that with the relatively new Kernel Based Virtual Machine (aka KVM) on linux, with a supported processor, virtualisation goes right down to the cpu level - so it's fast!

If you're on linux and want to check if your processor does support it, use:

egrep '^flags.*(vmx|svm)' /proc/cpuinfo