Synergy + Outlook 2007 pain FIXED
![]()
I have been using Synergy for quite a while to control multiple computers on my desk. Synergy allows you to use one keyboard and mouse across multiple computers and monitors. I have my main PC with dual monitors in the center, an old PC with a monitor to the left that I primarily use for GWOS status, and my laptop on the right where I generally display Thinking Rock (GTD app) or watch instructional videos related to whatever I'm working on at the time. Synergy allows me to simply move the mouse to the left or right edge of a monitor and the pointer and keyboard focus seamlessly pops from one computer to another.
A couple of years ago, I noticed that switching from one screen to another occasionally caused a lag of 5-10 seconds where mouse movements were not accepted. After attempting to troubleshoot the problem for a while on several different occasions, I mostly gave up and just accepted the problem. This morning, I ran into the problem again and the hassle once again crossed my pain threshold far enough that I began another troubleshooting run.
After trolling through the Synergy support forums for a while, I noticed that several other users were experiencing the same problem, but there were generally no fixes offered. I did some search tuning and began to notice a trend. Many of the users reporting the problem also reported running Microsoft Outlook 2007, which is the corporate-mandated email client that I am unfortunately forced to use. Hmmm. Come to think of it, my Synergy problems probably started around the same time I upgraded to Outlook 2007. A little further experimentation confirmed my suspicion. With Outlook selected as the foreground application, switching screens exhibited the pointer lag. With any other application selected as foreground, there was no lag and switching screens was seamless. AHA!
Having finally located the source of the problem, I began searching for a solution. I initially thought the issue might be caused by the Outlook option to change the mouse pointer when email arrives, but turning off that option (after finally locating it in the arcane jumble of Outlook configuration dialogs) didn't help. I then thought to turn up debugging on Synergy and noticed that when switching screens with Outlook active, it looked like Synergy was basically resetting itself, which would probably cause a lag of several seconds while the main PC waits for the clients to reconnect.
More searching... I finally found the answer in a comment to a post from a frustrated Synergy user having the same problem I was having. Simply check the "Don't take foreground window on Windows servers" checkbox in Synergy options and restart Synergy. I was then able to select Outlook as foreground app and switch screens without a lag! Problem solved by a simple config change after dealing with it for so long.
Come to think of it, that is often the case with many of the large systems I deal with. After manually dealing with a recurring issue for a while, I'll get fed up (lazy) and write a script to automate the process. I will then later find that there was some arcane option to deal with the problem that I simply had to enable. Sometimes the documentation for the system doesn't even cover the option and the only way to find it is to search a vendor knowledgebase using a particular combination of keywords. On the bright side, at least I get to stretch my scripting skills on occasion when these things come up.
Anyway, back to Synergy. I had noticed that Synergy had not been updated in a few years. During my search for a solution, I found Synergy+, which is a fork of the original Synergy that is being updated and maintained on a current basis. Maybe I'll try that version at some point in the future, but for now, my original problem has been solved and Synergy is back to its quiet yet important role of simply improving my productivity without my having to think about it.
Windows: svchost.exe taking up a lot of memory
One of my coworkers has been keeping an eye on a couple of Windows Server 2003 boxes at work due to some problems we have had with them. He sent me a screenshot of Task Manager showing a svchost.exe instance using more than 1GB of memory. Unfortunately, by the time I checked the server, the process was gone.
Since svchost.exe can host many things, I did a little research and sent the following command to him to help us identify what's consuming so much memory:
tasklist /svc /fo list /fi "imagename eq svchost.exe" /fi "memusage gt 1000000"
That will show any svchost.exe processes that are consuming more than 1GB of memory. It will also list all the hosted DLLs so we can track down the culprit. Of course, all the same info is available in Process Explorer, but we don't have that installed on the box in question (although I am thinking of suggesting that we make that a standard part of our server loadout).
I may also encapsulate the tasklist command above into a Nagios check and run it against all our Windows boxen. That's what I like about having a flexible monitoring system like Nagios in place. As we find new things to check, we can just add them and the whole thing is automated from that point on.
New Monitors
I recently mentioned to my supervisor at work that my old 21" CRT monitor was getting a bit blurry. He said to speak to the manager of the PC Techs about ordering a replacement LCD.
A couple of weeks later, I was the proud recipient of dual 22" widescreen LCDs. Since the PC Tech manager was ordering a similar setup for himself and a couple of the PC Techs, he just included mine in the order.
I spent several hours over the past couple of days struggling with dual-head video cards under Windows Vista. My first attempt was an ATI card that was physically too large for my small-form-factor Dell. I then tried an older Nvidia that fit in the case, but had driver issues. I finally fell back to the built-in Intel graphics chipset with a dinky add-on that Dell supplies to share the display between two monitors. It shares system memory and isn't very high performance, but it works for now. I may try to order a better video card in the future if performance is a problem.
Below is a photo. The monitor on the far left is connected to a separate PC displaying Groundwork (Nagios) which is monitoring all the servers. I also have it connected to a KVM so I can hook up other stuff as needed. The two monitors in the center are the new widescreens. I put one in a portrait setup so I can view full-page documents without having to scroll around. My laptop is on the right with its 17" widescreen.
Everything is tied together with Synergy, which allows you to use a single keyboard and mouse to control multiple PCs and displays. Works very well.
VMWare: HOWTO clone a Windows VM
Care must be taken when cloning a Windows VM to ensure that a new SID is generated in order to properly assign access controls. There are also steps necessary to ensure the new VM has a unique UUID and MAC address. Here is the proper way to clone a Windows VM for hosting under VMWare Server:
- Shut down the source VM
- Copy the VM directory and rename
- Edit the target .vmx file and remove the lines that begin with: "uuid.location", "uuid.bios", "ethernet0.generatedAddress", and "ethernet0.generatedAddressOffset"
- Start the target VM and login as local admin
- Change the IP address
- Run NewSID to replace the existing SID with a generated one. Choose to rename the PC and enter the new name.
- Reboot the target VM
- Join the domain (if applicable)
- You may now boot the source VM
Windows Network Load Balancing: easier than I thought
Several months ago, we had a vendor come in to implement a Windows failover cluster for our document imaging system MS SQL server. The implementation failed. The vendor tech who was attempting to set up the cluster attributed the failure to an underscore character in our internal domain name. Not sure whether that was the cause of the problem, but we ended up reverting back to our single server setup after 30 hours of downtime. The whole experience left me wary of Windows clustering in general.
We are now in the process of implementing a Windows Network Load Balancing cluster for a 3-node term. server setup on a new app. Both myself and a fellow sysadmin came into the situation expecting problems. Since it's a new application that is not yet live, we figured we could weather any problems without having to worry about downtime. As it turns out, NLB clustering is almost dead simple.
The vendor tech who was supposed to be assisting us with the cluster setup joined us on a conference call 30 minutes late, mumbled his way through some email looking for something, then emailed us some documentation and basically said, "Here, read this and call me back in an hour so we can set up the cluster." I looked at my coworker, we both shrugged, and hung up the phone. We naively expected the vendor to be a lot more helpful.
After going to lunch, we came back and skimmed through the documentation a few minutes before calling the tech back. He tried walking us through manually configuring each server's network adapters, but we ran into problems with trying to do the setup with a single adapter on each server connected to the switch. It was obvious that the tech was not familiar with clustering and was just reading through the documentation and telling us what to do. After fumbling around for an hour or so, we told the tech we would call him back after connecting the second network adapter on all three servers.
I had been reading ahead a bit and discovered that Microsoft provides a Network Load Balancing Manager app as part of its Server 2003 admin pack. We removed all the mess and got the servers back to a clean network config, then used NLB Manager to build the cluster from scratch. Once we realized the difference between the primary cluster IP and the dedicated IP (hint: the primary cluster IP is the same on all nodes; the dedicated IP is a second unique IP assigned to each node to allow them to talk to each other), we got the whole thing set up in just a few minutes.
We called the vendor tech back and said, "Ok, it's working now." He assumed he was responsible for getting it going and we just let him bumble happily on with that assumption as we got off the phone. We proceeded to test the cluster by making RDP connections from several PCs to the cluster name. The first server in the cluster accepted around four connections before the second server began picking up new connections. The whole thing worked pretty much flawlessly from that point on.
We had originally built the cluster with two servers while the primary users worked on building the app using the third term. server. We later added the third server to the cluster without problems. After promoting it to priority 1, we were able to connect via RDP and it immediately started sharing the load. Nice!
We're looking at how easy it was to set up and coming up with all sorts of uses for this new tool in our kit. Now, I'm not so wary about Windows clustering. I may even build a couple of virtual machines and attempt to put together a test failover cluster myself. If all goes well, I'll just implement the failover cluster on our document imaging system myself. With the level of "assistance" we're getting from vendors, we should probably just plan on implementing future changes ourselves.
One miiiiillion files
A sysadmin rule of thumb I had occasionally heard in the past was to limit the number of files in a directory to around 2000. Larger numbers of files were historically difficult to deal with on old systems with limited RAM and processing capability. And of course old filesystems had limitations on the number of files per directory as well.
We are migrating data from our old document imaging system to our new one. As part of the process, we shipped off a copy of all the optical platters from the old system to an agency that supposedly specializes in the migration process. They pulled the image data from the platters and dumped it all to USB drives along with scripts that we run through the new system to import all the images with the correct index information. I just received two of the three USB drives, so I hooked one up to a virtual machine to see how things look.
Two directories on the root of the drive, one for images and one for scripts. Took a look at the images directory. Lots of subdirectories with lots more subdirectories under each one. Looks ok.
Changed to the scripts directory. Since I'm browsing in Windows Explorer, I get the animated folder and flashlight indicating that it's reading the directory info, please wait. Ok, no problem. I go check my email. Come back to the window a couple of minutes later and it's still reading. What's going on here? Since I'm running it on a VM, I think maybe that's slowing things down.
I close the window, disconnect the drive, and connect it to my laptop. Open a DOS prompt. cd to the directory and type dir. Text starts scrolling by. Looks like all the scripts are in one directory with no subdirectories. Ok, that's to be expected since the test batches the agency sent us previously were laid out the same way. No problem, how many files could there be in that directory? (Text is still scrolling in the window.) I minimize the window in the hopes that it will speed up the process if it's not having to update the display.
I go do something else for a while. Come back about 5 minutes later and bring the DOS window back up. Still scrolling. WHAT?!? This is crazy. I don't remember offhand whether the dir command under DOS even shows the file count anyway (It does, as it turns out.), so I ctrl-C the process and close the window. Gotta break out the real command line utils. I launch a cygwin bash window and cd to the directory in question. Type "ls -1 | wc -l". For the uninitiated, this will generate a single-column listing of the files in the directory and pipe it to the word count util, which will count the number of lines returned. I leave this running and go down the hall to the datacenter to start a Red Hat install on a new box.
I come back to my desk about 15 minutes later and the process is still running. This is crazy! I trust bash more than DOS, though, so I let it run. Finally after about 30 minutes, the prompt suddenly appears again. I look at the output of the wc command. Count digits. Double check. Yes, my first glance was correct. One million, fourteen thousand, seven hundred eighty seven files in a single directory. I'm actually mildly surprised the FAT32 filesystem can handle that many files in a single directory.
My next challenge is copying all those files to a directory on the server that needs to process them. Is the DOS copy command up to the task? We shall see...
diff ‘Linux traceroute’ ‘Windows tracert’
A coworker and I were trying to debug a remote connectivity issue between a Windows box connected via a Juniper SSL VPN to a RHEL box. We were able to do a tracert from a Windows box through the Juniper, but a traceroute under Linux would not work. We checked for iptables rules, routing, etc. to no avail.
I vaguely remembered something about a difference between Windows and Linux/UNIX traceroute. Something about one using ICMP and the other using UDP. I finally found in the traceroute man page: "-I Use ICMP ECHO instead of UDP datagrams." I slapped a -I argument in there and traceroute began to work.
My coworker said, "Well, I guess we just have to remember that Linux traceroute is buggy." Grrr. I said, "Or maybe it's Windows traceroute that's buggy and non-standard. [thoughtful pause] Although it does seem like ICMP would be the protocol to use for traceroute."
We talked about reading the RFPs for an answer, then shrugged and went on with our duties. It would be nice to be able to argue that one implementation of traceroute more closely adheres to the RFPs than another. Honestly though, outside the two of us having the discussion, there's probably nobody else in the office that even knows what an RFP is.
NetBIOS Aliasing
Here’s a nifty trick I just learned. I have a Win2003 server at work that needs to respond to multiple NetBIOS names.
- Regedit HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ lanmanserver \ parameters
- Add OptionalNames REG_SZ and set to alias name
- Restart Server service