Windows

How do I connect to a remote Windows 7 desktop from a Linux machine?

In this How do I tip, Jack Wallen shows you how to connect to a Windows 7 machine remotely from a Linux desktop.

Although most administrators do their work within a Windows environment, there are times when an administrator will want to (or have to) connect to a remote Windows machine from within a Linux machine. Now most administrators are used to doing this from within Windows. But from within Linux it is a different story.

There are plenty of Remote Desktop Protocol (RDP) tools available for Linux that allow you to connect to just about any platform, but for our purposes, we will be connecting to a Windows 7 desktop from an Ubuntu 9.10 desktop. But we'll make this a bit more complicated. Since "the cloud" is all the rage, we will make this Linux-to-Windows connection with the Windows 7 instance being served as a virtual machine from a different Ubuntu Server using VirtualBox.

This blog post is also available in PDF format in a free TechRepublic download.

In order to make that connection a little easier to understand, let's map it out with a diagram (Figure A).

Figure A

The Windows 7 desktop is served up by the Ubuntu Server via VirtualBox 3.0.

Now that you can see a visual representation, the connection should be easy to figure out.

For the purposes of this document, I am going to assume:

  • You have a working Ubuntu Server.
  • You have VirtualBox working on your Ubuntu Server.
  • You have Windows 7 installed on VirtualBox.
  • You have a working Ubuntu desktop.

The above issues are simple to resolve. There are a few others that might not be so obvious, so we'll discuss those here.

Bridging your network

If you go with the default settings on your Windows 7 Virtual Machine, you will not be able to access that desktop because the IP address will be handled via NAT. Instead you need to use a bridged connection so that your virtual machine will be on your LAN IP address scheme. To do this, you need to close the Windows 7 virtual machine. You can't just "pause" the instance; you actually have to close the session (as if you were going to shut down a regular Windows machine) to access the configuration of the VM.

Once you have that VM closed, go to VirtualBox, select the Windows 7 VM, and then click the Settings button. Click on the Network section and then, from the Attached To drop-down menu (Figure B), select Bridged Adapter. Click OK to Apply this setting and dismiss the window.

Figure B

If you find networking does not work on your virtual machine, you might have to change the Adapter type.

Now go back to the main VirtualBox window and start up your virtual machine. You should find, once Windows 7 boots, that it is now a part of your LAN IP address scheme.

Enable RDP

Before you try to connect to your Windows 7 desktop via RDP, you have to enable the service. To do this, follow these steps from within your Windows 7 virtual machine:

  • Click on the Start Menu.
  • Right-click on the Computer entry.
  • Select Properties.
  • Click on the Remote settings entry.
  • Make sure that both the Allow Remote Assistance Connections to This Computer and Allow Computers Running Any Version of Remote Desktop are checked.

After you take care of those settings, click OK to set them.

Linux RDP client

One of the more reliable and user-friendly of the Linux RDP clients is Terminal Server Client (tsclient). By default, this should be installed on your Ubuntu desktop. If it isn't, you can go to the Ubuntu Software Center, search for "terminal server" (no quotes), click on the Terminal Server Client entry, click the right-pointing arrow, and finally click Install.

Once that software is installed, you will find it in the Internet sub-menu of the Applications menu. Start that up, and you will see the main tsclient window (Figure C).

Figure C

As you can see, it takes very little configuration to connect to your Windows 7 desktop.

Believe it or not, very little effort is required to make the connection from Linux. All you need to do is enter:

  • The IP address of the Windows desktop you want to connect to
  • The user name that you will log in as
  • The password for the user
After you enter that information, click Connect and a new window will open, running a remote instance of your Windows 7 desktop (Figure D).

Figure D

Our virtual machine instance of Windows 7 is running, via RDP, on an Ubuntu desktop machine.

Final thoughts

This type of setup should illustrate for you how versatile RDP can be. Doing remote work on a Windows 7 machine does not have to be limited to using another Windows 7 machine. Now you know that administering a Windows 7 machine can be done remotely from a Linux desktop.

About

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website getjackd.net.

19 comments
theshowmecanuck
theshowmecanuck

