Tuesday, April 03, 2012

RDP with Dual Monitor from OSX

From time to time you need to support a MAC user that needs remote connection to existing Windows servers. The below procedure applies with little differences to Linux users as well. The open source project called rdesktop is a simple and yet powerful command line tool to open a Remote Desktop Connection (RDC) using the Remote Desktop Protocol (RDP)

Arguable dual monitors are supported except for the fact that when you maximize a MS program window you get it spread across the two screens. So if you are happy with manual resizing you should definitely give it a try.
  1. Download and install Xquartz
  2. Open XCode and make sure to agree to install additional components.
  3. From Terminal run:
    xcode-select --install
    
  4. Download the gzipped distribution for rdesktop/
  5. Uncompress it
  6. Open Applications/Utilities/Terminal.app
  7. Type the below classical commands. You will be prompted for your password when you run the third command
    ./configure
    make
    sudo make install
    
  8. Run the command to connect to your windows server. It will prompt you for your Windows user password and then it will open the Remote Windows Desktop across your both monitors.
    rdesktop -f -d myWindowsDomain -u myWindowsUserName -p - my.windows.server.address
    
    Alternatively you can create a command which you can double click. Just create a file named my.windows.server.address.command with the below content:
    #!/bin/bash
    # my.windows.server.address.xrdp
    /usr/local/bin/rdesktop -f -d myWindowsDomain -u myUser myComputer.fqdn &
    exit 0
    
    Then and make it executable:
    chmod +x my.windows.server.address.xrdp
    
    Note that once the script exits the terminal screen will remain there unless you have configured your Terminal to close after an exit command is issued (Terminal Menu/Preferences/Settings/Shell/When the shell exists:Close the window)

    You could also use Applications/Automator option "Run Shell Script" and save the result as my.windows.server.address.app which you can then have in your dock as a handy icon to quickly access your remote server.
To be honest I have documented all this just because there are still people using an extended monitor in addition to their small screen MACs or just two monitors instead of their MAC but with huge monitors in the market I guess this is not needed for many MAC users out there.

17 comments:

Unknown said...

OK, let me be the first to say that I don't do much command line work. I have d/led and uncompressed the file (into my Downloads folder). If I try the ./configure command anywhere except in that desktop-1.7.1 folder, I get an error saying no such file or directory. When running in the folder, I get the following:

checking build system type... i686-apple-darwin12.0.0
checking host system type... i686-apple-darwin12.0.0
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/Thomas/downloads/rdesktop-1.7.1':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
Then I get command not found when I type make.
Am I missing something?

Nestor Urquiza said...

@Thomas, it looks like you have no gcc installed. If you install XCode first you should get it working. You can also use macports or brew I guess. I use personally use Xcode. Good Luck!
-Nestor

Unknown said...

I have xCode installed, but it still says no gcc.

Nestor Urquiza said...

I am afraid you will need to go to Apple forums for help. I own several MACs and I have gcc in them all. I did nothing to install it other than installing xCode for my iPhone projects.

Unknown said...

Thomas if you have the latest Xcode installed then go to Xcode preferences then click on the download then install the Commandline utilities
have fun

Unknown said...

Hi
I have try this, and it works so far, but there is a limit at 4096px in width. I have an 27" iMac with an 27" Cinemadisplay. Toghether they have 5120x1440 resolution.
Is there a possibility to run rdesktop in this resolution?
Thanks. Christian

Nestor Urquiza said...

@Christian, try "CoRD" application to see if you can adjust the total resolution to accomodate for both displays.

Nestor Urquiza said...

@Christian reach please the rdesktop mailing list as they might have a solution for the limitation you are referring to.

Charles Norris said...

@Christian The total combined resolution across all monitors must be under 4096 x 2048 pixels

Charles Norris said...

@Christian forgot to include the reference http://msdn.microsoft.com/en-us/library/gg156129.aspx

Anonymous said...

If gcc is missing, you're probably on a more recent version of xcode

Starting with Xcode 4.3 - you must now manually install command line tools from Xcode menu > Preferences > Downloads.

Anonymous said...

Starting with Xcode 4.3 - you must now manually install command line tools from Xcode menu > Preferences > Downloads.

lorielue said...

This sounds like it could be really useful, but i cannot get it to work. I get the error

CredSPP support requires libggsglue, install the dependency
or disable the feature using --disable-credssp.

after I enter ./configure

lorielue said...

After typing in ./configure it appears to run, then I get the following message:

CredSPP support requires libggsglue, install the dependency
or disable the feature using --disable-credssp.

Nestor Urquiza said...

@Lorielue, you are probably missing xCode? Look at all the comments above, perhaps they will help you?

mama said...

Hi I've installed XCode. Now when run ./configure I get the following error: "ERROR: Could not find X Window System headers/libraries.
To specify paths manually, use the options --x-includes and --x-libraries." Any help would be greatly appreciated.

Nestor Urquiza said...

@mama you need to install XQuartz as per https://support.apple.com/en-us/HT201341

Followers