Printer in wine on OS X?

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
lschafroth
Level 2
Level 2
Posts: 14
Joined: Wed Jul 08, 2009 2:59 pm

Printer in wine on OS X?

Post by lschafroth »

I have installed Wine via macports on my Leopard machine. I have a printer installed on the MAC but apparently this is not using CUPS?

Can someone help me install a printer via cups on the mac and also, how do I get a start menu or somewhere to run my applications without having to run them from a command line?

If this works, I will not be able to have my teachers run apps from a cli. There will need to be a shortcut or something on their DOCK or desktop.

Thanks!!

Lannie
lschafroth
Level 2
Level 2
Posts: 14
Joined: Wed Jul 08, 2009 2:59 pm

Post by lschafroth »

I was able to go to http://localhost:631/printers and I could manage the CUPS service on my MAC. I set the default printer.

wine still does not see any printers.

Lannie
austin987
Wine Developer
Wine Developer
Posts: 2383
Joined: Fri Feb 22, 2008 8:19 pm

Printer in wine on OS X?

Post by austin987 »

On Wed, Jul 8, 2009 at 3:24 PM, lschafroth<[email protected]> wrote:
I was able to go to http://localhost:631/printers and I could manage the CUPS service on my MAC.  I set the default printer.

wine still does not see any printers.

Lannie





Can you see the printer in 'wine notepad'?

--
-Austin
lschafroth
Level 2
Level 2
Posts: 14
Joined: Wed Jul 08, 2009 2:59 pm

Post by lschafroth »

no. if I click on printers in notepad it says you have no printers installed.

I even added a different HP 4200 printer via the IPS service in OS X and it did not show either.

Lannie
lschafroth
Level 2
Level 2
Posts: 14
Joined: Wed Jul 08, 2009 2:59 pm

Post by lschafroth »

I must say I am impressed with how fast apps run in wine on my Leopard machine. It just happens to be the most important program I need requires a default printer or it quits. Once this works, I am golden!!

Lannie
Martin Gregorie

Printer in wine on OS X?

Post by Martin Gregorie »

On Wed, 2009-07-08 at 15:34 -0500, lschafroth wrote:
no. if I click on printers in notepad it says you have no printers installed.

I even added a different HP 4200 printer via the IPS service in OS X
and it did not show either.
Do you have nmap available on your MAC? If so "nmap localhost" should
show all the ports its services are listening on.

If CUPS is running and is correctly configured, nmap should list port
631. That is the Internet Printing Protocol (IPP).


Martin
lschafroth
Level 2
Level 2
Posts: 14
Joined: Wed Jul 08, 2009 2:59 pm

Post by lschafroth »

If you notice in my earlier post, I am able to browse my CUPS service via the browser. http://localhost:631/printers

I can see all my printers there.

Lannie
Martin Gregorie

Printer in wine on OS X?

Post by Martin Gregorie »

On Wed, 2009-07-08 at 15:24 -0500, lschafroth wrote:
That only shows that CUPS can see your LJ5, not that another program can
see CUPS.

That why I suggested using nmap. If it can see CUPS when run from the
login where you run WINE, then you'll have verified that the problem is
not with your OS. Another way is to use netcat (known as nc in some
incarnations). If you do 'nc' to the printer, you can see what happens:

$ nc localhost 631
$
[socket closed straightaway]

This means CUPS isn't listening or has some other error.

