For over a year now, I've been working remotely for Cloud City, telecommuting from my office in Salt Lake City. It's amazing being able to tap into the vibrant Ruby community in San Francisco and work with such great people and clients from hundreds of miles away. Google+ Hangouts, Skype, HipChat, screen sharing, document sharing, and now even Sqwiggle (as of May 2016, shutting down and no longer accepting signups) have become regular parts of my day — I love living in the future!
We do a lot of pair programming, and figuring out what works best for remote pairing has been an ongoing process. There are 3 general approaches, and I'm going to touch on each.
First, though, I'll mention that I combine all of these methods with a two-way video chat via Google+ Hangout or Skype. Having a constant video connection helps personalize remote pairing and make it that much closer to being side-by-side. This means that dual monitors are, for me, a requirement for remote pairing.
Desktop Sharing
This is pretty straightforward - just share your entire desktop so both you and your pair can work on the same computer using whatever development tools you wish. This is a turnkey solution for any type of environment, but the experience for the remote pair is not ideal. Lag is a big issue, particularly when scrolling and application switching, or when your internet connection is not perfectly reliable (think coffee shop WiFi).
There's no end to the options for screen sharing. From older protocols (VNC, RDP) to more user-friendly services (TeamViewer, Splashtop, LogMeIn, ...), I've tried almost all of them. TeamViewer was my preference for quite a while due to its speed and customizability, but I've had significant problems with their client software. Recently I heard about Screenhero, which gives both sides their own mouse cursor. It's a novel addition to the experience but adds a lot, and it's my current choice for desktop sharing.
Collaborative Code Editing
Rather than sharing your whole screen, another approach is to remotely share an entire project environment which can be worked on by more than one person simultaneously (think Google Docs for code).
There are quite a few options for web-based collaborative editing of single files, but most aren't nearly robust enough for working on an entire project. The exception is Cloud9 IDE. With Cloud9, you set up a workspace which runs on its own cloud server instance (or you can tie it to your existing server) and gives an amazing web-based IDE with collaborative editing capability and other goodies like easy deployment. You and your pair can work on the same file at the same time and see each other's cursor, or you can just work separately in the same project space.
The downside, of course, is that you are tied to their web-based IDE rather than your preferred tools, but if you can get past that, Cloud9 IDE is a very attractive option.
An honorable mention goes to Nitrous.IO - this service has promise but is still behind Cloud9 IDE in terms of functionality and polish.
Terminal Sharing (tmux + vim/emacs)
For those of us still attached to "the old ways", you can always just share a terminal session using tmux and then use vim or emacs. If you and your pair are both familiar with these tools, I think this is the ideal solution because there is almost zero lag involved.
Here's how it works: First, you both have to be attached to the same server. This can mean you are both SSH'ed into the same remote server, or just one of you is SSH'ed into the other's local machine (I'll leave these details out). Then one of you can start a tmux session:
$ tmux new -s remote-pair
Then the other can connect:
$ tmux attach -t remote-pair
That's all there is to it! For bonus points, you can even access the remote web server through SSH tunneling so it doesn't have to be accessible to the world. Simply add the -L option when connecting (assuming port 3000 for the dev server):
$ ssh -L 3000:127.0.0.1:3000 user@12.34.56.78
Then access http://localhost:3000/ and your request will be sent to the remote server - handy & secure.
I'd love to hear about what you're using for remote pairing and how it works for you, I'm always looking to improve my development environment. Cheers!
Breaking News: Just a few days ago, @FredKSchott released a collaborative editing plugin for vim. I've been waiting for this functionality for a long time! If you're a vim'er, check it out for sure.