# Printer support in a VMware VM?



## fuzzynco (Oct 10, 2009)

I downloaded a copy of the adm64 7.2r DVD iso and
an 'empty' VMware VM config a 25gb virtual ide disk
with bridged networking. I was able to install from the 
ISO and then do a portsnap to install current ports collection.
I installed the nano port because vi is to arcane for me .
I have a Brother HL-5250-DN networked mono laser printer
that understands IPP and LPR protoco ls. Windows can print
 to it with it's LPR as 'lpr -P <ip address> filename'. 

I tried that from a root login and the console said /dev/lp 
was missing. I defined a remote printer in printcap but it still
just spools and the daemon is waiting for the device to come ready?

do I have to use cups to print on a ip printer?

Thanks


----------



## SirDice (Oct 11, 2009)

You need to configure lpr. It's probably trying to print to a directly attached printer. Have a look at chapter 9.4.3:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/printing-advanced.html


----------



## fuzzynco (Oct 12, 2009)

*Brother HL-5250-DN on FreeBSD 7.2R*

what do I put in the /etc/printcap entry for the printer?

rm=192.168.215.29 and its a (or understands?) PS printer.
what do I use for an input filter. I don't need job seperators 
/ headers. I want to print plain text and possibly troff/man 
pages? graphics (other than PS language created ones) aren't needed.

The print server identifies itself as understanding 
PostScript Level: 3
PostScript Version: 3010.1106.5

I sent a post script test script to the print server
(postscript.txt) from a WinXP lpr command 
(lpr -S 192.168.215.29 -P Brother postscript.txt)
and it printed as (postscript test page,jpg).

Both are attached to:
Setting up IP Printer (FBSD 7.2r) 
in Base System > Peripheral Hardware.


----------



## fuzzynco (Oct 18, 2009)

*[Solved] Mostly by learning about Unix printing*

I copied bits from two different text filters to 
accomodate both PS and plain text and it seems to be working.

 It seems my printer is smarter than I am 
if it gets plain text it behaves like an HP laser printer.
if it gets postscript it runs it and prints the results.

Thanks 

```
#!/bin/sh
IFS="" read -r first_line
first_two_chars=`expr "$first_line" : '\(..\)'`
if [ "$first_two_chars" = "%!" ]; then
#
# Postscript job just print it
#
echo "$first_line" && cat && printf "\004" && exit 0
exit 2
else 
# 
# Plain text tell printer then print it
#
printf "\033&k2G" && echo "$first_line" && cat \
&& printf "\f" \
&& exit 0
exit 2
fi
```


----------

