Recently I needed to connect to a Ubuntu box from a Windows machine because FGLRX just would not work with 3 monitors in surround view. Fortunately using a few tools made it much easier to interface with my Ubuntu box again.
Assumptions
- Ubuntu system named ubuntubox with ip 192.168.1.2
- Windows system named windowsbox with ip 192.168.1.3
Remote Access
For those of us who are comfortable with the command line, ssh is the only way to go. To make sure you have ssh installed, you can run (on your Ubuntu box):
sudo apt-get install ssh
This service should automatically start a boot up, and will allow you to open a terminal to access the command prompt. Now to access our ssh server, we need to download a ssh client for Windows. Look no further than PuTTY, which is free, open source, and easy to use. There are a few programs PuTTY provides, we just need putty.exe and optionally plink.exe (for next post in this series).
These can be downloaded at the PuTTY download page.

Once downloaded, you can put putty.exe pretty much anywhere you can remember it. I just left it on my desktop and dragged the shortcut to my quick-launch bar. Double click putty.exe, and in the dialog box labeled “Host Name” go ahead and enter your Ubuntu box’s IP address.
Click “Open” when you are ready to connect, and it will prompt you for a username and password. You should already have a username and password from your Ubuntu install.

If you want your prompt to be colorful, you need to type ‘nano .bashrc’ at the prompt, and scroll down to the line that looks like “#force_color_prompt=yes” and remove the “#” character. After logging in it should now have colors. If you want other cool tips for your shell, I suggest you check out the Ubuntu Wiki as I wrote up a specification on making it more usable: Enhanced Bash.
At this point you should have remove access to your Ubuntu system.
Sharing Files
We need a good way to share files between these two systems. A lot of people will suggest Samba / CIFS (which is really a technical way of just saying Windows File Sharing). I think that Samba / CIFS lacks any technical merit, and is harder to configure. I am going to show you two ways of sharing files, both which use SSH.
WinSCP
WinSCP is basically CuteFTP or whatever FTP program you grew up with, but instead it works with SSH. It is incredibly easy to use. Go ahead and download WinSCP from their website. You can download either the portable executable (which means you can run it from anywhere without installing) or the full installer. Either one will work for our purposes.
The download page is at: http://winscp.net/eng/download.php. To connect from Windows to our Ubuntu system, go ahead and install the program (or not if you downloaded the portable version). Once you start it up, it should look like this:

Go ahead and fill in the IP address for your system. It is going to say it doesn’t know it’s key yet, go ahead and click Yes there. You will now see your home directory on your Ubuntu box and your Windows box. You can now drag files back and forth, and better yet, encrypted.
Something More?
As a programmer, one thing I need is a great editor. I happen to use VIM to code everything I make. VIM through SSH is ok, but one problem I have is I can’t use any of the really cool color schemes out there, as PuTTY is limited to 256 colors. There are some plugins out there which are supposed to convert the color schemes, but none works reliably for me. Luckily, GVIM is available for windows, so I went to their download page: http://www.vim.org/download.php and downloaded / installed it.
This was great, but for Django development I really wanted to edit the files in place, via a shared folder, instead of using WinSCP every 10 seconds (I use test driven development, as in I may change a file 5 times a minute). How do we go about using our SSH server as a shared folder under Windows? We can use the free / open source program Dokan.
Visit their download page, and retrieve the “Dokan library” and “Dokan SSHFS”. Their download page is at http://dokan-dev.net/en/download/. Install the Dokan Library first. After installing that, install Dokan SSHFS. Once installed, Dokan SSHFS will appear under your start menu. Go ahead and run it:

This should be a familiar pattern by now. Go ahead and set the “Host” file to the ip of your Ubuntu system. You will also need to provide a username and password. In the screenshot above you can see that my SSH server will be mounted as my N: drive now.
With SSHFS up and running, I can now edit files directly on my Ubuntu server. Combining that with GVIM, I can use an editor that provides excellent syntax highlighting:

In this screen shot I am using the Wombat theme for GVIM, and the Microsoft font Consolas. Consolas is freely available for Windows XP if you download the Office 2007 compatibility pack, or PowerPoint Viewer.
Related posts:
#1 by Paul Kishimoto on July 5, 2009 - 7:43 pm
Quote
FileZilla (http://filezilla-project.org) also works over SSH.
#2 by David on July 5, 2009 - 11:16 pm
Quote
It’s also worth mentioning Samba, the classic way of networking linux+windows together.
https://help.ubuntu.com/community/SettingUpSamba
#3 by Andy on July 6, 2009 - 4:55 am
Quote
You can also run an X server in Windows and then do X-forwarding:
Install:
http://sourceforge.net/projects/xming/
Then, run putty and one of its options lets you forward X stuff. Then you can run graphical apps remotely.
(there is also the vnc server built in… but X forwarding is nicer I think)
#4 by A Different Andy on July 6, 2009 - 9:51 am
Quote
I suggest you take a look at NoMachine’s NX remote desktop/remote app technology. It’s kind of like VNC or forwarding X over SSH, but much better. File sharing, printer sharing, and forwarding of audio to the client are all supported. The free version of NoMachine’s NX Server is easy to set up, but somewhat restricted. The server put out by the FreeNX project has no restrictions, but is a bit fussier to set up.
http://en.wikipedia.org/wiki/NX_technology
#5 by Peter Kirn on July 6, 2009 - 11:06 am
Quote
Nice tips here. Definitely picked up some additional tricks next time I do this.
The NX stuff looks quite nice. Now, my hard-core Mac advocate friends keep pushing Leopard’s screen sharing feature, which compresses its video stream via H.264… interesting. I wonder if there’s an open-source equivalent of this? (OGG Theora, anyone?) I have only one MacBook, so haven’t tried this myself, but it’s quite nice in action.
I’m also still looking for a Linux tool that works as nicely as WinSCP; not as enthusiastic about FileZilla. Nothing against command-line SCP, but sometimes it’s nice to have a view of what you’re doing.
#6 by aviezab on August 15, 2009 - 8:24 pm
Quote
good tutorial.
i’m a new linux user.
that motivate me to learn anymore… thanks friend, greeting from Indonesia
#7 by lloyd on December 3, 2010 - 10:50 am
Quote
ive started using linux yesterday, is nice
#8 by kathryn on January 26, 2012 - 2:40 am
Quote
Thanks! This was very helpful.