$ nc localhost 631
[you don't get a prompt straight back]
Hello world
[you get an HTML page back reporting a 405 error]
$

This means that CUPS is alive and listening to port 631.


Martin
James McKenzie

Printer in wine on OS X?

Post by James McKenzie »

lschafroth wrote:
If you notice in my earlier post, I am able to browse my CUPS service via the browser. http://localhost:631/printers

I can see all my printers there.


I had a Stylus C86 installed here and when I pull up the print dialog I get

WINEPS Printer using LPR. This is not CUPS support.

BTW, I am using a home-built version of Mike Kronenberg's Wine for OSX
build, which has a printer fix patch that fixes printers on MacOSX.
Maybe it is time to get the patch into Wine.

James McKenzie
austin987
Wine Developer
Wine Developer
Posts: 2383
Joined: Fri Feb 22, 2008 8:19 pm

Printer in wine on OS X?

Post by austin987 »

On Wed, Jul 8, 2009 at 9:52 PM, James
McKenzie<[email protected]> wrote:
lschafroth wrote:
If you notice in my earlier post, I am able to browse my CUPS service via the browser.  http://localhost:631/printers

I can see all my printers there.


I had a Stylus C86 installed here and when I pull up the print dialog I get

WINEPS Printer using LPR.  This is not CUPS support.

BTW, I am using a home-built version of Mike Kronenberg's Wine for OSX
build, which has a printer fix patch that fixes printers on MacOSX.
Maybe it is time to get the patch into Wine.
I don't see any such patch in the zipfile on his website.


--
-Austin
lschafroth
Level 2
Level 2
Posts: 14
Joined: Wed Jul 08, 2009 2:59 pm

Post by lschafroth »

yes, if I can find the patch I will gladly test it.

Lannie
lschafroth
Level 2
Level 2
Posts: 14
Joined: Wed Jul 08, 2009 2:59 pm

Re: Printer in wine on OS X?

Post by lschafroth »

Martin Gregorie wrote: $ nc localhost 631
$
[socket closed straightaway]

This means CUPS isn't listening or has some other error.

$ nc localhost 631
[you don't get a prompt straight back]
Hello world
[you get an HTML page back reporting a 405 error]
$

This means that CUPS is alive and listening to port 631.

Martin
I tried the command above and it just sits there. It does not end at all, but never returns anything. I ended up killing the process.

Lannie
lschafroth
Level 2
Level 2
Posts: 14
Joined: Wed Jul 08, 2009 2:59 pm

Post by lschafroth »

I removed wine via macports and installed Mike Kronenberg's Wine.

It now sees the printers just fine but now it has no audio of any kind. Anyone know how to enable the audio?

Lannie
lschafroth
Level 2
Level 2
Posts: 14
Joined: Wed Jul 08, 2009 2:59 pm

Post by lschafroth »

So I am stuck with two choices:

1:) Use Macports to install wine which has sound and ran programs fine, but could not see the printers.

2:) Use Darwine which sees the printers but has no audio. Another thing that Darwine does that is very annoying is when you run a program it pops up a bash window and another log window. I dont need those and neither will my end users want to see those. Darwine installs version 1.1.21.

Any suggestions on which route would be the easiest to fix?

Lannie
Martin Gregorie

Printer in wine on OS X?

Post by Martin Gregorie »

On Thu, 2009-07-09 at 08:15 -0500, lschafroth wrote:
Martin Gregorie wrote:
$ nc localhost 631
$
[socket closed straightaway]

This means CUPS isn't listening or has some other error.

$ nc localhost 631
[you don't get a prompt straight back]
Hello world
[you get an HTML page back reporting a 405 error]
$

This means that CUPS is alive and listening to port 631.

Martin
I tried the command above and it just sits there. It does not end at
all, but never returns anything. I ended up killing the process.
Are you quite sure that CUPS is using port 631?

Its worth checking, so run the following command as root:

netstat -apn | grep ':631'

netstat shows a lot of garbage, so I've used grep to only show the IPP-
related lines. If you're not running it as root you'll see '-' instead
of the pid and program name: netstat has to run as root to get the name
of the program using each port. On my system I see:

tcp 0 0 0.0.0.0:631 0.0.0.0:* LISTEN 2523/cupsd
tcp 0 0 :::631 :::* LISTEN 2523/cupsd
udp 0 0 0.0.0.0:631 0.0.0.0:* 2523/cupsd

which says that cups is listening on port 631 for incoming TCP/IP
connections using IPV4 and IPV6 protocols and for UDP datagrams. netstat
lines contain a lot more whitespace than I've shown so I edited the
blanks out to make it more readable. If you've disabled IPV6 on your Mac
then you'll only see the first and third of these lines.

If netstat shows that cupsd (the CUPS printing service) owns port 631
then the CUPS configuration is incorrect, because it has opened the port
but is ignoring any attempts to connect to it. Double check that you
have CUPS configured to listen for 'internet connections' - on my Fedora
10 distro this is disabled by default.


Martin
lschafroth
Level 2
Level 2
Posts: 14
Joined: Wed Jul 08, 2009 2:59 pm

Post by lschafroth »

your netstat command returned unknown parameters on my mac. I ran just netstat with no arguements and found the line:

40a0cc0 stream 0 0 424fe60 0 0 0 /private/var/run/cupsd

Not sure what options will show what you need.

Lannie
lschafroth
Level 2
Level 2
Posts: 14
Joined: Wed Jul 08, 2009 2:59 pm

Post by lschafroth »

lannie-macbook:~ lschafroth$ netstat -na | grep LIST
tcp4 0 0 127.0.0.1.631 *.* LISTEN
tcp6 0 0 ::1.631 *.* LISTEN
Gert van den Berg

Printer in wine on OS X?

Post by Gert van den Berg »

On Thu, Jul 9, 2009 at 16:50, Martin Gregorie<[email protected]> wrote:
Its worth checking, so run the following command as root:

       netstat -apn | grep ':631'
The -p option does not work on my MacBook (OS X Tiger) (Windows >= XP
SP2 has a similar -b option) and uses . as a separator between the
port and IP. (CUPS is running on my macbook...)

The nearest OS X-compatible version would be:
netstat -an |grep '\.631[^0-9.]'

telnet might be an another way to test instead of netcat as well. (My
OS X has netcat installed though (My Ubuntu needed it to be
installed...), so it should not be neccesary)

telnet 127.0.0.1 631

You should be able to disconnect the telnet session with Ctrl+] > q

