Archive for Desktop “Administration”

Ubuntu Not Recognizing Changes To /etc/hosts

ah-ha

A moment ago, I finally figured out why changes to /etc/hosts on my local Ubuntu desktop were not being honored. In the past, it worked just fine, as expected, but this morning, it refused to recognize changes. I searched all over the web and found lots of people with the same problem, but no solutions. Plenty of helpful suggestions, mind you, but nothing would work for the folks who tried them. So, the solution? My NSCD was caching it. Perhaps there was a default value change recently, or maybe I just somehow never noticed it before because I’d add the entry prior to trying to work with the host. Not sure the ultimate reason, but the fix is in:

sudo vim /etc/nscd.conf

Change:
enable-cache hosts yes
…. to:
enable-cache hosts no

And then restart NSCD:

sudo service nscd restart

Voila! Finally, I can get on with my work for the day.

Horribly Slow Speeds On USB Stick, Ubuntu 12.04LTS (100KB/s?!?)

23426115i_01

I just finished building a new server for the house here and downloaded the latest build of Ubuntu Server 12.04LTS. My desktop is running an upgraded version of the same (but Desktop, not Server edition). Trying to create a USB boot disk to install on the new box was painfully slow: it was going to take 2.5 days.

After searching all over the web to see what others thought, checking the USB settings in my BIOS, and even rebooting for the sake of a potential fix chalked-up to voodoo, I realized the answer. Checking the USB stick’s partition, it was – unsurprisingly – FAT32. Once I dropped the partition (the stick was brand-new, just opened the package) and created a new ext4 partition in its place, I created my new USB boot disk in 38 seconds. That’s much more like it.

Windows Server Says, “Network Cable Unplugged” When It’s Not?!?

Once again, stuck managing a Windows box. Yeah, I know, I’ll whine, bitch, moan, and cry you a river another time.

The Problem: Using the secondary NIC (PNET/VLAN), I found a lock of packet collision during negotiation, handshaking, and identification, causing Windows to give up and basically say, “well, since it’s not working, the cable must physically have been removed, because there’s no way I could ever be wrong.”

Wro…. err…. incorrect, Windows. (You’re wrong.)

The Discoveries: The truth was, at least in my case, that it wasn’t properly handling the gigabit capabilities of the card on the box. I’m not the administrator for these machines (though they’re housed in our datacenter), so I can’t be certain that nothing had changed recently, but their staff said nothing at all had been modified. Perhaps that really was the case, and nothing had been changed — Windows has been known to do stranger things than this, of course, sometimes out of the blue.

The Solution (for my case): Go to the screen where you can view your network adapters (your version of Windows dictates the path of navigation, hence the ambiguity). Next, right-click the adapter with the “Network Cable Unplugged” message and click “Properties.” Click the appropriate button to configure the network adapter. Then click the tab on that dialog for “Settings” or something of the like (sorry, but I logged out in a hurry, so this is from memory), and you’ll see a list of parameters on the left, with their values on the right. Find one related to speed and duplex, and if you see it set to “Auto” or similar, drop it to “100Mbps Full Duplex” and click OK. Close the properties dialog by clicking “OK” and see if the settings are already bringing the network adapter back online. If not, disable and re-enable the adapter, and – if it was indeed the same issue – you should be back online within a few seconds.

Skype and Google Earth Causes X To Crash On Ubuntu 10.10

[UPDATED 19-JAN-2010 – Thanks to Drew (in the comments) for bringing up the fact that this is only for 64-bit versions of Ubuntu. The filenames would indicate that, but no sense wasting your time if you’re looking for a 32-bit solution. Well, at least not yet. I may do a 32-bit build if there’s a need, but it seems as though the official repos may now have the patched versions. Have you gotten an official solution that resolved the issues? Feel free to let me know in the comments.]

After months of dealing with the mouse getting stuck between monitors, blinking like crazy and freezing all but remote SSH administration of my Ubuntu 10.04 (Lucid) desktop with triple-head monitor setup, I gave up and upgraded to 10.10 (Maverick) in hopes that it would fix the issues. I didn’t know if it did or not, because it introduced new errors. Worst of all: any time I would launch Skype, the screens would go black and X would crash in a segfault and restart. The same was true of Google Earth and of at least all Qt applications on the desktop. It took a good thirty-six hours before I traced everything back and came up with a solution. So now I’m running 10.10, which not only has a couple of minor improvements, but also seems to have finally fixed the mouse-locking issue. Hooray!

