Printer & Local Disk Share Mapping using rdesktop and Connecting to Windows 2012 Server

Written by James McDonald

October 8, 2014

I log in to a Windows 2012 server to use an EDI application (GXS OpenText Freeway) that creates printable orders and it would be nice to be able to print them from the rdesktop session I have running from my Fedora 20 box to a local printer.

I found despite specifying the correct printer option on the command line that I couldn’t see the redirected printer port when I went to add the printer in Windows 2012.

I found a  thread on Serverfault http://serverfault.com/questions/522991/rdesktop-to-windows-server-2012-from-ubuntu and it mentions that to share your local disk with the remote windows 2012 server you need to add a sound option. So I thought I would try it to resolve the printer re-direction not appearing problem. As the post mentions you need to specify -r sound:local

So the working command line for getting both Disk Share and Printer mapping working is

rdesktop -z -r disk:mydisk=/home/rupert/tmp \
         -r sound:local \
         -g 1280x1024 \
         -r printer:HP-Officejet-Pro-8500-a910b="KONICA MINOLTA PS Color Laser Class Driver" \
         remotepc.example.com

The name of the printer: option is arrived at by issuing lpq on your local linux box. This will give you the name of the default printer. If you want to use another printer lpstat -a will show you the ones you have available.

The =”Drive name” option is the name of a print driver installed on the 2012 server compatible with your local Linux/Cups connected printer. (Typically this will be a Postscript Driver)

[rupert@pc01 ~]$ lpq
HP-Officejet-Pro-8500-a910b is ready
no entries

[rupert@pc01 ~]$ lpstat -a
Cups-PDF accepting requests since Sat 20 Sep 2014 17:40:30 AEST
Generic-CUPS-X2Go-Printer accepting requests since Sun 05 Oct 2014 19:58:34 AEDT
hp accepting requests since Sat 04 Oct 2014 21:19:05 AEST
HP-Officejet-Pro-8500-a910b accepting requests since Wed 08 Oct 2014 12:43:26 AEDT

Once you connect rdesktop to your Windows 2012 Server you may need to go into the Devices/Printers control panel and click Add Printer and specify a printer driver. However if you specify a driver that exists on the server (with the exact driver name such as  “KONICA MINOLTA PS Color Laser Class Driver” to rdesktop)  it should automatically add the redirected printer and make it the default. The reason that I add the Konica Minolta PS Color driver to the Windows 2012 server and specify it instead of the correct HP Postscript driver is because I found the HP “Postscript” Drivers under Windows 2012 send PCL commands before the postscript print file and when the print file reaches the local cups instance it prints the Postscript file as text.

You should be able to see the redirected printer port as the below image shows. If you have to manually add a driver you need to select a Postscript driver.

rdesktop_redirected_port

Devices and Printers showing the redirected printer.

rdesktop_redirected_devices_list

 

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Squarespace Image Export

To gain continued access to your Squarespace website images after cancelling your subscription you have several...

MySQL 8.x GRANT ALL STATEMENT

-- CREATE CREATE USER 'tgnrestoreuser'@'localhost' IDENTIFIED BY 'AppleSauceLoveBird2024'; GRANT ALL PRIVILEGES ON...

Exetel Opt-Out of CGNAT

If your port forwards and inbound and/or outbound site-to-site VPN's have failed when switching to Exetel due to their...