This article while looking useful is kind of silly. If you are going to help someone, try giving the simple explanation first, like how to share a desktop. Full stop. Not via the cloud or any other crap. Occam says this is the best way since it is the simplest and the most people just need the simplest solution, not the hard one. And the simple solution has a different explanation otherwise you wouldn't be trying to sound so tech savvy and showing most people what they don't need to know (since most wouldn't need to connect like this). So next time, instead of stroking your ego, try showing the simple way first and then the hard way if you want. I'm going to look elsewhere for the simple solution since that is what I need. I had to post this because I am sick of people trying to show how smart they are by, "OK, let's show you the hard way because it's interesting (and I'm really smart)," If you are really trying to help people, people who don't know the answer, they need to know the simple way first before they start running. Thomson's Rule for First-Time Telescope Makers: "It is faster to make a four-inch mirror then a six-inch mirror than to make a six-inch mirror." And if you can't figure out how this is relevant, then you should not be trying to help people. But I think you will understand this, and hope you modify your articles.

rogerchannel
rogerchannel

Hi I Had tried to establish RDP session from my Ubuntu 11.04 to Win 7 Pro, Win 7 Screen is getting in my Linux, bunt thing is mouse / keyboard is working very slowly any thing i have change for smooth operation

Orodreth
Orodreth

The article seems more about how to connect a Linux client to a Virtual Linux Server on Windows 7 using RDP rather than connecting to Windows 7 from Linux clients. More specifically using Network (Netbios, Samba, NFS) etc. On my network maintaining a connection between Linux clients and Win 7 shared folders is sporadic at best. Usually, Win 7 is unreachable. Because I've seen other complaints with the same issue I can say its not unique to my home network.

hfinnern
hfinnern

Remote assistance is a seperate component and does not need to be enabled in Windows 7(or other versions of Windows) in order to use Remote desktop. Remote Assistance vs. Remote Desktop Remote Assistance and Remote Desktop are different features of Windows 7 that have entirely different uses. Remote Desktop is based on Microsoft Terminal Services and is a tool for remotely logging on to remote computers. When you use Remote Desktop to connect to a remote computer, a new user session is established. Remote Desktop can also establish sessions with computers that have no interactive sessions running (no users logged on locally), such as headless servers. Remote Assistance, on the other hand, is a tool for interactively helping users troubleshoot problems with their computers. To use Remote Assistance, both the User (also called the Novice) and the Helper must be present on their computers. Unlike Remote Desktop, Remote Assistance does not create a new session. Instead, Remote Assistance allows the Helper to work in the existing session of the User. The User?s desktop gets remoted to the Helper, who can then view the User?s desktop and, with the User?s consent, share control of the desktop. Here is another way to summarize the difference between these two features: In Remote Assistance, both users involved are looking at the same desktop using the same logon credentials (those of the interactively logged-on User) and can share control of that desktop; in Remote Desktop, when the remote person logs on, the interactively logged-on user (if one exists) is logged out.

donmhlnd
donmhlnd

Very helpful thank you! Don Mulholland

Mark W. Kaelin
Mark W. Kaelin

Do you have occasion to connect to a Windows 7 machine from a Linux desktop?

cavinlang
cavinlang

I have found using RealVNC to be very easy to setup & works very well....

Neon Samurai
Neon Samurai

On a Win7 viewing a GUI desktop from your Ubuntu box would be a nice followup. The last time I had such a need VNC server would provide a separate X session but not a view of the current user. For the majority of the time, a terminal shell works and when needed, an X GUI app can be forwarded to the local machine. But sometimes one just needs to see the user's desktop. As for going from X to Windows boxes, I keep both my VNC and RDP client apps handy. I've even done RDP and VNC from a Palm T5 to a Windows desktop and currently RDP from maemo4 to Windows machines. It's very handy and something I've very happy to see not limited to a specific platform.

Neon Samurai
Neon Samurai

VNC is great once setup safely but I'd recommend UltraVNC with an AES encryptiong plugin for the network traffic. The naked VNC protocol isn't very safe. The encryption plugins included by default don't use weaker encryption than AES. I'm not sure if RealVNC has encryption but since you've got that already, you may want to look for connection plugins to do AES at minimum before looking at UltraVNC. ah.. there it is.. if your curious, the plugin is SecureVNC. SecureVNCPlugin64AES.dsm SecureVNCPluginAES.dsm was at version 1.0.1.0 and I couldn't get anything usable with wireshark with it enabled.

terry
terry

I have a Windows workgroup and a Ubuntu file storage. Much more interested in working the other way. td

jlwallen
jlwallen

NS, I will make that my next How Do I (How do I connect to a vnc-enabled Linux machine).

Neon Samurai
Neon Samurai

There are sshd for windows floating around and putty can create the outbound tunnel but it's still messy to setup between two Windows boxes isn't it? Between my *nix boxes I think the browser is the only think I don't include ssh into (but it's got the ssl layer available). ssh is just fantastic. I'm still finding new things it can help with.

oldbaritone
oldbaritone

I use SSH tunneling for most of the functions I want to access remotely, including RDP. Take your pick of encryption algorithms - including AES 256 bit. EVERYTHING in the tunnel is encrypted. Then you can run VNC with no encryption, safely.

Neon Samurai
Neon Samurai

She won't touch much else but her macbook at home (nice break from Windows at work i guess). The Iphone braught her the closest to becoming a gadget geek though so I can only complain so much. I'd also not have osX here to play with if not for her machine. Anyhow, I'd say stick with the Ubuntu GUI admin tools while you learn how Samba config works through Webmin or, ideally, command line. If it's a dedicated desktop that also happens to be sharing storage space though, that's another matter rather than a dedicated server. I'm sure we'll see Jack's article turn up though I'm also watching for it. Actually, just tonight *nix desktop sharing came up in a conversation with a friend.

terry
terry

I have a workgroup with p2p networking & rather than shell out for another copy of Windows thought it was time to look at Linux. I must say Ubuntu is pretty good. But SWaMBO (She Who Must Be Obeyed) uses Windows and there is no way of getting her to learn new tricks. She struggles with what she knows. Look forward to the pending How To.

Neon Samurai
Neon Samurai

If your using a pure server role, it may be worth learning to admin it by ssh or look at webmin for a browser UI. Actually, Webmin is how I bridged myself from Windows GUI admin work to now prefering ssh. There are some tasks I still do through webmin though. Also, if your doing admin work, you don't really need to hit an already active user session so VNC server would get you a *nix GUI through VNC client on Windows. Look into setting up encryption for it though (maybe an ssh port to port tunnel just before you start up vnc client). Not that my thoughts should take away from anything you'll learn from the potentially pending how-to.

Neon Samurai
Neon Samurai

I've become a fan of your how-to here on over linux.com way. Your perspective approach would be an interesting addition. Now that I'm thinking about it: - how to share an SSH session with a local or other remote login session. (I'm lazy and haven't put ten minutes into looking at Snoopy or TTYSnoop) - how to share a local session desktop with a remote user (Remote Assistance style since RDP style means a seporate user session) Those would be the two cases that have come up in my past. Both have been desired to show a local admin how to do something.

Editor's Picks