Network printing

This is for discussing general topics about how to use VirtualBox.
ashz
Posts: 20
Joined: 8. Jul 2007, 15:54

Network printing

Post by ashz »

I have a HP 2575 connected via Ethernet to my Buffalo wireless network.

It is currently located at 192.168.x.x

I'm running Ubuntu 7.04 and I am using Virtualbox to run Windows XP.

I want to be able to print from XP to my networked printer.

As far as I can tell that even though I have access to Internet etc etc on XP, it seems to be on a different subnet 10.x.x.x

I tried to connect using the "Add Printer" and selecting Networked Printer but to no avail, I knew the subnet was different but was worth a try :P

Any ideas peeps?

Laters
ash
Image

Image
stefan.becker
Volunteer
Posts: 7639
Joined: 7. Jun 2007, 21:53

Post by stefan.becker »

Can yo setuo the Printer on the Host, share this and connect this in the guest?
Ingo
Volunteer
Posts: 731
Joined: 22. Aug 2007, 10:13
Location: Germany

Post by Ingo »

It is a network printer and I'm afraid ashz is using the default NAT configuration. Does printing works through NAT?
I think he had then to set up Host Interface Networking.
ashz
Posts: 20
Joined: 8. Jul 2007, 15:54

Post by ashz »

Hey Peeps,

I have now got it working thanks.

The default NAT setup does work, I didn't need to mess with the networking!!

I am using Ubuntu 7.04 with Windows XP as a Guest OS, but I'm sure this will work similarly with other Host OS's running XP.

If you go to add the printer in Control Panel on the Guest XP OS, you select Network Printer then select the "Connect to a printer on the Internet or on a home or offfice network" option.

In the URL field below that you need to type it in this format.

http://DEFAULTGATEWAY:631/printers/PRINTERNAME

The Default Gateway of my XP OS is 10.0.0.2 and my printer name is Photosmart_2570 so mine looked like this.

http://10.0.2.2:631/printers/Photosmart_2570

Then after you click Next it will ask you to install the driver for it.

Edit: BTW Make sure that the internet firewall has the port open otherwise it MIGHT not work.

Hope that helps.

Laters
ash
Image

Image
Ingo
Volunteer
Posts: 731
Joined: 22. Aug 2007, 10:13
Location: Germany

Post by Ingo »

Hello ash,
cool
thank you for the feetback.
But the printer can't connect to your VM. Can you get some messages from the printer like:
"the red ink is empty" or
"printer doesn't print" ?
If so, the connection from the client to the printer must be established during the hole print time.
ashz
Posts: 20
Joined: 8. Jul 2007, 15:54

Post by ashz »

Here is a test page through VM before you asked your question.

Image

I know you say that the printer cannot connect to my VM but it can and it has!!

I cannot get those messages you asked for mainly because everything is okay with my printer and i have got no errors :P

laters
ash
Image

Image
Ingo
Volunteer
Posts: 731
Joined: 22. Aug 2007, 10:13
Location: Germany

Post by Ingo »

Hi ash,
this discussion isn't really important but I can not sleep if I don't know that we exactly mean the same thing. If you do not get any responses from the printer then it is furthermore unclear for me.
Let me explain it a little more detailed what I mean:
your network from the VM is connected to the host through a network address translation. So your VM can reach any external address, google, Microsoft, printer. If Microsoft will send you a web page they can't reach your VM, that's OK. NAT doesn't allow this exept you have configured a port forwarding but you say "I didn't need to mess with the networking!!".
So printing from the VM to the printer will work fine as you described. If the printer will send you a message "print finished" (I know this from many windows printer) it should'nt be able to connect to your VM. Or the VM established a print job, prints and waits for an answer. But how long it will wait if you like to print the VirtualBox User Manual? Does the first print job open the connection to the printer for ever?
ashz
Posts: 20
Joined: 8. Jul 2007, 15:54

Post by ashz »

The idea of a NAT is once you have established a connection, for example printing a document then it will allow traffic it is expecting back to it.

So yes the printer can communicate to the guest host as long as the guest host first makes a connection.

The first job opens the connection to the printer just for that session.

Never mind anyways we have gone off topic.

Laters
ash
Image

Image
Ingo
Volunteer
Posts: 731
Joined: 22. Aug 2007, 10:13
Location: Germany

Post by Ingo »

Yes, forget it. I'll take a sleeping pill.
TC
Posts: 1
Joined: 14. Apr 2008, 07:20

CUPS

Post by TC »

I followed the directions, and managed to get my printer working. However, the method you are using seems to use the Host OS/CUPS server. If anyone knows how to use the samba server on the Windows computer that the computer is attatched to by using the IP address of that computer it may help people trying to print to Winprinters...
Soulthiefuk2000
Posts: 11
Joined: 12. Apr 2008, 18:21

