My ongoing experiences with Ubuntu, and later Mythbuntu, as a media center with MythTV. I'm also using the system for a virtual machine server, a mediawiki server and a general all around home infrastructure base.

Friday, January 9, 2009

Installing a Tomato Router

This post is off the topic of Ubuntu and on the topic of networking that supports my Ubuntu systems, but I figure that's fair game (hey, it's my blog).

I have gotten really frustrated with the reliability of my existing wireless access points (a Airport express and a Linksys WAP54G). Both would fail regularly, requiring a power cycle to make them functional again.

So, as a big open source advocate, I thought I'd give Tomato a try. I followed these directions at Lifehacker. For a router I ordered a Linksys-Cisco WRT54GL (chosen from the list of Tomato-supported devices).

At this point, let me jump ahead here and give you a heads up. I was not able to use Firefox from my Ubuntu box to upgrade the firmware (or do much of anything) on the WRT54GL. Anytime I tried to apply a change on any of its web pages, I got a "Connection Interrupted" error. I turned to google and found other people who had encountered this problem. Like them I had to use Konqueror to do the firmware installation. Konqueror was installed on my Ubuntu system easily enough:

# apt-get install konqueror

The other thing to do before you start is make sure you know all the configuration details of your current router as you might need them to configure the new router. In my case, my ISP (Comcast) required the WAN port have a specific MAC address. I suggest you just print the administration screens for reference.

I downloaded the latest version of the Tomato Firmware (Version 1_23.7). I followed these directions to install 7Zip to unpack this archive (it looks like there is now also a .zip version if you want to skip this step):

# apt-get install p7zip-full

And then I unpacked the archive:

% 7z e Tomato_1_23.7z
7-Zip 4.58 beta Copyright (c) 1999-2008 Igor Pavlov 2008-05-05
p7zip Version 4.58 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,1 CPU)

Processing archive: Tomato_1_23.7z

Extracting whr_install.bat
Extracting WR850G.bin
Extracting WRT54GS.bin
Extracting WRT54GSv4.bin
Extracting WRT54G_WRT54GL.bin
Extracting WRTSL54GS.bin
Extracting readme.htm
Extracting tomato.trx

Everything is Ok

Files: 8
Size: 16854823
Compressed: 2844464

Now I was ready to upgrade the router to the Tomato firmware. Before I started I plugged my laptop into wired network and disabled wireless (right-click on network applet and de-selected "Enable wireless").

Then I disconnected my old NAT router and put the WRT54GL in it's place. Your network will go away at this point but you should still be able to connect to the router by entering http://192.168.1.1 into your browser.