My issue turned out to be rooted in an issue with Xinerama on X with multiple monitors on an x86_64 box running the final stable of Ubuntu 10.10 (Maverick). If you have the same issues (Skype crashes X), try downloading the following file (routed through my company’s URL service so that it’s easier to share):

http://links.parasane.net/fvsq

The filename is xorg_crash_fix_debs_and_NVIDIA_driver_x86_64.tar.bz2, with the following hashes:

MD5: fe2fa5684a0f051d552bd7d0b4ee6f6a
SHA1: 0edea79d4832ce31954e29991405a67403732639

Applying it is simple (provided you have experience in knowing how to resolve your own dependencies, if any are missing). If you’d like to nip it in the bud before getting started, here’s an all-inclusive list of all packages of which I’m aware that you should have installed or which may be needed to finish this process without errors (feel free to pick and choose on your own, if you’re more comfortable doing a minimalist installation):

sudo apt-get install debhelper quilt bison flex xutils-dev x11proto-bigreqs-dev x11proto-composite-dev x11proto-damage-dev x11proto-xinerama-dev x11proto-randr-dev x11proto-record-dev x11proto-render-dev x11proto-resource-dev x11proto-scrnsaver-dev x11proto-video-dev x11proto-xcmisc-dev x11proto-xf86bigfont-dev x11proto-xf86dga-dev x11proto-xf86vidmode-dev x11proto-dri2-dev libxfont-dev libxkbfile-dev libpixman-1-dev libpciaccess-dev libgcrypt-dev nettle-dev libudev-dev libselinux1-dev x11proto-xf86dri-dev x11proto-gl-dev libxmuu-dev libxrender-dev libxi-dev x11proto-dmx-dev libdmx-dev libxpm-dev libxaw7-dev libxmu-dev libxtst-dev libxres-dev libxv-dev libxinerama-dev devscripts build-dep xserver-xorg-core

The steps to installing the fixed binaries are:

  • Drop to an alternative TTY prompt: Press CTRL+ALT+F1
  • Download the package file: wget http://links.parasane.net/fvsq -O xorg_crash_fix_debs_and_NVIDIA_driver_x86_64.tar.bz2
  • Uninstall your current NVIDIA drivers: sudo nvidia-uninstall
  • Decompress the file linked above: tar -xjvf xorg_crash_fix_debs_and_NVIDIA_driver_x86_64.tar.bz2
  • Change to the newly-created directory: cd xorg_crash_fix_debs_and_NVIDIA_driver_x86_64/
  • Install the core and common packages: sudo dpkg -i xserver-xorg-core_1.9.0-0ubuntu7_amd64.deb xserver-common_1.9.0-0ubuntu7_all.deb xvfb_1.9.0-0ubuntu7_amd64.deb
  • Set execution permissions on the included NVIDIA driver: chmod 0755 ./NVIDIA-Linux-x86_64-260.19.21.run
  • Execute the new NVIDIA driver: sudo ./NVIDIA-Linux-x86_64-260.19.21.run
  • Reboot the system: sudo shutdown -r now

You should now have a fully-working X system again. And if you upgraded because of the mouse-hang issues, you should be in good shape there, too!

NOTE: It should be VERY obvious, but this comes with absolutely no warranty or guarantee whatsoever, and you’re completely responsible for any issues that arise, directly and/or indirectly, from usage of these packages or instructions, et cetera. You know the drill by now, I’m sure.

SSH Client On Ubuntu Desktop Timing Out

It would happen again and again and again…. I’d walk away from the computer (yeah, on rare occasions that happens), or I’d flip to another terminal and get sidetracked there:

Write failed: Broken pipe

Son of a bitch! And why the hell don’t I remember to vi in screen until moments like this?!?

Well, unless I keep ‘top’ open or run a while [ 1 ]; do echo -n '';sleep 30; done, it continues to drop out without fail. And an interesting (to me) fact that I’ve actually recorded: I spend more than 60% of my day on the command line.