Post by Soulthiefuk2000 »

Hi TC,

I think what they were talking about was network printers, ie printers that connect directly to the network not to a PC. With these there is no need to use the host cups server, you connect to them directly.
Perhaps you mean something like my setup ? I have a W2K3 server with a Lexmark usb printer attached. On the same physical network I have a Ubuntu host running VB with a WinXP guest. On the guest I run the driver install CD and select 'Connect to a networked printer', when it asks for the address I put in the ip address of the W2K3 server - NAT handles the rest. Of course, you must be sharing the printer on the computer you're connecting to.
Windows computers don't run Samba. Samba is an implementation of the SMB protocol. I also have a computer running Suse on the main network, I use Samba to share some directories on this machine. To map a drive to it from the WinXP guest machine I just pull up Windows Explorer, select map network drive and type in the ip address of the machine I want to map to and the share name.
Don't get confused by the 'virtual' part. Virtual machines behave exactly (almost) the same as 'real' machines. Accessing network resources is the same whether you're using a real machine or a virtual one.

Hope this helps.

John.
wordchisler
Posts: 5
Joined: 20. Mar 2008, 02:52

Network Printer - HP Officejet K550

Post by wordchisler »

In case this will help someone else:

I did not want to change the virtualbox machine network settings either, but the above instructions via control panel did not work (i.e., Windows added the printer but could not print to it) and the HP installation software could not find the printer at all.

Reading on another website that NAT allows access to network printers and not wanting to deal with bridging, I loaded the printer installation software one more time. This time I noticed an option to install a printer not on the network. I tried that option and added the IP address which showed on the Linux "HP Printer Test Page" as Host. That worked.

Maybe the same IP address would have worked with one of the Control Panel add network printer options.
syndardt
Posts: 4
Joined: 20. May 2008, 11:21

Post by syndardt »

Hi ashz.

Many thanks for this tip. I've been beating my brains out for days trying to follow other how-tos to print from my xp in VirtualBox to my printer in Hardy, but yours worked like a charm without the brain-beating. :lol:

Daniel
ashz wrote:Hey Peeps,

...

In the URL field below that you need to type it in this format.

http://DEFAULTGATEWAY:631/printers/PRINTERNAME

The Default Gateway of my XP OS is 10.0.0.2 and my printer name is Photosmart_2570 so mine looked like this.

http://10.0.2.2:631/printers/Photosmart_2570

...
ash
pdcd
Posts: 3
Joined: 30. May 2008, 11:29

Post by pdcd »

I am running Windows XP and also a virtual machine running Windows XP within, and no matter what I do I cannot get my printer shared. I tried doing it via USB, I tried doing it via the network. I opened all my firewall stuff, I added the USB stuff in the settings and it just can't find it. The USB icon in the lower right of VirtualBox always says no USB devices are being shared, despite me telling it to in the config (it even copies out all the info for you and saves it!). I tried the instructions above and nothing worked.

When I boot up, and sometimes when I use the printer software to install drivers, it sometimes gives me a "new hardware found" thing, for "base system device". I point it at everything I can think of as far as printer drivers, and even the drivers that come with the VirtualBox install, and nothing works. Help!
Paul Abrahams
Posts: 141
Joined: 2. Jun 2008, 17:49

Post by Paul Abrahams »

ashz wrote: The default NAT setup does work, I didn't need to mess with the networking!!

I am using Ubuntu 7.04 with Windows XP as a Guest OS, but I'm sure this will work similarly with other Host OS's running XP.

If you go to add the printer in Control Panel on the Guest XP OS, you select Network Printer then select the "Connect to a printer on the Internet or on a home or offfice network" option.

In the URL field below that you need to type it in this format.

http://DEFAULTGATEWAY:631/printers/PRINTERNAME

The Default Gateway of my XP OS is 10.0.0.2 and my printer name is Photosmart_2570 so mine looked like this.

http://10.0.2.2:631/printers/Photosmart_2570

Then after you click Next it will ask you to install the driver for it.

Edit: BTW Make sure that the internet firewall has the port open otherwise it MIGHT not work.

Hope that helps.

Laters
ash
I have a networked printer.

What is the 631 about? Is that a constant or does it depend on my system?

That method wouldn't seem to work if there are two identical printers on the network. Is there a way to do this using the printer's IP address (in my case, 192.168.0.14) instead of its name?

I'm looking for a way to get at the printer without dancing the host networking quadrille.

If the answer to my question is somewhere in the user manual, where is it? I looked for it but couldn't find it.
Post Reply