Linux Remote Desktop For Controlling Windows XP / Vista / Server 2003 ( rdesktop )

last updated in Categories Linux, Windows

I am responsible for a couple of MS-Windows servers and Windows XP/Vista/7/10 workstations too. When I work from home, I need a way to get into Windows XP/2000/Vista/2003/2008/7/Vista/10 operating systems for work.

I have Debian Linux at home, and I needed a way to login into Microsoft windows desktop from Linux OS. Many of us working at tech support use rdesktop to connect to customers’ MS-Windows systems.

Fig.01: rdesktop login window
Fig.01: rdesktop login window

This program is very useful to configure Outlook or something else when customers do not understand how to configure or troubleshoot the problem. This is the best way to fix a problem.

Say Hello To rdesktop

Fortunately, Linux has rdesktop utility. It is a client for a remote desktop protocol (RDP), used in many Microsoft products including Windows NT Terminal Server, Windows 2000 Server, Windows XP and Windows 2003 / 2008 Server. You do not need to install VNC server. All you need is rdesktop client on Linux or BSD workstation.

What is a rdesktop client for Linux/Unix?

From the project web site:

rdesktop is an open source UNIX client for connecting to Windows Remote Desktop Services, capable of natively speaking Remote Desktop Protocol (RDP) in order to present the user’s Windows desktop. rdesktop is known to work with Windows server versions ranging from NT 4 terminal server to Windows Server 2012 R2

Install rdesktop

Type the following apt-get command/apt command as root user to install rdesktop on a Debian/Ubuntu Linux:

# apt-get install rdesktop