Logically, the first things I tried were to add /etc/ssh/ssh_config parameters for both KeepAlive and TCPKeepAlive, but that still had no positive effect. Then I started to dig deeper into the issue to see what other options I had. There were no network problems or abnormally-high numbers of dropped packets or shards, it would happen regardless of whether it was WiFi, 3G, or LAN cabled, and all other network services and applications were working just fine — including things like telephony, which was perfectly clear. I knew that it had to be a timeout issue, and since it wasn’t restricted to just a single server (or even to just thirty or forty servers, for that matter), nor was it an issue until I [finally] switched from Mandriva to Ubuntu, it had to be a local problem.

I dug and dug and dug, almost all the way to Virtual China, and finally found my Holy Grail:

ServerAliveInterval

Right now, I’m using ServerAliveInterval 120 and, for the first time since the issue reared its ugly head, I’ve been able to keep SSH sessions open and idle overnight. Hoorayings for Internets funs again and stuffs! Now maybe I can stop losing time on this and go back to only dealing with the issue of my mouse getting stuck between screens with Xinerama

Binding Windows Key to KDE Menu In KDE4

Seems to be a lot of confusion in KDE4 as to how to bind the Windows key on a standard keyboard to the KDE menu. Well, let’s make the solution brief:

1.) Drop to a command prompt (such as konsole).
2.) Type: xev
3.) Press the Windows key (either side, or both sides individually) and notice the number assigned to the ‘keycode’ identifier.
4.) Create (or edit) your .Xmodmap profile file. Example: vi ~/.Xmodmap
In your .Xmodmap profile, add the following, where ### is your keycode from above, and save the file:
keycode ###=F13
5.) Back at the command line, activate the above by typing: xmodmap -e ‘keycode ###=F13’
6.) Right-click the KDE menu and click “Application Launcher Menu Settings” from the menu that appears.
7.) Click “Keyboard Shortcut”.
8.) Click the button with the picture of the wrench on the “Keyboard Shortcut” screen and press the Windows key. You should see F13 appear in the box.
9.) Move your mouse out of the box and click the “OK” button to close the dialog and activate the key.
10.) Press the Windows key and see the menu pop up as expected. NOTE: You can’t tap it again to close the window. Instead, you’ll need to press the ESC key or click elsewhere.

NOTE: The above is done for brevity. A good lesson to learn from this is that ‘xev’ is a useful tool, and ‘xmodmap’ is your friend. Oh, and that the KDE folks still haven’t gotten their crap entirely straight with KDE4 as of version 4.2.4 (the version in which this was tested).

There are also other ways. In fact, I did the following for my Mandriva 2009.1 + KDE 4.2:

cat << EOT >> ~/.kde4/Autostart/bindWindowsKey.sh
xmodmap ‘keycode 133=F13’;
xmodmap ‘keycode 134=F14’;
xmodmap ‘keycode 135=F15’;
EOT

Now to figure out why Plasma keeps interfering and disabling the damn thing when I restart X or relaunch the session…. maybe I’ll post back here later.

Windows 7 DWM (dwm.exe) High CPU Performance Issues

On this system, I’m blessed with a triple-headed setup: I have three nice LCD monitors on my desktop which create a panoramic view of my terminal screens. I’m also cursed with Windows 7 and it’s [many] flaws. Lately, I’ve been having an issue with Windows 7’s Desktop Window Manager (DWM, shown as dwm.exe in Task Manager) consuming large amounts of CPU and RAM resources. After a bit of snooping around, I found a simple fix:

1.) Click the START button.
2.) Type “powershell” into the “Search programs and files” box.
2a.) If you see a menu item for PowerShell, open it.
2b.) If you do not see a menu item for PowerShell, this won’t work for you.
3.) Type “net stop uxsms”
3a.) Try this if you want a stripped-down version of your ALT+TAB and fewer bits of eye candy. It’s just like WinXP, and runs quicker. If your ALT+TAB was slow, it should now zip along quite nicely.
3b.) If you want your effects and nicer ALT+TAB screens back, type “net start uxsms” and you should be good to go.

Debunking The Vista-ry: Case of the Disappearing DNS

Yeah, I’ll be the first to coin the term Vistary. I’ll use it to reflect the many, many issues Vista still has that crop up at seemingly random intervals with no warning or explanation.

Lately, the most enjoyable problem has been intermittent DNS failure requiring a full restart. At seemingly random intervals, I’d be happily plugging away at whatever it was that I was doing, only to have Vista take a crap and refuse to do any more named translations. Here’s a real-world scenario from this morning:

