Friday, July 16, 2010

What Was That?!?

OK, so this isn't really a howto, but I wanted to write something about it while it's still fresh in my mind...

Back in the summer of 1993, there was a rash of small earthquakes (less than magnitude 3) that hit the Columbia, MD area.  I was a senior at the University of Maryland at the time, and working as a co-op for a business with an office near the interchange of US 29 and MD route 32.  Sitting at my desk one afternoon, our office building lurched with a thump -- we thought the building had been hit by a car.  We found out a few minutes later that we had experienced a small earthquake.

That had been my only experience with earthquakes until this morning.  I woke shortly before 5am this morning and was just resting still in bed, trying not to wake my wife.  As I lay there thinking about the day to come, I heard a long, low rumble outside.  It didn't sound like a truck, but reminded me of an experience I had in England a few years back.  There I was resting in my room at an inn about 40 miles outside of London one evening as a thunderstorm approached from the south.  Because of the inn's perch on a south-facing hillside, the sound of thunder from the coming storm rolled long and low, much like the sound I heard this morning.

The rolling "thunder" continued for more than five seconds.  As I lay in bed recalling my experience in England, and wondering why no weather report from the night before had mentioned the possibility of thunderstorms, the house shook violently for a second or two.  And this was an unusual shake -- the house was rattled to the foundation.  This was no thunderstorm!  Did a car hit the house?  No, it couldn't be that.  There was no breaking of glass or splintering of wood.  Was it a terrorist attack?  Did someone just detonate a large bomb over DC?  Probably not.  There was no flash, and the event was not concussive, as would be expected with a large blast.  Before the "thunder" had rolled away -- another ten seconds or so after the house settled down -- I was left to assume we'd just experienced an earthquake.  I looked at the alarm clock.  It showed 5:04am.  "Did you feel that?  I think we just had an earthquake," I said to my wife.  The rumble and shaking had jolted her awake as well.  I got out of bed and peered out the window just to make sure there wasn't a large car or truck sticking out of the side of our house.

Back in bed, and still leaning towards the event being an earthquake, I tuned my radio to WTOP.  I was relieved to hear that WTOP was still broadcasting.  It wasn't a large bomb.  Within a couple of minutes, WTOP was reporting calls to their studio from Gaithersburg to Falls Church asking about an explosion or other event that caused the earth to shake.  "Wow, that's 20, 25 miles," I said to my wife, "There were several earthquakes in Columbia back in 1993, but none were felt that far apart."  Reports from the USGS began flowing in before 5:30.  The initial report was a magnitude 3.7 quake centered near Gaithersburg, MD.  Before 6am, the initial report had been revised to a 3.6 quake centered slightly farther north in Germantown.  Reports were rolling in from Harpers Ferry to Delaware about the earth shaking.  Remarkable!

I've travelled a bunch of times to the Silicon Valley area.  I've been to Mexico City a few times, and I've even spent some time along the Pacific "Ring of Fire".  For all those trips, I've never experienced an earthquake outside of the metro DC area.  And after today, that's just fine with me.  Today's event was a small quake by any measure, but it was disconcerting enough that I don't think I need to experience anything larger.  Still, it was a unique event -- the largest recorded quake in DC history.  So we'll talk about it, write about it, and someday tell our children and grandchildren how we survived the Great Washington DC Quake of 2010!

-- Terp

Wednesday, February 17, 2010

Remote Desktop in Ubuntu with VNC and XDMCP

There are lots of links on the Internet that lay out how to set up VNC and XDMCP to enable remote logins for Ubuntu, but most are broken as of 9.04 (Jaunty) and later releases. The issue seems to be the interaction between GDM and the IPv6 stack. In releases before Jaunty, IPv6 support was included as a kernel module. As of Jaunty, support for IPv6 is compiled into the kernel. The good news is that if you don't need IPv6 support today, you can still turn it off and enjoy a remote desktop capability. Hopefully someone will fix GDM before IPv6 really becomes a necessity.

The full procedure for setting up Ubuntu for remote desktop is as follows...

1. Download and install vnc4server and xinetd:

greg@neo:~$ sudo apt-get install vnc4server xinetd

2. Create an entry in /etc/xinetd.d to enable Xvnc:

greg@neo:~$ sudo vi /etc/xinetd.d/Xvnc

Paste the following text to the file:

service Xvnc
{
    type = UNLISTED
    disable = no
    socket_type = stream
    protocol = tcp
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -once -query 127.0.0.1 -SecurityTypes=none -geometry 1280x800 -depth 24 -extension XFIXES
    port = 5901
}


Note that everything from "server_args =" to "XFIXES" must be on a single line. Also, adjust the -geometry and -depth settings to suit your needs. Settings of "-geometry 1024x768 -depth 16" are probably plenty good for most.

3. Now enable remote logins via XDMCP. From the GNOME desktop, choose System --> Administration --> Login Window. When the preference pane opens, select the Remote Login tab and set Style: to "Same as local".

4. Before closing the Login Window preference pane, click on the Configure XDMCP... button in the bottom right corner. This will open another preference window. In the XDMCP preference window, make sure the "Honor indirect requests" option is unchecked.

5. Close out the XDMCP and Login Window preferences, and move back to the terminal window. Now edit /etc/gdm/gdm.conf-custom and add the following statements:

Under [daemon] add the statement RemoteGreeter=/usr/lib/gdm/gdmgreeter
Under [security] add the statement AllowRemoteRoot=false
Under [xdmcp] add the statements Enable=true and HonorIndirect=false

Some of these may already exist. If they do, and they are correct, then just add any statements that are missing.

6. Now it's time to turn off IPv6 support. I have seen many Google hits on how to do this, and most of them do not work in Jaunty or Karmic. The only one I have found to work is to disable IPv6 support from GRUB. Open up the GRUB menu:

greg@neo:~$ sudo vi /boot/grub/menu.lst

and find the kernel options. You should see one or more entries that start with "title" and include a "kernel" entry a couple of lines down. The kernel entry is typically pretty long -- more than an 80 character screen wide. Add the statement ipv6.disable=1 to the end of the kernel line (or lines, to be safe) and save the changes.

[Edit:  Note that "old" kernels won't understand the ipv6.disable=1 directive and will complain about an unknown option when booting.  Be sure to update your kernel through apt or synaptic to ensure this will work.]

[Edit #2:  Going straight to the config lines at the end of the file may not be the best way to go, as these lines can be overwritten by update-grub.  A better solution is to find the "default kernel options" section and add it there.  Look for the line # kopt=root=UUID=xxxx and just append ipv6.disable=1 to the end of it.  And don't worry that the line appears to be commented out.  Your change will be picked up when you run the command update-grub from the command line.]

7. Reboot the box. When it's back up and running, you can try to connect from a VNC client.