How to Use a Mac and a PC with a Single Keyboard and Mouse

Scott's Desktop

As a web developer who prefers to use a Macintosh, I struggled to find the least painful way to test my work on a PC. Dual-booting was a possibility, but having to reboot every time I want to check IE was a pain. A KVM Switch was a little better, but it was still inconvenient, and I had difficulty locating one that would let me use my DVI monitor and USB mouse. I had a PC, but it bugged me having the second monitor, mouse and keyboard on the desk, getting in the way all the time. So you can imagine how happy I was to discover a way to share a single keyboard and mouse between two computers.

The solution, which seemed magical, turned out to be a program called Synergy. After installing the software on both computers, you assign one to be the server and one to be the client. The server shares its keyboard and mouse input with the client over the network, effectively creating a dual-monitor setup where one monitor is a PC and one is a Mac.

In my case, I’ve got my Mac set up as the server, and I’ve got the PC keyboard and mouse at the back of my desk, behind the monitors – though I could just as easily put them under the desk, or even disconnect them entirely. The instructions I’m about to share are for that setup, though you could easily adjust them to have the PC be the server, or to add extra client computers (Mac-PC-Linux Tri-Monitor System, anyone?). It also works flawlessly with the operating system’s native multi-monitor support (my coworker has a dual-monitor Mac and a third monitor for his PC).

Advantages

  • Clutter-free desktop with only one keyboard and mouse.
  • Easily jump from Macintosh to PC and back, without needing to reboot or flip a switch.
  • Cut-and-Paste between Macintosh and PC.
  • Use your favorite programs, regardless of Operating System – for instance, use TextMate on your Mac, and Outlook on your PC.

Disadvantages

  • Confuses coworkers using your computer – though this could be seen as an advantage.
  • Keyboard layout conflicts – Mac and PC keyboards put the ALT key in a different place, and the Mac uses the CMD key instead of the CTRL key. This can really mess with your muscle memory, and I constantly found myself trying to use CMD-C to copy text on my PC. Synergy lets you remap keys, but this again can confuse coworkers using your computer when the CTRL key doesn’t do what they expect.
  • Requires two actual computers, as opposed to dual-booting or emulation. This isn’t a problem if you already have two computers, but if you’re looking for an all-in-one solution, this won’t work for you.

Note: The two computers will need to be on the same network.

Macintosh Instructions

  1. Download and install the Synergy Mac Client.
  2. Open the new “SynergyKM” Control Panel icon.
  3. Click on the “General” tab.
  4. Select “Share my Keyboard and Mouse.”
  5. Check “Show Synergy status in the menu bar.”
  6. Click on the “Server Configuration” tab.
  7. Add your Macintosh:
    1. Click the Plus button to add a new screen.
    2. In the Name field, type the name of your Mac (this should match the Computer Name set in the Sharing pane of your Control Panel).
    3. You shouldn’t need to set anything under Screen Aliases or Screen Options.
  8. Add your PC:
    1. Click the Plus button to add a new screen.
    2. In the Name field, type the IP address of your PC (you can find this by typing “ipconfig” at a command prompt on your PC).
    3. Under Screen Aliases, add an alias and type the name of your PC (this should match the Computer Name set in the System Properties tool, found in your Control Panel).
    4. Under Screen Options, swap the Control and Command keys for the PC, to keep your keyboard layout the same between systems.
  9. Press the “Apply Now” button, and start Synergy if it isn’t started already.

PC Instructions

  1. Download and install the Synergy PC Client
  2. Start the Synergy program.
  3. Select “Use another computer’s shared keyboard and mouse (client)”
  4. Click on “Advanced” and set Screen Name to the name of your PC (this should match the Computer Name set in the System Properties tool, found in your Control Panel).
  5. Click on “Autostart” and click the Install button under “When Computer Starts” – which will start Synergy as a service on the computer.
  6. Press the “Start” button (which should automatically minimize the program to your system tray).

Note: You may need to restart one or both computers to get everything synchronized.

After following the above instructions, you should have the same setup that I do. My experience is then when I reboot either or both computers, it generally takes 15-30 seconds before the Synergy client on my PC picks up on the input from the Mac.

Screensaver Notes

One of the only hiccups I’ve encountered with Synergy is with screensavers. If I’m working on my Mac, and don’t touch the PC for awhile, the screensaver will start, and I can’t “wake it up” using my Mac’s keyboard or mouse. I think this is because I’ve got the “Require password to wake computer from screensaver” option checked on my PC. When that happens, I just reach up and give the PC’s mouse a poke. There is an option in the program to “Synchronize Screensavers,” but when I used it, it not only didn’t work, but it seemed to make the system unstable. Your results may be better.

Do you need a Keyboard and Mouse on the PC?

After I set my coworker Ryan up with Synergy, he disconnected his PC’s keyboard and mouse, and hasn’t had a single problem. He doesn’t use a screensaver on his PC (just the energy saver mode), so that particular problem doesn’t affect him.

Outside of that, the only situation I can think of where you’d need them is if you lost network connectivity, then your PC would be a paperweight until the network came back up.

So the answer is “Yes, if you’re paranoid like me, or use a password-protected screensaver,” but otherwise, you can go ahead and disconnect them with no problems.

References

  1. Lifehacker article about Synergy
  2. Synergy Macintosh Client
  3. Synergy PC Client
  4. Synergy Project Homepage

Update, 2/21/2008: Updated the URL for the Synergy Mac client to its new home on Sourceforge

