Saturday, December 15, 2012

Upgrade to Ubuntu 12.04 from 10.04

Although my experience upgrading from Ubuntu 10.04 to 12.04 on my hp workstation xw4100 was not necessarily one of personal preference, I have to say I am glad I was forced to make the upgrade now that the nightmare is finally over. The new release of Ubuntu, in the Classic Gnome mode is very similar to the GUI setup I had in Lucid (still runs metacity for the window manager and gnome for the desktop manager). Since I am not a big fan of Unity's interface, I am quite relieved to see the classic Gnome setup is still available as an option. Here's how my desktop looks now:




The nightmare started when the window manager I was using (metacity) abruptly stopped working. I rebooted and then found that the display manager (gnome) also was not functioning properly. Every time I booted up, I was just greeted by the default Lucid background. Although I could move my mouse, the login screen was nowhere to be found.

After spending many hours trying to resolve the window manager/desktop manager issue to no avail, I decided to upgrade to the newest release Ubuntu in hopes that it would magically solve my problems. I was able to get my  rt2500 usb wireless adapter under protected access (wpa2) working in the virtual terminal (ctrl+alt+f2-6), by running these commands

wpa_passphrase [network name] > wpa.conf
(enter passphrase and press enter)

sudo stop network-manager  # won't work unless ubuntu's network manager is stopped

sudo wpa_supplicant -Dwext -iwlan0 -c(path to wpa.conf) # had to kill the process with ctrl-z but did so after I saw an output to the effect that authentication had been successful)

sudo dhclient wlan0 # this gets a new ip address and finalized the connection

To test my connection I would try using "ping www.google.com" to see if I got back anything.

