Friday, May 30, 2008

"could not stat the resume device file"

We have a local mirror of the Ubuntu repos here at work and they are pretty fast. I couldn't figure out how to get update-manager to use them, so I upgraded my desktop machine to Hardy Heron by changing everything in /etc/apt/sources.list from gutsy to hardy and typed sudo aptitude update && sudo aptitude full-upgrade and let it run. It asked a couple questions about modified config files and such which I answered, and then it was done. I rebooted and it put up the pretty "UBUNTU" with the new pulsating KITT-esque progress bar...and it never went beyond that. I finally hit alt-f1 and saw that it was waiting for my input with the prompt:

resume: could not stat resume device file /dev/sda10. Please type in the name to try again or press ENTER to boot the system

I hit enter and it seemed to boot just fine. This is a pretty annoying thing to have to do every time you boot, so I searched until I found the solution for me: reinstall initramfs-tools, like so:

sudo aptitude reinstall initramfs-tools

Like Lauri Kainulainen wrote in that launchpad bug report, I've never used hibernate on this machine, so this is pretty puzzling. However, I'm continually impressed that I can find help for these obscure problems so quickly. It pays to use a popular distribution and to not be the first to try out new things with it.

Sunday, May 25, 2008

KVM in Ubuntu Hardy Heron

Apparently there are some new gui apps for running and interacting with KVM on Ubuntu 8.04. After reading those two blog entries, I fired up virt-manager and virt-install, and wasn't very impressed. I didn't like the idea of piping the graphics through VNC when all I want is to run a virtual machine on my local desktop. And why do you need a confusing GUI when the command-line utilities for kvm/qemu are so straightforward?

Now that I've said that, I'll point you at this overly complex KVM guide just so you can follow the first part to check if your CPU supports hardware virtualization. I would pretty much ignore the rest of that guide. Oh, and if your CPU doesn't support hardware virtualization, you can pretty much replace kvm with qemu in all the below steps and this will still work, just slower.

Allright, here's how I set up a new KVM instance on my Ubuntu Hardy Heron box. I installed Hardy on the virtual machine in this example, but you could just as easily do windoze or about any other OS of your choosing.

  1. Install kvm if you don't have it already:
    sudo aptitude install kvm
  2. create your disk image:
    qemu-img create -f qcow2 ubuntu.qcow2 100G
  3. Specify the Ubuntu install CD image as your cdrom drive and tell kvm to boot from that with -boot d, with ubuntu.qcow2 as your hard drive (also enable sound hardware and use -localtime, though I think localtime is only needed for windoze to get the time right):
    kvm -soundhw all -cdrom ~/downloads/ubuntu-8.04-desktop-i386.iso -localtime -m 512 -hda ubuntu.qcow2 -boot d
    All of these command-line options are explained in the qemu man-page.
  4. Now just run through the install as normal.
  5. When that's done, boot up your new system like so:
    kvm -soundhw all -cdrom /dev/cdrom -localtime -m 512 -hda ubuntu.qcow2

There you have it. I highly suggest putting that last command in a file and making it executable so you can just run it as a script.

Saturday, May 24, 2008

Windoze Activate After Hardy (and KVM) Upgrade

This is kind of funny. At least I thought so. I fired up my windoze kvm instance for the first time since upgrading to Hardy Heron, and I got a pop-up dialog from XP telling me that hardware has changed significantly (click to see the full-sized image):


Tuesday, May 20, 2008

Hardy Upgrade Broke Apache Logging

I noticed today that my upgrade to Hardy broke my Apache logs for my little family website that I'm hosting. It turns out that I had a LogFormat definition in apache2.conf called comonvhost. All my sites in sites-available used this with a line like this:

CustomLog /var/log/apache2/access.log comonvhost

Well, in the upgrade, the commonvhost LogFormat was removed from my apache2.conf and replaced with three other LogFormats named, "combined," "common," and "referer (sic)." My log file became filled with lines that simply said, "commonvhost."

Here I'd like pause and say that having /etc under revision control made this very easy to debug. All I had to do was run git diff -r <some commit before the upgrade> on the various files in /etc/apache2 and it became obvious very quick what had happened. I'm so glad I set that up.

