2

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?

1
  • What model is the printer?
    – Steiv
    Feb 11, 2010 at 19:28

1 Answer 1

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.

You must log in to answer this question.