Gert
lschafroth
Level 2
Level 2
Posts: 14
Joined: Wed Jul 08, 2009 2:59 pm

Post by lschafroth »

This is from my /etc/services

# John Hadjioannou <[email protected]>
ipp 631/udp # IPP (Internet Printing Protocol)
ipp 631/tcp # IPP (Internet Printing Protocol)


Lannie
lschafroth
Level 2
Level 2
Posts: 14
Joined: Wed Jul 08, 2009 2:59 pm

Post by lschafroth »

lannie-macbook:etc lschafroth$ netstat -an |grep '\.631[^0-9.]'
tcp4 0 0 127.0.0.1.631 *.* LISTEN
tcp6 0 0 ::1.631 *.* LISTEN

Lannie
Martin Gregorie

Printer in wine on OS X?

Post by Martin Gregorie »

On Thu, 2009-07-09 at 09:57 -0500, lschafroth wrote:
your netstat command returned unknown parameters on my mac. I ran just netstat with no arguements and found the line:

40a0cc0 stream 0 0 424fe60 0 0 0 /private/var/run/cupsd

Not sure what options will show what you need.
See my last -you need 'netstat -apn'


Martin
lschafroth
Level 2
Level 2
Posts: 14
Joined: Wed Jul 08, 2009 2:59 pm

Re: Printer in wine on OS X?

Post by lschafroth »

Martin Gregorie wrote:On Thu, 2009-07-09 at 09:57 -0500, lschafroth wrote:
See my last -you need 'netstat -apn'


Martin
Those command line arguments dont exist on OSX. I already stated that.

Lannie
Martin Gregorie

Printer in wine on OS X?

Post by Martin Gregorie »

On Thu, 2009-07-09 at 10:33 -0500, lschafroth wrote:
Martin Gregorie wrote:On Thu, 2009-07-09 at 09:57 -0500, lschafroth wrote:
See my last -you need 'netstat -apn'


Martin
Those command line arguments dont exist on OSX. I already stated that.
You have to run netstat as root when you use the '-p' option. I'd still
like to confirm that it is cupsd that's using the port, so try running
'netstat -anp' as root and/or try lsof - see an earlier post about that.

However, this thread is getting a bit tangled. My current concern is
that you don't show a ups connection. As CUPS uses that to broadcast
details of available printers, without it I'm uncertain how Wine can
know which printers are available.


Martin



Martin
Gert van den Berg

Printer in wine on OS X?

Post by Gert van den Berg »

On Thu, Jul 9, 2009 at 17:54, Martin Gregorie<[email protected]> wrote:
Does it work on OS X if you're root?
OS X has the BSD netstat version that uses -p to specify the protocol

The netstat man page can be found here:
http://developer.apple.com/documentatio ... tat.1.html

A working command is:
sudo lsof -i4:631

(I'm typing this from my Linux box, so I can't easily paste in the output...)
*************** back to Gert:

Does OS X have a copy of lsof?
Yep (I have XCode, installed, so I might have somewhat more commands
available than standard...)
If so the following, which must be run as root will also show the name
of the program that is listening on port 631:

lsof | grep -i 'ipp'
Would work... (I typed above instruction before I saw that... I know
that pfiles works for these kind of uses on Solaris. Don't know of a
non-solaris pfiles version though...)

Gert
Martin Gregorie

Printer in wine on OS X?

Post by Martin Gregorie »

Thanks for the OS X-related information.

The way options get re-purposed on some commands can be confusing.

I see that Wine uses the lpr mechanism to send print jobs to CUPS and
the CUPS documentation says that it uses UDP broadcasts to advertise its
print services to clients. Presumably this is how Wine finds out which
printers are available. Can you, or anybody else confirm this?

If that's the sole way Wine finds out about printers then a note on the
CUPS site about CUPS and OS X is relevant here,. It says:

<quote>

Due to user interface changes in Mac OS X 10.5, CUPS shared printers
will not automatically appear in the print dialog. Instead, you must
first run the following command to enable CUPS browsing on your system:
cupsctl BrowseRemoteProtocols=cups

Then choose each of the CUPS shared printers you want to see in the
print dialog by adding them, either from the Add Printer... item in the
print dialog or from the Print & Fax preference pane in the System
Preferences window.

</quote>

So, another question for the OP - have you done this?


Martin
Locked