share printer connected to Ubuntu from Windows XP on VirtualBox

This is as straightforward as setting up a network printer from Windows XP.

First of all you’ve got to set up a private network connection between the host and the guest operating system.

Then you have to make sure that CUPS is accepting connection from other hosts.

When finished with all this foreplay, you can go ahead and use the printer from Windows XP. Boot your VirtualBox and enter Windows XP. Go to Start -> Settings -> Printers and Faxes. Click on Add a printer. Tell the wizard that you wish to add a network printer. Specify that you want to Connect to a printer on the Internet or on a home or office network. Specify the URL of your printer. It should be something like:

Where in printer-name you should replace the name of your printer. Complete the installation of your printer by specifying the driver to be used. You should now be able to print from your Windows XP now.

This entry was posted in Uncategorized. Bookmark the permalink.

12 Responses to share printer connected to Ubuntu from Windows XP on VirtualBox

  1. steve says:

    Great post, but I have one bizarre problem. Whenever I print from the virtual machine, a watermark is printed. I have made sure this feature is off both on the VM (XP) and host (ubuntu) but it makes no difference. Any suggestions?

  2. Peter says:

    Thanks for the post. I got it to work after disabling firestarter and Windows firewall – and finally working out the address of my printer. However, then I rebooted and couldn’t connect. So I then edited the /etc/rc.local script as you suggested. But then Virtual box gave me an error to do with permissions and wouldn’t start.

    So I retraced and did everything again. But this time I lost all connectivity. I couldn’t ping the printer, I couldn’t access the internet in either Ubuntu or XP.

    So in the end I disabled the new adapter in VB. I regained connectivity to the internet.

    So this is really a long way of saying is there any advice you can give me to get the printer working again? If there are any commands I would appreciate them.

    BTW I have Ubuntu Hardy on AMD64 with latest VirtualBox as host and XP as the guest.

  3. eha1990 says:

    Your solution worked perfectly for me. I’m now able to printer from Windows XP guest OS to my HP LaserJet 1020 printer connected to my Ubuntu 8.10 host. When I first used I did get an error message which I immediately knew how to resolve since I have experience with setting up network perinters. I knew that was the default gateway for the computer that you used within your example. To resolve the problem, I ran an ipconfig to get the IP address information on the guest computer, and changed your statement to reflect the default gateway of my guest OS which is:

    The average person may not know how to resolve this problem. A more accurate/universal way to state your resolution would have been to say


    I’m just making a friendly suggestion. I appreciate your solution though, it definitely worked for me. I have no reason to boot into Windows now other than to play games. I’m running VirtualBox 2.0.4 on Ubuntu 8.10 in seemless mode without any problems with playing sound in the guest OS or printer from the guest OS to my printer connected to my computer running Ubuntu 8.10.

  4. Daniel Meyer says:

    I got virtualbox printing to the host’s printer using these instructions. (The host is Mandriva 2009.1). I didn’t have a Listen localhost:631 line in my /etc/cups/cupsd.conf, so I didn’t add a Listen *:631 line there, but it still worked.

    Thanks for this write-up!!

  5. alex says:

    Patrioti kai adelfe,

    i have the following situation: host ubuntu 9.04, guest XP. all instructions followed and everything looks ok. however when i click to print, i get a job completed but CUPS but there is no activity on the printer… any suggestions?

    euxaristw prokatavolika.

  6. Ben says:

    What version of VirtualBox are you using? I can select Attached to: Host Interface and select tap0 from a list, but I can not find Host Interface Settings. Then when I go into windows, I can not see tap0 in network connections.

  7. Simon says:

    Setting up the private network works just fine, unfortunatly, i cannot get access to the cups printer share. alle i get is a http 403….

    any ideas?

    thank you for your post.

  8. asdir says:

    The howto is form 2007. Is it still that complicated?

  9. badcam says:

    I’m getting a massage in the XP VB, saying that I “do not have access to the printer, please try another username or password.”

    I can ping either way and I have changed the cupsd.conf.

    Can anyone help? Thanks.

  10. badcam says:

    Ah. I spoke too soon. I’ve found the solution in another article:

    Using Ubuntu 8.04 host, from Win2000 in VirtualBox, I got an “access denied” message in Add Printer dialog, until adding this “Allow from” line to cupsd.conf:
    # Restrict access to the server…

    Order allow,deny
    Allow from 10.0.1.*

  11. Thank you so much, this worked great for me!

    The only detail missing is that I needed to go into the CUPS administration in Ubuntu and turn network sharing on. Here’s how to do it:

    Go to with your web browser (you’re logging in to your own computer). In the Server section check “Share printers connected to this system”. Then click Change Settings.

  12. pizaninja says:

    On Ubuntu 10.10, nothing can be plugged on with default installation…

Leave a Reply

Your email address will not be published. Required fields are marked *