To connect to MS-Windows systems from Linux, type the following command at a shell prompt (connect to Windows server called

$ rdesktop mw2sn100.your-domaian-name-here

Or connect to windows XP/Vista workstation having IP

$ rdesktop

Fig.01: rdesktop in action
Fig.01: rdesktop in action

Please note that you must enable remote desktop connection under MS0Windows operating systems; otherwise it will not work. Turn on remote desktop under MS-Windows operating systems:

  • Go to MS-Windows desktop
  • Right Click on My Computer
  • Select properties
  • Select Remote tab
  • Enable Remote desktop.
  • Save the changes.

Make sure enterprise firewall allows incoming connection on TCP port 3389. rdesktop supports many other options, type the following command to read the man page of rdesktop or visit project website for more information.
man rdesktop

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

100 comment

  1. hi
    i have a problem with this.
    I use an old laptop connected to a tv, but when i control it with another laptop the ati control panes is disabled.
    How can i fix it

  2. Hi Vivek,

    I use the ‘rdesktop’ and the problem with it is the colors!!

    I think it shows up with 256colors! How can i change the resolution?

    Prasanth Kumar Diddi.

  3. Prasanth. To sort out colours/resolution read up on rdesktop switches: -g for resolution and -a for colours.

    (obviously set to lowest so that rdesktop will work on older systems)

  4. hello,

    how many user / client can connect to rdesktop server ?

    i have already setup rdesktop server and client, but only 3 client can connect

    my server is windows xp pro, my client use freebsd with rdesktop installed.

    thank you

  5. thanks for the tip .. easy solution since my monitor is about to break down and i could not get VNC to work due to java i believe

  6. Is there a way to make this work with Vista Home? My parents are driving me nuts with Vista questions. I have Ubuntu Gutsy running. Any advice would be appreciated. Thanks!

  7. I used VNC to bring data home nightly for Quickbooks usually I would just work on it via VNC. IN the old days when I used PCAnywhere I had to work on the dat a file at home then send it back in the morning. VNC rocks… my fav software ever.


  8. to the vista problem, remote desktop on Vista uses encryption TSL 1.0, you might tryin using the E switch other than that your SOL

  9. I’m new to linux and using ubuntu. My biggest problem so far had been that I couldn’t access the virtual desktop at the high school I teach at. The guide worked like a charm, and now I don’t have to cart an external hard drive back and forth. Thank you!

  10. Didn’t see any thing mentioned about how secure password transmission is.. Is the password transmitted clear text or encrypted? Is it secure?

  11. Thanks for this simple but very helpful guide. Shortly after getting this going, I found Ubuntu (probably gnome, actually) provided a nice gui panel for getting rdesktop started, with handy options for all the command line parameters I wanted. In the main Applications menu, it was under Internet, called Terminal Server Client.

  12. @james

    you cannot do remote desktop to a vista home system as microsoft does not ship vista home versions with the rdp protocol.

    only outgoing connections are allowed with vista home.

  13. How would I get a script with rdesktop to run at startup of a linux box?

    I.E. once linux loads, it runs the script that loads rdesktop.

    I am running Synnex on X Windows if that helps.

  14. hi, when I access the server all I get is:
    Autoselected keyboard map da

    I used rdesktop -u USERNAME -p PASSWORD IP to get this far…

    remote desktop is enabled on the server

  15. another question:

    [root@vs-1399 ~]# rdesktop -u tmp -0
    Autoselected keyboard map en-us
    ERROR: Failed to open display:

    i`m using a terminat thought putty without using a display mode or something.
    there is some way to connect from linux, to thee rdp just like your using the telnet ? i mean that i whant to connect to the rdp just typing the username and password withought using a display mode
    just connect to rdp and take the commands like your in the Command Prompt?

  16. I’m trying to provide a way to enable about 14,000 employees, who are all using a Linux/Firefox solution at their remote facilities, to access a web-based application that is only supported on a Windows/IE 6.0 or greater configuration. It sounds like rdesktop may be a solution but I’m concerned as to its scalability and security. Can anyone share any insight?

  17. I have a problem in that when I connect to a vista pc (rdc is enabled) it just says “Autoselected keyboard map en-gb” then nothing. Can someone please help with this as I need it up and running as soon as possible.

  18. is there any application for linux that enables tab based rdp sessions? like remote desktops for windows or VisionApp’s application?

  19. im using linux system if i take the xp client in a remote desktop the display is not clear in my system how can i solve this ,,,,,,

  20. Once connected – my windows server appears in a small window
    Q: How do I enlarge that window – F10 is not available


      1. Hi this is good to enlarge the screen by rdesktop -g 1024×768 but this enlarge only horizontally not vertically

        How to enlarge vertically

        Surjit Thakur

  21. That is a great way to lock into a remote PC. THANK YOU!
    The only shortcoming: to be good for remote support of Windows computers, it would be best if the local user could still see what is going on on the screen. Is there a way to get that, too. (Similar to netmeeting, perhaps?)


  22. Hi There,

    I just want to say thank you for this short but very important entry. I was puzzled how to connect to my windows servers. I am a ex Mandrake and Suse user but it didn’t use linux for a very long time.

    Thanks again!

  23. Hi
    Its working great job, but when i connected to a domain client getting some error., ie., username,password,domain


  24. Hi,

    i’ve been working with rdesktop for a year now on a local Win server from my Linux machine and it worked fine.

    But now the admin decided to “virtualize” the server and i’ve got some flickering going on whenever i connect to that machine. The flickering is related to some displayed fields in MS Access (which i why i have to user rdesktop) and it eats up my processor a lot…

    Anybody has an idea or an alternative remote method ?



  25. Excellent tip, thank you very much! I just started using Ubuntu and this allows me to still use my Windows apps while in Unix. Good stuff!

  26. Thanks for info. but i need help for remotely login to command prompt… any idea…? if i need to write script then how it would look like…? Basically i need remote login from linux to windows server 2003 and it should directly reach to the command prompt..


  27. mbalelo:/etc# rdesktop
    Autoselected keyboard map en-us
    ERROR: Failed to open display:

    please your solutions

  28. I use the ‘rdesktop’ and the problem with it is the colors!!
    I think it shows up with 256colors!
    How can i change the resolution? 24bit?

    please send me solution via email.

  29. Works great!

    One q though: How do I get out of the full screen mode / switch to my linux desktop without killing the application?

        1. Yes. Thanks for your reply.

          Before that, you may need to choose the visual effect to “None”—which is is System–preferences-appearance–visual effect

  30. Thanks for this tip!
    It saved me from continuously moving between Linux & Windows systems.
    I am able to work in fullscreen mode but i also get this on the terminal:

    WARNING: Remote desktop does not support colour depth 24; falling back to 16

    How do resolve this warning?

  31. Hi Team,

    I can able to take XP,2003 servers with rdesktop command, but not 2008 server.
    Please help me out in this.

  32. ice crash:

    you want to log into a remote computer and not see the desk top. you described it as “like telnet”. what you want is ssh not remote desktop. ssh is safe to use now days unlike telnet as telnet may allow attackers to view your password and user name in plain text.

    ssh came with the linux distro i downloaded , crunchbang lite. so i am not sure the command to download it but it is most likely something like sudo apt-get install ssh . if that doesnt work use sudo apt-cache search ssh . if all else fails search google for ssh linux “your distro” and im sure there will be almost too many web sites willing to help you get ssh.

    to use just type something like “sudo ssh user@domain.layer1 and provide the password of the user you are trying to log on as.

    hope this helps you 🙂

  33. > Didn’t see any thing mentioned about how secure password transmission is.. Is the
    > password transmitted clear text or encrypted? Is it secure?

    It is encrypted, but there are some hacks to get it on WinXP Service Pack 1+2. I don’t know if they fixed the problem (they just wanted to support some older WinNT-Functions and cut the Password into 6-character-strings).

    PS.: Nice Tip!

  34. I try to remote in to Win2008 using rdesktop, it keep complaining about worng user name and password. I am more than sure user name and password are correct. Pleas help.

  35. hi, cant seem to get this installed. first time doing this whole linux thing all i get is an error message
    E: Could not open lock file /var/lib/dpkg/lock – open (13: Permission denied)
    E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

    tried to type yes… thats all i got, any help woud be appriciated!

    1. Try this instead: sudo apt-get install rdesktop
      If you somehow don’t manage to install it anyway, try looking at your software sources/repos.

  36. Hi, I tried accessing my virtual XP (guest) on Linux Host, with rdesktop but was unable to connect. Is it because it cannot be done or am i missing something? I followed the usual steps, started XP on virtualbox, found the Windows IP using “ipconfig -all”, typed “rdesktop xx.xx.xx.xx, and got “ERROR: unable to connect”.

    1. i want to remotely access windows 7 pc .im using raspbian wheezy os .can any body tell how to use vpn to connect to that windows pc.

      Autoselected keyboard map en-us

      after that unable to conect
      please tell me the solution.

  37. Fantastic piece 🙂 thank you 🙂 another step closer to using LINUX full time at work… Is there a way to remote in live? i.e. whilst the user is logged in?


  38. I’ve been connecting to my computers at work with rdesktop, but I’m having issues with screen resolution. No matter what I set the resolution to (860×640 – 1280×960), I cannot see the taskbar on my connected computer. When I connect with the fullscreen option, I can see it. I want to be able to view the taskbar without having to connect using the fullscreen option… Any suggestions?

    When using the option -g (may resolution = 860×480 – 1280×960) I cannot see the taskbar on the connected computer. If I do not use the -g option to specify the resolution, the default resolution is 860×480, but I can see the taskbar…

    1. Nevermind,

      I’m using 1280×725 (odd resolution, huh?) and I can finally view the Taskbar… Hopefully the new resolution doesn’t interfere with much else (browser windows, etc…)

      Thanks for your support!

  39. Microsoft Remote FX requires RDP 7.1 based client.
    Could you give me answer on if your solution is able to support Remote FX?
    If yes, we may be able to run Direct X based games on Linux more effectively.

  40. Hi, I can’t get this work with Ubuntu 10.04. It was working perfect under the older version 8.10. Anyone has any idea?

  41. I get this message after I put
    rdesktop -f ip-address

    ERROR: connect: Connection timed out

    How can I get the windows to prompt me to put my user name and password?

  42. I wanted to access the windows 2008’s desktop in ubuntu.
    i have installed rdesktop in ubuntu.
    when i am doing rdesktop to windows its showing the below erro, what could be the problem and how can i fix it. please help

    # rdesktop
    ERROR: Failed to open display:

  43. Thanks. Worked like a charm

    On CentOS, you need to run
    % yum install rdesktop

    with sufficient privileges of course.


  44. Hi, everyone actually I use rdesktop so much and for advance use:

    rdesktop -g 97% -u User -k la

    -g graphics in this case can with % of window or exact size 1720×768
    -u User
    -k Key map include for the keyboard in this case la = latinoamerica


  45. Hi ..Dear…
    i allrady installed rdesktop at RHEL pc and run this cmd…like
    # rdesktop
    in this case window login page show, and as i type user name and Passwd, in that case. ….msg: unable to log you on beacuse of account restriction but i allready disable window firewall & iptables both side……now in this case..what i do…
    plz advise me…..

    1. Narendra,

      Check your RDP configuration on the Windows side and make sure the username you are using from the Linux side is enabled for RDP access.

  46. hey there and thank you for your information – I have definitely picked up something new from right here. I did however expertise a few technical points using this web site, since I experienced to reload the site lots of times previous to I could get it to load properly. I had been wondering if your hosting is OK? Not that I’m complaining, but slow loading instances times will often affect your placement in google and could damage your high-quality score if advertising and marketing with Adwords. Well I’m adding this RSS to my email and can look out for much more of your respective fascinating content. Make sure you update this again soon..

  47. When I connect to WinXP via rdp it forces other users off the XP machine. Is there any way to connect in the background (as it were) so that someone actually using the remote computer can stay logged on?

  48. When I login to my VPS (simply ‘rdesktop i.p.’ to a Win server 2003, datacenter edition, sp2 system), it seems that I have less rights as a sys admin, compared with a sys admin logging in from the Win client MS Desktop 6.0. I see only a handfull of running processes in the taskbar. Also, I see only 1 out of 2 running applications on my desktop.
    Is there a way to solve this issue? Thanks!


  49. Trying to use rdesktop to log in remotely to WIndows machines via a Linux machine. Logging in remotely to the Linux machine with ssh using PuTTY and tunneling to VNC.
    Running rdesktop on the Linux machine this way gives an ERROR: Failed to open display : localhost : 0 — How can I connect rdesktop to VNC or is this not even my problem??

    Thanks in advance

  50. Roger

    you need a DISPLAY exported to your Client IP. On your client (from which you ssh) you need a X-server which can be Xming
    This here is another how to.

    Good luck

  51. Hey there.
    Does it also support the remote desktop of win 7? and how fluent does it work?
    remote desktop in windows also allows to transfer sound. is this feature included?

  52. It is great and worked great but when the window login screen is displayed and I try to logon it says
    “Unable to Log you on because of an account restriction”
    What should I do now. Help

  53. Got it to work, but how would I save it onto the desktop as an icon?I can do it with windows and I can actually save a log in for each pc I am logging onto.


  54. Hi,
    Just want to ask if this is also applicable with windows 7 starter. As one of the shortcomings or limitations of the win 7 starter version it can’t see other pc in the network and you need a higher version of Win 7 like Home prem. to create a workgroup and join the win7 starter.
    Thank you and this website of yours is one of the great source of information.

  55. rdesktop -u syed
    Autoselected keyboard map en-us
    ERROR: Failed to open display:

    please help me i am getting this error while trying to connect.

    Have a question? Post it on our forum!