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

Posted on in Categories Linux, Windows last updated January 7, 2006

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

I have Debian Linux at home, 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

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

Say Hello To rdesktop

Fortunately, Linux has rdesktop utility. It is a client for remote desktop protocol (RDP), used in a number of 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.

Install rdesktop

Type the following command as root user:

# 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

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 and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

Share this on (or read 100 comments/add one below):

100 comment

  1. 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)

  2. 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

  3. 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.


  4. 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!

  5. 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.

  6. @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.

  7. 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.

  8. 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

  9. another question:

    [[email protected] ~]# 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?

  10. 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?

  11. 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.

      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

  12. 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?)


  13. 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!

  14. 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 ?



  15. 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..


  16. 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.

  17. 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?

  18. 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 [email protected] and provide the password of the user you are trying to log on as.

    hope this helps you 🙂

  19. > 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!

  20. 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.

  21. 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!

  22. 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.

  23. 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!

  24. 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.

  25. 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:

  26. 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


  27. 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…..

  28. 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..

  29. 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?

  30. 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!


  31. 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

  32. 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?

  33. 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

  34. 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.

Leave a Comment