Printing on a guest Windows VirtualBox

My development environment is a Fedora always up-to-date, but because of my role of architect I need to talk to other business departments, so sometimes I have to deal with Powerpoints or Excel spreadsheets that doesn’t work fine on Openoffice. I like Openoffice a lot, in fact I use it for several years, also I recommend it to mates, family and friends, but sadly not always is enough.

So finally I had to set up a Windows XP on VirtualBox. Well, the installation was very easy, I have shared some folders from Fedora so Win can browse them, but I missed printing from there. On Fedora I use CUPS to set up the network printers we have at our department through web interface you can access at http://localhost:631. Once you have a printer configured on CUPS (you must share it), you need to change your /etc/cups/cups.conf file in order to allow other machines to access the printer.

At the beginning of the file you need to add your machine’s name or the IP address so others will be able to access the printer. Before:

# Only listen for connections from the local machine.
Listen localhost:631
Listen /var/run/cups/cups.sock
# Show shared printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseLocalProtocols CUPS dnssd
# Default authentication type, when authentication is required...
DefaultAuthType Basic
# Restrict access to the server...
Order allow,deny
Allow From localhost
...
... the rest of the file

After:

# Only listen for connections from the local machine.
Listen localhost:631
Listen 192.168.6.20:631
Listen /var/run/cups/cups.sock
# Show shared printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseLocalProtocols CUPS dnssd
# Default authentication type, when authentication is required...
DefaultAuthType Basic
# Restrict access to the server...
Order allow,deny
Allow From localhost
Allow From 192.168.6.20
...
... the rest of the file

Then, as root, you have to restart the service:

service cups restart

To check that all is working, open a browser and go to http://YOUR_IP_ADDRESS_OR_MACHINE_NAME:631/printers/PRINTER_NAME. If you see your printer, then you will be able to configure it at your guest Windows as an Internet or network printer.

Advertisements

One thought on “Printing on a guest Windows VirtualBox

  1. Chris July 25, 2011 / 4:19 pm

    I have kinda the same rig running as you, and had to do the same because we have a few power point rangers that can’t/won’t adopt to OpenOffice. We have an access server that virtualizes Solaris 10 for everyone’s thin clients and they SSH to the programs they need on the productivity servers which are running Fedora. I installed VBox and Windows 7, it works great and can print, but I’ve noticed that it will enlarge the files 10 fold making a 1.34MB file turn into a 139MB file when it attempts to print.

    Have you run into something similar? I can’t for the life of me figure what is causing this, except maybe the fact that it is an Xsession and the data is redundantly being sent between the access server and the productivity server over it.

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