Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a weird situation. I own a printer that has 0 support in linux, but of course, it works in windows. So I have installed VirtualBox 3.1.2 with guest additions to provide access to my usb devices. I have successfully setup the printer and the guest os can print fine.

Now, the question is: Is there any way to make this printer accessible to the host OS?

I noticed that the guest OS takes an ip address of 10.0.2.15, but when I try to ping that address from the linux host, it goes nowhere. No response.

Has anyone here done this before? can anyone think of a way to do this?

share|improve this question

migrated from stackoverflow.com Feb 11 '10 at 18:47

This question came from our site for professional and enthusiast programmers.

    
What model is the printer? –  Steiv Feb 11 '10 at 19:28
add comment

1 Answer 1

The next step you need to take is to open up the Windows File and Printer sharing ports in VirtualBox's "virtual router". These commands should do the trick:

VBoxManage setextradata "MyVM" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/winprintsharing137/Protocol" UDP
VBoxManage setextradata "MyVM" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/winprintsharing137/GuestPort" 137
VBoxManage setextradata "MyVM" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/winprintsharing137/HostPort" 137
VBoxManage setextradata "MyVM" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/winprintsharing138/Protocol" UDP
VBoxManage setextradata "MyVM" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/winprintsharing138/GuestPort" 138
VBoxManage setextradata "MyVM" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/winprintsharing138/HostPort" 138
VBoxManage setextradata "MyVM" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/winprintsharing445/Protocol" UDP
VBoxManage setextradata "MyVM" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/winprintsharing445/GuestPort" 445
VBoxManage setextradata "MyVM" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/winprintsharing445/HostPort" 445
VBoxManage setextradata "MyVM" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/winprintsharing139/Protocol" TCP
VBoxManage setextradata "MyVM" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/winprintsharing139/GuestPort" 139
VBoxManage setextradata "MyVM" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/winprintsharing139/HostPort" 139
VBoxManage setextradata "MyVM" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/winprintsharing445/Protocol" TCP
VBoxManage setextradata "MyVM" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/winprintsharing445/GuestPort" 445
VBoxManage setextradata "MyVM" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/winprintsharing445/HostPort" 445

Replace "MyVM" with the name of the virtual machine you are configuring. The VBoxManage utility should be in the same directory where you installed VirtualBox.

After that, you can share the printer from the Windows guest OS. You'll need some way to get Linux to use the shared printer - I'm not 100% sure if that is possible or how easy it would be.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.