Make remote tech support as simple as possible

Mar 07, '07 07:30:00AM

Contributed by: meikokun

I help out a fair few people with computer problems, and there are times when long explanations over the phone of what is going on with the other person's computer can just get too tiresome. VNC is great, free, and fast (if a little limited compared to ARD or Timbuktu), and a sweet way of seeing and/or controlling the other party's screen. Trouble is, with most people behind a NAT router nowadays, getting the tech-challenged to configure a router to allow port forwarding from their side is not for the faint hearted or short tempered.

Even though there have been tales of screen sharing coming in Leopard with iChat, for those of us who need it now (and free), here is a method which you can use to automate the connection from the other person's computer, overcoming any and all router issues from their side (something iChat hasn't yet completely conquered yet), and making the connection a one-click process. Even better, as this solution uses an AppleScript, you will see that we can automate the whole process so that no user intervention is required, as long as the other computer has Mail running.

A somewhat related hint has been posted here before, but it required physical access to the machine you wished to control to complete the setup, or that too long talk-through of the router setup (assuming you even know what the router type is!)

Once you have completed this hint for one person, and thus have everything set up, the next person will be connected to you in around 30 seconds to a minute tops, from scratch, which is pretty good in my books. Once the zip file is expanded, all the user has to do is double-click a file. For today's cookery lesson, you will need:

Read on for the detailed instructions...

Step One:

Fire up Script Editor.app, and type the following into the editor:

tell application "Finder"
  activate application "Schnitz Remote Lite"
  tell application "System Events" to keystroke ¬
   "xxx.xxx.xxx" & tab & tab & return
end tell
where xxx.xxx.xxx is your IP address, or if you are really smart, your DynDNS address, if you are not on a static IP. (I'm not sure if 'Enable access for assistive devices' needs to be checked in the Universal Access preference pane of the System Preferences for the automagical work to be done. But at the very least, this should type the IP address in.)

Check that it works by running the script. I've noticed that sometimes it doesn't hit the Connect button first time round, but on second attempt should do so. Whether this is due to the Finder locating the app for the first time I'm not sure. I don't think it's a deal-breaker.

Save this as a little application bundle. Name it something that you're support candidates will understand, like Double click me - vnc, which will also then show up in a later Spotlight search, and leave it in the oven to rise.

Step Two:

Go to your router, and configure it to allow port forwarding on port 5500 to your local address. With the gazillion routers that are out there, this step is achieved differently for different devices, but you may find some help here. For those who also sensibly have the Apple firewall engaged (System Preferences » Sharing » Firewall), you will also need to create a new rule allowing traffic in on port 5500.

If you want the traffic to come in on a different port, you need to set that in the script and firewalls too, of course.

Step Three:

Create a new folder, and neatly place your script application bundle and Schnitz Remote Lite.app in it, then zip it up. This is your gift to your geek-loving friends in need of help.

Step Four:

Start up CotVNC and then go to Connection » Listen For Server, or just hit Command-L. Make sure 'Local host only' is unchecked, then click Start. Remember, this is still secure as although the firewall is open and ports open to you, you are merely waiting for an invitation from someone else to look at their screen. Not even the spottiest script kiddie would be so dumb to try to attack you by letting you see their screen.

Step Five:

Now, email the zipped file which contains the Schnitz Remote Lite app and the script bundle to your soon-to-be-admiring friend in need, or send it over in iChat, and ask them to open the attachment. Ask them to double click the script. The point in Step One about it not engaging the connect button first time round could still apply, of course. However, all the main work is done (the inputting of the 'Listening Station' address), and so if the Connect button does not engage automatically first time round, they have but to hit it. The script has never failed to work fully on double-clicking a second time, and thenceforth runs perfectly.

You should now be connected to their computer, and looking at the mess which is their desktop. If you have been explaining this on the phone, you will now hear about how freaked out they are that the cursor is moving around by itself, and how cool you are for being able to do this from the other side of the world/town/country. Make it a one-click event by putting the folder you sent them in the Applications Folder, and then dragging the script to the Dock.

Now, in the future, when they need your help, you have only to open the port in your firewall, and look at Step Four again, and there are no more headaches trying to explain that the desktop is actually a part of the computer operating system, and not what the computer is often sat on. I could bore you with such tales of woe. But the fun doesn't stop there, oh no!

Since you now have control of their computer, head on over to their Mail.app, and open up the preferences. In the Rules section way on the right, add a new rule. Mine looks like this:

if ALL of the following conditions are met:
1. From Contains [your e-mail address]
2. Subject Contains startvnc (or whatever you want, just make it memorable)

Perform the following actions:
Run Applescript. Then choose the AppleScript you created that is now living with the Schnitz app in the user's Applications Folder. Give the rule some wacky name like startvnc and click OK. Go back to the General section in the Mail preferences, and make sure Check for new mail is set to Every minute.

Now, when your friend calls you pleading for help, and you send your them an e-mail with the phrase startvnc in the subject line, within 60 seconds you will be connected to their computer. This is useful for me on one computer I oversee, as the router to which the computer is attached frequently resets the port forwarding rules, denying me access. This used to result in a 20 minute conversation to talk the friend into putting his computer into the DMZ on his router. Now I don't even need his involvement to access his screen.

If you want to make sure that Mail is running, go get Cronnix -- a terribly nice little GUI for the cron tool for those of us who like pretty pictures instead of text -- and set it up to launch Mail every day. Or twice a day. Or ... you get the picture.

You can check your new Mail trigger is working whilst attached via VNC (even if you have quit the Shnitz app -- it leaves the VNC server app running in the background if you do not click Disconnect), as all that will happen is yet another instance of their desktop will appear.

You could set up a folder action too, and use Chax to download a sent file through iChat, or even have Cronnix open the script if you want to check in on the computer on a regular basis. Or, once you have access, of course, you can set up a proper VNC server, with all the port forwarding sorted, so that you can access their computer at will. CoTVNC has a very good little address list for this.

Obviously the potential for abuse here is large, so the usual caution about respecting other people's privacy applies.

I've used the Schnitz app, as it is a lovely neat little wrapper for the VNC server that performs just one function, but in a way that doesn't reduce the infirm to tears. You could (and I do) use another VNC server to do the same thing. Vine Server is very nice. But for those who like as few things as possible to screw up, I don't think the Schnitz app can be beat. The script has to be slightly rewritten for Vine server, and it goes thus:
tell application "Finder"
  activate application "Vine Server"
  tell application "System Events" to keystroke ¬
   tab & tab & "xxx.xxx.xxx" & return
end tell
This really has ended all my woes trying to connect to others' screens. On PCs, I recommend people use RealVNC, which leaves a little icon in the system tray that the user can click on and enter the IP address, and then connect. I'm sure there is some way to script that on a PC, but the mere thought of it makes me feel like I need a shower.

Hope this is of help to any of you who need to occasionally control another's computer for tech support, or whatever, and have better things to do than go through the pain of instructing someone else to set up firewalls or configure programs. For me, it's just nice to be able to give something back for once to this great community, from whom I've gleaned so many hints and good advice in the past.

Comments (24)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20070302234400232