Akismet Stops Comment Spam

I’ve been seeing more and more of the blogs I read lately complaining about comment spam attacks. Having had a bit of experience with this myself, I can sympathize.

The single best thing I can recommend is to get Akismet running on your blog. Since installing it several months ago, I have had zero comment spams. I check my filtered comments pretty regularly, and as far as I can tell, it’s never prevented a real user from commenting, or gotten any false positives. Comment spam has simply stopped being a factor in my life, and it’s nice. Akismet was originally written for WordPress in PHP, but versions have been released for just about everything, including Movable Type and even other platforms and libraries, like Ruby and Perl.

Sadly, the two examples I linked to won’t be able to use this, because Urn rolled his own blog in .NET, and Walkerings is hosted on TypePad (which doesn’t allow plugins, as far as I know).

How many times do you access the Internet in a month?

I just took a survey, and one of the questions it asked was: “In an average month, how many times do you access the Internet or online services? (Please write in your best estimate).”

I don’t even know how to begin to estimate this. Do I assume 10 times a day? 100? If I’m pretty much constantly online, does it just count as a single access? My answer could be anywhere from 1 to 3000.

I ended up putting 3000 just because it quickly gives the idea that I’m online all the time, but what a rediculous question.

Raise The Phoenix Shield!

Last night’s episode of 24 was excellent, except for one geeky problem. They fell into the classic trap of getting too descriptive with their technology. While explaining to Jack that they wouldn’t be able to hack into a suspect’s computers because he had technology that made CTU look “like an internet cafe,” they started describing the technology. In a completely wooden voice, Chloe started explaining about the “Phoenix Shield” which would encrypt all the files and delete the hard drive and blah blah. Any tech geek in the audience at this point is immediately kicked out of the previously immersive storyline, by this description. Allow me to break it down for any potential filmmaker out there:

No good can come from describing technology. One of two things will happen. Either your technology will be real and accurate (in which case it immediately becomes dated by the time the audience sees it), or it will be made-up and inaccurate (in which case geeks in the audience will be filled with contempt for your lack of understanding – “Firewalls don’t work that way!”).

For example, let me reference the two most grevious examples of this. First of all, we have the movie Hackers, which had all the characters drooling over a laptop. “Wow, a 28.8 Kilo-baud modem!” Now, while this is accurate technology, and was probably hot shit when the movie came out, it’s always good for a few laughs when we watch the movie now. The technology that the characters are crowing over is hopelessly dated.

Secondly, we have Independence Day, which has Jeff Goldblum saving the world by uploading a computer virus to the alien mothership. Ignoring for a moment the idea that the alien mothership runs a version of Microsoft Windows, how did he transfer the files? Did they get sent over the radio? Did the aliens just execute every file that appears on their computer? The technology is not accurate, which makes it harder for a geek to stay immersed in the story.

On the flip side of the coin, we have a perfect example of how to do it right – The Matrix. This film is all about computers and programs, and yet we are never shown a single example of a recognizable computer system. We see only two things. One, the GUI on Tank’s computer, which is a simple touch-screen system with big buttons – it’s not specific to any operating system or computer style, and it’s easy to see this kind of UI staying in use no matter what kind of computer is being used. Second, we have the matrix code itself. While we’re told in the movie that this scrolling green code is meant to represent the actual program code that is running the Matrix, it’s wholly illustrative. The code itself is meant to look like Binary (with Japanese katakana characters thrown in for good measure). Because it’s meaningless, we are left to fill in the blanks in our imaginations. It’s easy to imagine it as programming code like C# or even straight machine code. No matter what the future is like, code will exist, and this representation of code is not specific enough to get hung up on details – It’s like drinking out of a can labeled “soda.”

The worst part of this is that 24 is usually very good about this. All the characters work at fancy looking modern systems with very nice Dell flatscreens – but any shots of the operating system are running HollywoodOS – it’s not specific, it’s representative. And, most of the time, the things they’re doing are things we can actually do with computers – access satellites and security cameras, decrypt files, perform searches on database, and have videoconferences with the President. Hell, before they got carried away with telling us the specific technology, they actually did it exactly right last night – the analogy of CTU being an internet cafe immediately gave us the idea that the suspect had vastly superior technologies, and left the details to our imagination. But the lengthy description of the specific technology was too much. For me, it pushed the bounds of suspension of disbelief.

Net Neutrality

I’d seen the phrase “network neutrality” getting tossed around a bit, but wasn’t sure what it was all about. I looked it up, and while there’s a lot of hyperbole on both sides of the argument, I just can’t see any reason to support the COPE Act (which opposes Net Neutrality). I encourage you to educate yourself on the matter, and if you oppose this, please sign the petition.

Followup: I’ve finished my reading and have decided to sign the petition, and I’ll share with you one of the biggest factors in that decision. Some of the advocates of Net Neutrality include “legal scholars Lawrence Lessig, Tim Wu, Susan Crawford and others. Most of the major internet application companies, the so-called “Group of Six,” are also advocates including IAC/InterActiveCorp, Amazon, and especially Google. Microsoft has also taken a stance in support of Net Neutrality…” On the other side of the fence, opposing Net Neutrality, we have “the Bell companies and by some major cable companies. Cable operators, like Comcast have taken a somewhat mixed position — they have repeatedly affirmed that they consider neutral networks desirable, but think regulation is a mistake.”

If Qwest and Comcast think it’s bad, while Amazon, Google and Laurence Lessig think it’s good, that clarifies things for me quite a bit.