Even though my router was fresh out of the box, I went ahead and reset it to make sure. I fired up Konqueror (Firefox won't work for this...) and connected to the router at http://192.168.1.1 (by default the username is blank and the password is "admin").

Then under "Administration"/"Factory Default" I selected "Yes" and "Apply" to reset all the settings. Then I did a hard reset by holding the reset button on the back of the router for 30 seconds.

Ok, now I was ready to upgrade. I connected back to the router and selected "Administration"/"Firmware Update". I selected the file "WRT54G_WRT54GL.bin" from the upacked Tomato archive (see readme.htm from the Tomato archive if you have a different router) and started the upgrade. It took about two minutes to complete.

Now I logged into my brand new Tomato router. I pointed my web browser (you can change back to Firefox now) at http://192.168.1.1 and logged in using the username "admin" and password "admin" and I was in.

First things I did were the following:
  • Under "Administration" I set a new password (and I do strongly suggest you do this first).
  • I wasn't getting an IP address on the WAN side. I had to set my WAN MAC address to what my old router had been. I did that under "Advanced"/"MAC Address" by setting the value of "WAN Port". After applying that, I now had Internet connectivity on my wired connection.
  • Now, under "Basic"/"Network" I set the wireless SSID and Security (WPA2 Personal and shared key, aka password). After that was applied I disconnected my laptop's wired connection and was able to connect to the Internet through my wireless. Success!

The only other thing I did was under "Basic"/"Network" I set the Static DNS servers to those of OpenDNS.

I'll report back after a while on how the new router is doing.

Friday, January 2, 2009

My Mythbuntu box hung and host clock rate change requests again...

I went to remotely log into my mythbuntu box today and found it was hung....

A quick power cycle and it came back up, now to poke around the log and figure out why...

Last message in kern.log and syslog wasn't very useful:
Dec 31 13:14:54 casey kernel: [2612801.476210] [3224]: host clock rate change request 36 -> 26

Hmmm, besides the fact my log files are filled with host clock rate change requests, which I've seen before, no clue as to why the system was hung.

Anyway, to fix the host clock rate change message, I checked /etc/vmware/config and yep, "host.useFastClock = FALSE" was missing. So I re-added it and restarted vmware ('/etc/init.d/vmware restart').

I still have no idea what caused the box to hang though.

Saturday, December 13, 2008

USB devices not appearing in VMs

Hmmm, I went to use a USB device in my Win XP win and it wasn't showing up (Under VM/Removable Devices/USB Devices). This sure seems familiar but I can't find a blog post about it. A quick google turned up this hint which I really remember doing before. In fact I have a /etc/init.d/mountdevsubfs.sh.dpkg.old file with the changes applied, so I know I did.

However when I re-applied those changes I got an error running the script (see end of post).

Poking around a little more I found this advice which seemed cleaner, except it was a little flawed, when I tried adding the line as given to /etc/fstab, it didn't help and I noticed that if I actually tried to invoke the line, I got the following error:

# mount /proc/bus/usb
[mntent]: line 10 in /etc/fstab is bad

The "usbfs" on the begining seemed wrong to me, so I dropped that, resulting in the following line:

/dev/bus/usb /proc/bus/usb usbfs auto 0 0

Then I restarted VMWare ("/etc/init.d/vmware restart") and my USB devices appeared!


Changes I made to /etc/init.d/mountdevsubfs.sh:

# diff -c mountdevsubfs.sh.orig mountdevsubfs.sh
*** mountdevsubfs.sh.orig 2008-12-13 08:19:38.000000000 -0600
--- mountdevsubfs.sh 2008-12-13 08:20:25.000000000 -0600
***************
*** 39,44 ****
--- 39,51 ----
   # Mount /dev/pts. Master ptmx node is already created by udev.
   #
          domount devpts "" /dev/pts devpts -onoexec,nosuid,gid=$TTYGRP,mode=$TTYMODE
+  #
+  # Magic to make /proc/bus/usb work so USB devices appear in VMWare
+  #
+  mkdir -p /dev/bus/usb/.usbfs
+  domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
+  ln -s .usbfs/devices /dev/bus/usb/devices
+  mount --rbind /dev/bus/usb /proc/bus/usb
  }
  
  case "$1" in

Error from I got from those changes:
# /etc/init.d/mountdevsubfs.sh start
Usage: mount -V                 : print version
       mount -h                 : print this help
       mount                    : list mounted filesystems
       mount -l                 : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
       mount -a [-t|-O] ...     : mount all stuff from /etc/fstab
       mount device             : mount device at the known place
       mount directory          : mount known device here
       mount -t type dev dir    : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
       mount --bind olddir newdir
or move a subtree:
       mount --move olddir newdir
One can change the type of mount containing the directory dir:
       mount --make-shared dir
       mount --make-slave dir
       mount --make-private dir
       mount --make-unbindable dir
One can change the type of all the mounts in a mount subtree
containing the directory dir:
       mount --make-rshared dir
       mount --make-rslave dir
       mount --make-rprivate dir
       mount --make-runbindable dir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using  -L label  or by uuid, using  -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say  man 8 mount .
ln: creating symbolic link `/dev/bus/usb/devices': File exists