Offenders

Linux to Windows Remote Desktop Issues

by on Jun.29, 2011, under Linux, Remote Access, Windows

Many Linux users whose main PC is Linux have to RDP into Windows machines on occasion. All my PCs run Linux, and I’m constantly connected to a Windows box at work, mainly for the Office suite, and the occasional mandatory app that won’t run on Linux. There are a couple issues I’ve encountered and have figured out ways to work around them.

The first and most aggravating is the clipboard between Linux and Windows quits working at random times. I haven’t determined what causes it to happen, but I’ve found that killing and restarting the rdpclip.exe application in Windows restores the functionality. It happens so often that I’ve created a two line bat script and placed it on my start menu and desktop for convenience. This is all you need.

taskkill /IM rdpclip.exe /F
start /MIN rdpclip.exe

I’m not sure if versions of Windows before Windows 7 include taskkill. If not, Sysinternals offers a tool called PsKill that will do the same thing. Just save these two commands in a .bat file and click it when the clipboard quits working. It sure beats the hell out of my previous method, which was logging off completely, and back in.

The second issue is regarding connecting to Windows 7 or Windows Server 2008 machines. Remote to Local sound doesn’t work without adding some extra arguments to the command. This might be fixed in newer versions of rdesktop than my distro provides, so only implement this if it’s currently broken for you. This is how to call it from the command line.

rdesktop -r sound:local -r clipboard -r disk:root=/ servername

The mapping of your local disk to the Windows server resolves the Remote to Local sound issue. There’s another benefit: It also creates a new drive letter on your Windows box that’s mapped to your Linux filesystem. It’s a convenient way to copy files to and from both boxes without having to use another application or protocol. You may want to change the command to “disk:root=/home/user” to make your home dir the highest level directory you can access via Windows. Some of you use a GUI front-end to connect to remote hosts, like gnome-rdp or tsclient. I use gnome-rdp and it doesn’t have an option to map the disk, so I created a wrapper script to do it instead. This is not the optimal solution because it will create problems when you update rdesktop. This is what I’ve done as a workaround.

mv /usr/bin/rdesktop /usr/bin/rdesktop.bin

Create a file called /usr/bin/rdesktop.wrapper and add this to the file.

#!/bin/bash
## Wrapper to fix Win7/2008 sound issues

/usr/bin/rdesktop.bin -r sound:local -r clipboard -r disk:root=/ $*
## EOF

Make the file executable.
chmod +x /usr/bin/rdesktop.wrapper

Then create a symbolic link to the wrapper.
ln -s /usr/bin/rdesktop.wrapper /usr/bin/rdesktop

That should be all you need. Whenever your GUI calls rdesktop behind the scenes, it will actually call our wrapper script, which will prepend the disk argument to the command when calling the real binary. The $* at the end of the line appends all the arguments that the GUI supplies, so that any specific settings or options you’ve set will still work. Keep in mind that when you update rdesktop, the symbolic link we created will be deleted and overwritten with the new rdesktop binary. Simply rename rdesktop to rdesktop.bin and recreate the symbolic link, if the new version doesn’t fix the sound problem itself.


7 Comments for this entry

  • Malcom Guiterez

    I’m really enjoying the theme/design of your blog. Do you ever run into any web browser compatibility problems? A number of my blog visitors have complained about my site not operating correctly in Explorer but looks great in Firefox. Do you have any recommendations to help fix this problem?

  • bats

    I’m not catering to IE users at all, so I’m not concerned if they have issues with the site. So I can’t be much help.

  • delaine

    gooood for you Ryan! very impressed with the site and information.. of course it is over my head..but very impressive all the same

    delaine

  • Gmaster

    Thanks a lot. The restarting of the dreaded rdpclip.exe fixed the problem.

  • SkĂșli

    Thanks for the nice tips, the clipboard is a must and the disk is a very nice add-on.

  • Edwin

    That was very good tip about the clipboard functionality resetting. This is so annoying when it doesn’t work

    Thanks a lot !

  • erics

    god! you saved my life man

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...