LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Sharing Linux USB printer with Windows (https://www.linuxquestions.org/questions/linux-networking-3/sharing-linux-usb-printer-with-windows-4175693230/)

chicagocoyote 04-06-2021 05:15 PM

Sharing Linux USB printer with Windows
 
We are trying to let a Window 10 laptop print to
a USB printer attached to my Fedora 32 box.

The host name of the Linux box has been set as by root as follows:

Code:

  hostnamectl set-hostname george
The printers name, as set by the Fedora print admin tool is:
HP_LaserJet_P2035


As root, I executed the following commands:

Code:

  cupsctl --share-printers

  lpadmin -p HP_LaserJet_P2035 -o printer-is-shared=true

  lpadmin -p HP_LaserJet_P2035  -E -v ipp://george/printers/HP_LaserJet_P2035 -m everywhere


Then, on the Windows 10 laptop, we installed a network printer
with the following address:

Code:

  http://george:631/printers/HP_LaserJet_P2035

Port 631 is the IPP port, as specified by /etc/services


So far, we have been unable to print from Windows. The Linux USB
printer has installed under Windows, but when trying to print we get
the useful error messages: "Error Printing".

Can anyone help us out?
Thank you for your time.

Emerson 04-06-2021 06:04 PM

Can your laptop resolve this hostname george (ping george)?

michaelk 04-06-2021 06:07 PM

Do you have a local DNS running that will resolve george to a real IP address? If not you will need to use the computers LAN IP address. If the computer is using DHCP you will need to use an address reservation in the router so it will stay the same.

Too late...

chicagocoyote 04-06-2021 06:28 PM

Quote:

Can your laptop resolve this hostname george (ping george)?
Yes, executing "ping george" on the laptop is successful.

michaelk 04-06-2021 09:21 PM

Code:

lpadmin -p HP_LaserJet_P2035  -E -v ipp://george/printers/HP_LaserJet_P2035 -m everywhere
As far as I know this would create a queue that points to itself which I don't think would actually work. Do you have a queue where the URL is a USB:// or similar?

ferrari 04-06-2021 10:00 PM

Do you have an active firewall on the Linux print server perhaps?

This might be worth reviewing too...
http://www.auxnet.org/index.php/the-...-in-windows-10

chicagocoyote 04-06-2021 10:25 PM

Quote:

Do you have an active firewall on the Linux print server perhaps?
Great suggestion. I brought up the Firewall Configuration tool
and under "public | Services" I checked the "ipp" box.


Now, when the laptop tries to print, lpq as root lists jobs in
the queue:

Code:

  [root@george cups]# lpq
  HP_LaserJet_P2035 is ready and printing
  Rank    Owner  Job    File(s)                        Total Size
  active  LAPTOP\ 214    Test Page                      248832 bytes
  1st    LAPTOP\ 215    Test Page                      248832 bytes

However, the jobs just hang there and the printer does not print.
.

chicagocoyote 04-06-2021 10:45 PM

Success. As someone suggested, maybe I should not have executed:

Code:

  lpadmin -p HP_LaserJet_P2035  -E -v ipp://computer-room01/printers/HP_LaserJet_P2035 -m everywhere
So I used the Printer Configuration tool under Fedora and
deleted the printer, then re-added it. Now, the Windows laptop
can print.

Thank you everyone.

Jeffery21 04-11-2021 12:06 AM

Quote:

Originally Posted by chicagocoyote (Post 6238035)
Success. As someone suggested, maybe I should not have executed:

Code:

  lpadmin -p HP_LaserJet_P2035  -E -v ipp://computer-room01/printers/HP_LaserJet_P2035 -m everywhere
So I used the Printer Configuration tool under Fedora and
deleted the printer, then re-added it. Now, the Windows laptop
can print.

Thank you everyone.

The biggest issue you'll run into is that the printer won't work if the source machine is turned off.
Install as a USB printer on one device, then navigate to the printer and instal as a network printer on the other. That's how I believe it went down.
If they're on the same network, you can connect the printer to one of them and then share it so the other machine can access it across the network.


All times are GMT -5. The time now is 05:14 PM.