While chatting with Eric Butera on IRC and simultaneously bopping around the web on Chrome, BAM! Once again, the DNS drops out. Aside from my vast, genius-level knowledge of every single aspect of the world around me, how did I know it was just DNS? Elementary, my dear Watson: as in all of the other occurrences, IP-based connections continue to operate normally, while all name-based connections (including connections to MSN’s Messenger service, Gmail, etc.) all start to fail and die off.

For the life of me, I couldn’t figure out what the issue was, nor how to recreate it to debug it. Searching Google did little more than to reveal others who had the same issue, with some suggestions as to what may be the cause and solution (all of which were later denied to solve the problem). My router was fine, UPnP wasn’t an issue, and the parity-error-checking device between the chair and the keyboard was operating at relatively sane levels at the moment.

After getting to the point where this system was about to join its ancestors in the grave, I found my own solution.

Even though I’m using WiFi, which – on here – has no option to share the connection, it was causing an error for some reason. Perhaps something in the networking section of the Windows kernel causes its internal (and proprietary closed-source) BIND-like implementation of a DNS client to die.

Restarting the network interface has no effect.

“Repairing” the network connection has no effect.

The only way to get DNS to Just Work™ again is to reboot the machine…. so it seems.

However, I found that – even though I had my ethernet interface disabled – Internet Connection Sharing (ICS) was still causing the interruption there. So here’s what I did:

Go to Start -> Control Panel [-> Classic View] -> Network and Sharing Center -> Manage Network Connections.

Right-click on any interfaces listed as being “Shared” (even if they’re disabled) and click Properties.

Click on the “Sharing” tab if it’s available. (If not, move on to the next interface in your list and repeat the steps above. If this was your only interface, stop reading…. this won’t work for you, sorry.)

Uncheck the boxes on that panel and click OK.

If you enabled the interface above, don’t forget to disable it again (if you want).

Voila! It’s a hotfix, so if your system was acting up due to a problem with ICS as well, then you don’t have to restart or anything, your DNS lookups will go back to their Just Works™ status. If it’s not immediately back to working, make sure you didn’t disable the interface you were using to access the Internet.

“Logon Process Has Failed To Create The Security Options Dialog” Error

Despite my preference for non-Windows operating systems, I do keep some Windows versions and at least one Windows machine in my arsenal. Here in my home office I have a desktop running Mandriva (I’ll get into that at another time) with a laptop next to it running Vista. I know, I know…. “bad Dan.” Save it. I already know.

Anyway, in the last week or ten days, Vista locked up on me. It would slug itself along as if a process was using up 100% of the available CPU and memory. It’s not a top-shelf machine, it’s just a Dell Inspiron 6400 w/ Core2Duo CPU and 2GB RAM – my wife, Debs, and I have similar systems.

Vista would hang, nearly unresponsive, and 15 minutes or so after I hit CTRL+ALT+DEL (nearly immediately, due to my severe lack of patience with personal computers), I finally had a response, though still no task manager. Less helpful than most BSOD‘s, the dialog stated simply:

Logon process has failed to create the security options dialog
Failure – Security options

Neat.

After poking around the Windows internals as best I could, while still being a good boy and not violating any possible terms of my license (yes, it’s a Genuine copy), I confirmed my suspicions: Vista still sucks.

However, after working around a few things, it was actually Microsoft’s “Safe” Mode (sic) bootup that helped me out. By trimming down the processes, I was able to debug the issue and narrowed-down the culprit: AcroRd32Info.exe. In fact, the whole Adobe Acrobat Reader installation was crapped-up. It turned out, every time I would load a multilayer PDF, it was causing a serious buffer overflow issue that was spiking CPU usage as high as 100%, memory usage to 99.6% of available RAM (spilling over into virtual memory) and maintain those levels until I hard-booted the machine. All total, between the three screwups, I lost about 3.5 full weeks of research for an AI neural network application I’ve been building, but nothing permanent. It’ll be like a drunken bender to the brain. It will survive.

Anyway, the lock-ups were primarily my fault, as should be expected. I was using an outdated version; I was using 8.1, whereas 9.x is the current version as of this writing. I installed the latest version and tried to reproduce the overflows — nothing. Keeping my fingers crossed, I think I can mark this as solved.