Anyway, after changing my sites-available files to all use the new combined LogFormat instead of commonvhost, my access.log started looking like it should again. Phew!

Monday, May 19, 2008

Subversion Question

I have a question about Subversion that I can't quite coax Google into answering. Is there any problem with copying an existing working copy and using that instead of running svn checkout to create a new working copy?

You might want to do this if checkouts from your Subversion repository are very slow, see. I tried it out and it seems to work, but I wonder if there are any hidden pitfalls to this method. If you have any ideas please comment.

Wednesday, May 14, 2008

Upgrade to Hardy, Many Sound Woes

WARNING I needed a place to take notes while debugging sound issues after upgrading my desktop from Gutsy to Hardy, so here they are. This is probably a pretty boring read, so continue at your own risk.

Upgraded to Hardy today. Got some indistinct error message at the end, so I made sure and ran aptitude update && aptitude -y full-upgrade && dpkg --configure -a a few times before and after rebooting. Then, when I fired up Firefox (fired up... Firefox... get it...?) and went to youtube I realized I didn't have flash anymore. I aptitude installed flashplugin-nonfree, restarted Firefox, and videos worked. Yay!

Then I went away for a while. When I came back youtube videos had no sound. This is actually a problem that I was having before the upgrade. Not even a reboot helped. I fired up Amarok to see if mp3s still played. Nope, it froze. I googled a bit and found some pulse audio help which led me to believe that maybe I needed to add myself to the pulse audio groups. I did so, tried Amarok again, and the whole system froze. No magic keys or anything could save me. I hit the reset button on my case, and when it came back up, still no youtube sound. I started Amarok and it took forever to start, and then I made sure it was configured to use pulseaudio for its output plugin (I'm using the xine engine), and it didn't freeze, but it didn't play music either. Frustrating. First I had sound problems with Gutsy, and now seemingly worse problems with Hardy. Ubuntu, you've been so good to me in the past. What gives?

Pressing on, I tried changing the output plugin for Amarok and the whole app froze again. I tried watching video with totem, no sound. It froze after a bit too and I had to kill it. This is getting quite scary.

Reading some more here and here I discover this thing called libflashsupport. Aptitude tells me it's not installed and the description reads:

Due to various bugs in the Flash 9 plugin sound output of Flash 9 through the pulseaudio soundserver doesn't work properly. This library adds a clutch to make Flash 9 sound output in pulseaudio possible.

After installing this I shut off my computer completely (I'm in full belt-and-suspenders paranoia mode now), waited a few seconds and then turned it back on.

Taking a more conservative route this time, I started Totem first. No KDE or flash weirdness there. It worked, sound and video played without any problems. Next I tried Amarok with the xine engine output plugin set to autodetect. It worked, no hang. Next, youtube. No sound. Totem and Amarok still worked even after trying flash. I don't know if this result is any different from before, unfortunately. Maybe everything works better as long as you don't do flash first. I don't know.

I'm not sure what to try next. Apparently there might be a newer version of libflashsupport that I could try. This advice is not well explained, but it might be worth a try as well. Overall, I'm getting the impression that this is more the fault of flash than anyone else. Cursed closed-source crap!

I decided to try compiling libflashsupport from source as suggested on the pulse audio wiki. I aptitude removed libflashsupport first. After compiling and installing and restarting firefox there was still no youtube sound. Amarok and Totem were still good though. I rebooted. Still no youtube sound.

And then I saw it. There is a volume control on the little video controls under the youtube video. And it was turned all the way down. Oh. my. gosh. Sure enough, when I turned it up, sound played. How long has that been the problem!?!?!?

I decided to undo what I'd done a bit. I uninstalled libflashsupport as compiled from source and re-installed the ubuntu package. After restarting Firefox youtube and totem both worked, at the same time even. I think I'll leave things like that for now. Don't you love Linux? I do. I really do.

Tuesday, May 6, 2008

Better gnome-terminal Colors

If you use gnome-terminal with a dark background, the default colors that you get when you type, say, ls --color are hard on the eyes, especially the dark blue. To fix it, right-click, edit current profile, click on the colors tab, and under Palette choose XTerm from the Built-in schemes. Much much better.