(src: http://blog.roberthallam.org/2010/05/connect-to-a-wpawpa2-secured-network-in-linux/)



I then tried the command "do-release-upgrade". This calls a python script which initiates the upgrade to 12.04. I ran into the exact same issue as described here: http://ubuntuforums.org/showthread.php?t=1767358. I had multiple versions of python installed. I simply moved the GnuPGInterface module from the version that had it installed to the version that the script was using. The script now worked fine.

It turned out I wasn't out of the woods yet, not nearly. About half-way through my upgrade, my internet connection went down. When this happens the entire script must fail before I can start back where it was on the download. With my RT2500 usb adapter I have always had issues with it frequently losing its connection inexplicably. I miss the days when I could have a wired connection but sadly those days are, for the time being, no more. To reconnect, after waiting for the script to fail, I simply repeated the wpa_supplicant and dhclient commands as before and then retried the upgrade python script. After repeating this exercise several times (*sigh*), my system finally booted up with 12.04, and alas I could finally log in again!

I slept well that night and my time spent at my day job went by quickly. I was confident that the nightmare was over. When I got home from work and tried using the internet I was greeted by a slow connection speed reminiscent of the old days when I used a dial-up modem. A page such as facebook would take up to several minutes to load and a typical download speed would range from 50 kb/sec to 100 kb/sec. As per the usually I would frequently have to unplug and replug in my wireless adapter to maintain this horrible connection.

After losing another day to this issue, and almost losing hope, I inadvertently stumbled upon my solution here: http://askubuntu.com/questions/131768/dlink-wireless-dwa-140-speeds-are-crippled-on-12-04. It turned out that the wireless power management on my system was crippling my internet speeds. It may also have been the primary cause of my dropped connections though that remains to be seen. Thus after entering the command "sudo iwconfig wlan0 power off", my internet speeds were better than ever and I have also yet to see a dropped connection. Although a lot of forums seemed to recommend editing your connection to ignore ipv6, I didn't see any improvement through this.

To anyone who updated Ubuntu and has a slow wireless connection I would recommend to try

sudo iwconfig wlan0 power off

Here is a technical article I found that discusses some of the basics as to why power management can be so detrimental to wireless performance: http://www.techrepublic.com/blog/networking/wi-fi-power-management-road-warriors-beware/533.

This solved my wireless problems. So far I'm enjoying the 12.04 Precise release of Ubuntu and find that it has indeed made many subtle improvements over Lucid. Two examples I can think of off the top of my head are that, firstly, adding icons to the top panel is much more user friendly. While you can control the position of the icons, their distance apart as set automatically. I recall wasting time trying to move my icons closer together in Lucid, which I no longer have to do. Secondly the GUI to the software update center looks excellent and has me very excited to look into the new software that is available. Here is a screen cap:



 Anyways, I hope this saves some time for another poor soul out there on the www that may have to deal with some of these upgrade woes. Hopefully time will prove that the upgrade was worth the trouble. Some may ask why I go through all of this when I could just run Windows and be done. Being a proud Linux user, it's hard to give a short answer to this question. It is hard not to see the value in free software. I am thankful for the many fellow Linux users who would agree with me. Putting aside the whole "richard stallman"-esque argument of how we must fight the evil corporations who are trying to take over the world, it is extremely important for me, as a hopefully soon-to-be-successful software developer to have the utmost control over my own computing. I want to understand how the software I use runs as much as possible. My hope is that with each day I will get closer and closer to that ideal. Using Ubuntu, the most supported linux OS, is the least I can do toward that end. And as a computer hobbyist, a project I am planning to start on soon is to build my own customized OS.




Thursday, November 24, 2011

HP Workstation xw4100 Ubuntu Screen Resolution on Acer V173 Monitor

For the past several months I've been stuck with 1024x768 resolution on my monitor when using linux. To make matters worse, every time I tried to enable the proprietary Nvidia graphics driver, my maximum resolution would go down to 800x600. Talk about useless! At the resolution I literally can't do anything. So as I saw it at the time, the only options I have were to either buy a new computer and hope for the best, or go back to not using the graphics card and get used to the shitty 1024x768 resolution. Well I decided neither of those options work as
1. Buying a new computer would probably be a waste of money if I can figure this out myself
2. I've been stuck with this crappy resolution for too long, and besides I can't even play n64 roms without my graphics card. Now thats just depressing!
So I decided to invest however long it takes to figure out what was happening.

I went to System->administration->proprietary drivers and enabled the nvidia graphics driver. After resetting my computer I was stuck at the 800x600 resolution. When I looked into the resolution options for the driver I had the choice of either 800x600 or 640x480. Well thats just great...

So I went and checked my /etc/x11/xorg.conf file to see how things are configured. Turns out that it was pretty much a skeleton. It had a screen and monitor section as I recall but didn't specify the type of monitor, horizontal sync and vertical refresh rate, modelines, resolutions, etc. When I checked the /var/log/xorg.0.log I saw that the Extended Display Identification Data (EDID) was not found. This makes sense seeing that my xorg.conf file was pretty much empty. So I decided to research into the specs of my monitor to see if I could set these things manually. I found that the maximum resolution for my monitor is 1280x1024. Not bad! Now to see what it takes to get that resolution. I found the maximum horizontal sync and vertical refresh rates from the manual for the monitor.

The next step was to try using xrandr to change the resolution. When I run xrandr I got that the only option is 800x600. I obviously want to create a mode for 1280x1024 so I typed:

cvt 1280 1024

and got the resulting modeline output for my screen. So I then added the new mode using:

xrandr --newmode <pasted output of cvt command here>

When I checked my output of xrandr it told me the output was named "default". So the next step is to add the mode to the "default" output:

xrandr --addmode <name of output> <name of mode>

Now to set the output resolution:

xrandr --output <output name> --mode<mode name>

Unfortunately this wouldn't work because it said my screen resolution was capped to 800x600. Crap!!

So I now tried something insanely basic: run the command to configure nvidia. I typed:

nvidia-xconfig

Lo and behold, this changed my xorg.conf file to have a bunch of useful information. I pasted in the modeline I got earlier and changed the hsync and vertical refresh to the maximum for my monitor. I reset my computer and its in the maximum resolution and looks great! So all in all I found that sometimes the solution to a problem can indeed be much simpler than expected.