The Haiku/BeOS Tip Server
Tips and tricks for Haiku/BeOS users

Printing over Windows networks

Contributed by: Gwydion Elderwyn
This tip is valid for: Both BeOS and Haiku

I’m assuming your internal network is configured to use TCP/IP. If not, it will need to be.

You’ll need to know the IP address, hostname, and printer share name of the (Windows) machine that the printer is connected to, the username and password for the printer, if any, and the workgroup name. Naturally, the printer must also be one that BeOS is compatible with (Epson, etc).

In my case, the details are as follows:

    IP address of computer with printer: 192.168.0.1
    Computer name: SERVER
    Printer share name: EPSON
    Workgroup name: WORKGROUP
    Username: {none}
    Password: {none}
    

Here’s the step-by-step.

  1. Launch a Terminal window.
  2. Create a directory for printer files – I created /epson … e.g.
    mkdir /epson
  3. Enter the following command.
    cifsmount -I 192.168.0.1 -W WORKGROUP -d \\SERVER\EPSON "" "" /epson

    Breaking that down;

    -I 192.168.0.1 tells it that the IP address of the machine with the printer is 192.168.0.1

    -W WORKGROUP tells it the workgroup name

    -d tells it to display debug output (during the mount only) – useful so you can see what it did

    \\SERVER\EPSON is the server/share name in the correct format “” “” is the username & password (see below)

    /epson is the mount point in BeOS. You’ll see why this is needed shortly.

    Note: “” “” is username & password. Most of the time with shared Windows printers, there is no username, just a password, so for example if your password was “bunny” then the above command would read

    cifsmount -I 192.168.0.1 -W WORKGROUP -d \\SERVER\EPSON "" "bunny" /epson

    You can’t just leave these parameters out – if there is no password then you must use “” “” – otherwise it won’t work.

  4. If that worked, you’ll see in the debug output (that’s what -d does) that the share was mounted correctly. If not, check all the details, check that you can ping the computer, etc.
  5. Next, we need to create a printer in BeOS. Go to Preferences | Printers | Add. When it asks where the printer is connected, select “Print to file”. I think the rest should be self-evident. Probably the most crucial thing is to make sure you select the correct printer type.
  6. Now you’re ready to print. Launch the application you wish to print from. Load the document and print it. You will eventually be prompted for a filename to save to. Now, you must navigate to the “mount point” you selected above. This is where it gets curious. On my system, there is no /epson directory, the share is listed as /SERVER/EPSON – weird. Anyway, enter that directory – it should be blank. Now specify a filename, and click Save. The filename is irrelevant.
  7. It should now print!

How does it work? Pretty simple. When you write a file to this directory, it’s sent, byte-for-byte, to the share, which in this case is the printer. So really you’re just writing bytes directly from BeOS to the printer, via TCP/IP.

It’s worth noting that using exactly the same procedure, you can mount any Windows share. You just change the share name and mount point. But when you navigate to the mount point, you can see (and read and write) the files on the shared volume.

To make sure your machine stays permanently configured for printing on this network add the mkdir and cifsmount commands above to /boot/home/config/boot/UserBootscript.

Posted in Networking


(comments are closed).