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.

Sunday, March 31, 2013

[Not] Solving "The system is running in low graphic mode" on boot...

Followed the directions at http://askubuntu.com/questions/141606/how-to-fix-the-system-is-running-in-low-graphics-mode-error:

  1. Used Control-Alt-F1 to get an alternate terminal and log in.
  2. sudo apt-get install --reinstall ubuntu-desktop
  3. sudo reboot
Update: Well, this didn't work. Next time I booted, I had the same problem...

Thursday, April 5, 2012

Ubuntu 11.10 install: Hanging at "Checking Battery Status"

I started by doing an upgrade of my 10.04 system to 11.10, but ran into the dreaded hang on boot at "Checking for battery Status".

Turns out this has nothing to do with a battery (mine is a desktop system), this is just where boot hangs if you have video driver problems.

After trying many, many, many, many, many, many, things, including a fresh install, here's what finally got it working for me...

It was the combination of this post:


sudo apt-get update && sudo apt-get upgrade
sudo apt-get install --reinstall gdm xorg

And this post:

sudo apt-get update 
sudo apt-get remove nvidia-* 
sudo apt-get install linux-headers-'uname -r' 
sudo apt-get install nvidia-current   
sudo nvidia-xconfig
sudo apt-get update
echo options nouveau modeset=0 | sudo tee --append /etc/modprobe.d/nouveau-kms.conf
echo RUN+="/sbin/modprobe nvidia" | sudo tee --append /etc/udev/rules.d/90-modprobe.rules
sudo update-initramfs -u
sudo reboot

What I actually ended up doing was the gdm and xorg reinstall from the first post, then the second post and then the first post again.

I suspect I could have just done second post followed by first post, but haven't done a clear re-install to try it.

Wednesday, December 15, 2010

USB drives not automounting

I noticed that after upgrading my laptop to Ubuntu 10.10, USB drives weren't automounting.

My first clue was in this comment, I didn't have the usb_storage kernel module loaded:

# lsmod | grep usb
usbhid                 36882  0 
hid                    67742  1 usbhid

So I loaded the usb_storage module:

# modprobe usb_storage
WARNING: All config files need .conf: /etc/modprobe.d/ndiswrapper, it will be ignored in a future release.
# lsmod | grep usb
usb_storage            40172  1 
usbhid                 36882  0 
hid                    67742  1 usbhid

And at this point USB drives mounted just fine. To make it permanent, I followed the directions in this post, added "usb_storage" to /etc/modules and rebooted. USB automounting working fine now.

Friday, October 22, 2010

Upgrading laptop from 9.10 to 10.04 to 10.10

  1. Installed all Updates
  2. Clicked 'Upgrade' in the Update Manager to update to 10.04.1 LTS
    1. Some Third party sources disabled.
    2. ~1.7GB download
    3. Couple hours and a number of dialog boxes later upgrade was done.
  3. First boot after upgrade I get an error message: "An error occurred while mounting /proc/bus/usb". Solution found in the forums.
  4. Ran Update Manager again, system was up-to-date, installed 6 updates.
  5. Still didn't show upgrade to 10.10. Had to click on Settings and then under Release upgrade, select Normal Releases. Clicked Close and then Check again. Now Upgrade button was available.
  6. Clicked 'Upgrade' to upgrade to 10.10
    1. Another ~1.7 GB of download.
    2. Few hours later and a reboot and I'm at 10.10

Tuesday, June 22, 2010

Installing Mythbuntu 10.04 from scratch (part one).








As I mentioned in my previous post, I decided to install Mythbuntu to use with my Hauppauge WinTV HVR-1600 (model 01199) tuner card. I started by installing Mythbuntu 10.04 from the CD and I followed the Happauge HVR-1600 directions from the MythTV website. Note that I am only configuring the ATSC digital over-the-air tuner and not the analog tuner.


First I went through the standard install screens (language, time zone, keyboard layout, etc.). For partitioning, I used a 80GB partition for the root partition, created a 19GB swap partition and a 50GB /home partition.


For installation type, I chose "Primary Backend w/Frontend."


For services I left the defaults: SSH and Samba.


I enabled a Remote Control and chose "Haupauge TV-Card" as I didn't see HVR-1600 and that seemed most logical. I left "Enable Dynamic Button Mappings" checked and "Generate Frontend Restart Mapping" unchecked.


For Graphics Driver I chose "NVDIA Graphics" since I have an NVIDIA card and have been through this before. I left TV-Out disabled.


After about 10 minutes of installation, a screen came up to configure the Backend and I launched MythT Setup:

  • Under "General" I changed nothing.
  • Under "Capture Cards" I created a new capture card of type "DVB DTV capture card (v3.x)". Under Recording options I set the max recordings to 1. (This all per the MythTV web page at the start of this post.)
  • Under "Video Sources" I added a new video source of type "Transmitted guide only (EIT)". Don't forget to give it a name or it will be a blank line on the video sources list which will confuse you into thinking it wasn't added.
  • Under "Input Connections" I selected the DVB capture device and set the video source to the video source I just just added in the previous step. Then I selected "Scan for Channels" which found roughly a dozen ATSC channels I inserted, plus two MPEG channels I inserted.
  • Under the "Channel Editor" I saw what looked like a reasonable list of over-the-air channels for my area. I didn't do anything under this option.
When I exited MythTV Setup I was prompted to run mythfilldatabase, which I did. It didn't have any apparent effect.



That completed installation, CD ejected and system rebooted.


Hmmm, as the system went down for the reboot I got a bunch of "end_request: I/O error, dev sr0, sector " errors and the system hung. So I power cycled it.

When the system came up I got a dialog box about Ubuntu running in low-graphics mode with a "Failed to initialize NVIDIA graphics device" error. 



I selected "Reconfigure graphics" and then "Create new configuration for the hardware". That seemed to generate a new configuration and I restarted X. MythTV came up fine.

I tried watching TV at this point and tuning seemed to be working, but I didn't appear to be getting audio...

Before I tackled the audio problem, I decided to do some basic system administration. I exited MythTV and fired up a terminal (under Applications/Accessories).

From there I did a update of the system (took about 10 minutes) followed by a reboot:

sudo apt-get update
sudo apt-get dist-upgrade
sudo reboot

When the system came up I got the same "running in low-graphics mode" dialog box. I did the same "Reconfigure graphics" and restart of X as last time. Another problem on the stack...

I checked and tuning still working fine (and still no audio).

My next step was to configure the system with a static IP address. I followed the same directions I have before, but when I ran "/etc/init.d/networking restart" I got a "SIOCDELRT: No such process" error. Wow, this was becoming a painful install.

Ah, I found these directions and doing a "ifup eth0" did indeed restart the interface with a static IP address. I then rebooted the system to make sure the configuration persisted and it did.

OK, now I could install my SSH public key and, ahhh, easy access from my laptop. Much better.

Looking into low-graphics mode problem... I noticed I had no /etc/X11/xorg.conf file, but I did have a /xorg.conf.new, so I copied it to /etc/X11/xorg.conf and rebooted. Now the system didn't complain about being in a low resolution mode, but my monitor did complain about "non optimal mode" and my keyboard didn't seem to work. So I moved it aside and rebooted again. This time the system came up without any warnings about low-graphics mode. Weird. I rebooted again just to make sure and it worked. OK, don't understand it, but problem considered solved for the moment.

Looking into lack of audio... ah, I actually do have audio, it's just really soft. I have to crank the volume and I can hear it. Even if I turned the volume up to 100% (using F11) it was still really soft.

Hmm, I'm also noticing my video is somewhat jittery, like I experienced before when I wasn't using the NVIDIA drivers.


Well, that's enough for this post. I'll pick it up in my next post...

Tuesday, June 8, 2010

Back in the saddle again with Mythbuntu and HDTV OTA...

Well, after deciding I didn't need MythTV any more, I've changed my mind. Mainly because we dropped cable tv and are now relying on over the air (OTA) HDTV, so my old Series 1 Tivo, with only an analog tuner, doesn't do me a lot of good any more.

So, I bought a Hauppauge HVR-1600 (model 1099) with the idea of running MythTV again, this time tuning in OTA HDTV. I've going to install Mythbuntu 10.04 from scratch and go from there.

Stay tuned...

Saturday, February 6, 2010

Using Tomato router for DynDNS updates

Since I reinstalled my OS, I hadn't done my dyndns updating yet. Instead of doing it on my Ubuntu box, I decided to have my Tomato router do it instead following these directions. I also followed the suggestion in the first comment to force a daily update similar to what I did before.

Tuesday, January 12, 2010

So long mythbuntu...

So we recently got a new HD Tivo, which left my ten year-old series one Tivo available. I decided to move it down to my den and remove mythbuntu from my linux box and make it media server.

My experience with mythbuntu was pretty good over all, the only real sore spot being occasional problems with lirc. Certainly if I didn't have a Tivo available, I'd still be using it.

Since I didn't really want to keep any of the recordings I had, I decided to reinstall the system from scratch. Here's my journey...

I choose Ubuntu Server 9.10 as my OS. Really the choice was between 9.10 and 8.04 LTS. I decided I wanted the latest and greatest more than stability. So I grabbed the ubuntu-9.10-server-amd64.iso, burned a CD and away I went.

Next decision was partitioning my three disks: sda @ 250GB, sdb @ 1TB, sdc @ 250GB. I decided to make sda my root and virtual machine partition. sdb was going to be for backups and then sdc for holding my media. So sda broke down as a 80GB root partition, a 1 GB /boot partition, a 19GB swap partition and the remainder (~150GB) as /vms. sdb and sdc were simply /mnt/backups and /mnt/media respectively.

The default install had me doing LVM (logical volume manager), but frankly I couldn't figure out how to getting it reconfigured correctly at a level that I was confident I knew what I was doing, so I disabled it.

Other options selected during the install:
  • Set to do security updates automatically
  • I installed: OpenSSH server, Samba Server and the LAMP Server.
  • I set the mysql root password to my password
After the install was complete I did the following:
Todo at this point:

Sunday, December 13, 2009

Upgrading laptop from 9.04 to 9.10

Upgraded my Ubuntu laptop from 9.04 to 9.10. No major issues.
http://www.ubuntu.com/getubuntu/upgrading

As with 8.10 upgrade, my Firefox is all messed up. Google toolbar and all my other extension buttons are gone. To get them back I had to disable the "Ubuntu Firefox Modifications" and then I was able to restore everything.

Sunday, November 29, 2009

Virtualbox USB devices greyed out

Running WinXP inside of VirtualBox and wanting to re-program my Harmony Remote, but all the USB devices were grey out. I followed these directions to fix.

First I added myself to vboxusers group:
# grep vbox /etc/group
vboxusers:x:128:
# usermod -G vboxusers -a von
In order to get this group change to take effect in my login session, I had to logout and back in again.

Then I edited /etc/fstab to add /proc/bus/usb. I had an old entry I had to comment out.
# vi /etc/fstab
# tail -2 /etc/fstab
#/dev/bus/usb /proc/bus/usb usbfs auto 0 0
none /proc/bus/usb usbfs devgid=128,devmod=644 0 0
I had to unmount the old /proc/bus/usb and then remount it:
# umount /proc/bus/usb
# mount -a
At this point I restarted VirtualBox and was able to mount USB devices.

Friday, August 14, 2009

apt-get failed to fetch errors...

I'm seeing the following errors running 'apt-get update'. Not sure why. /var/log/apt-cacher/error.log shows no errors.

% sudo apt-get update
...
Err http://us.archive.ubuntu.com jaunty/multiverse Translation-en_US
Error reading from server - read (104 Connection reset by peer)
...
Err http://us.archive.ubuntu.com jaunty-updates/universe Translation-en_US
Error reading from server - read (104 Connection reset by peer)
...
Hit http://us.archive.ubuntu.com jaunty-updates/multiverse Sources
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/jaunty/multiverse/i18n/Translation-en_US.bz2 Error reading from server - read (104 Connection reset by peer)

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/jaunty-updates/universe/i18n/Translation-en_US.bz2 Error reading from server - read (104 Connection reset by peer)

E: Some index files failed to download, they have been ignored, or old ones used instead.

apt-get update missing GPG key

I was seeing the following error when running "Check" on the update-manager, or 'apt-get update':
GPG error: http://ppa.launchpad.net jaunty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 248DD1EEBC8EBFE8
Answer, kudos to Gentoo Blog:
% gpg --keyserver subkeys.pgp.net --recv 248DD1EEBC8EBFE8
gpg: requesting key BC8EBFE8 from hkp server subkeys.pgp.net
gpg: key BC8EBFE8: public key "Launchpad PPA for Network-manager" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
% gpg --export --armor 248DD1EEBC8EBFE8 | sudo apt-key add -
OK

Thursday, July 30, 2009

Networking didn't work after kernel upgrade: br0?

I did an 'apt-get dist-upgrade' and there was a kernel upgrade, so I rebooted. When the system came back there was no functional networking. Everything looked fine, I couldn't reach anything besides loopback.

On a hunch, I commented out br0 interface from /etc/network/interfaces and bounced networking (/etc/init.d/network restart) and all OK.

Then for grins I added br0 interface back and bounced networking again and, huh, all now seemed OK.

So I tried rebooted and all was still OK.

Chalking it up to a mystery for now unless problem returns.

Saturday, July 25, 2009

Another dyndns false alarm - put weekly force into place

I got another ddclient false alarm, where my daily cron job seems to lag just a day behind dyndns sending me an email warning.

This time I decided to add a cron job that does a forced update once a week to get rid of this race condition. Start my copying over the daily cron job:

# cp /etc/cron.daily/ddclient /etc/cron.weekly/


And then editing it to include '-force':
# vi /etc/cron.weekly/ddclient


End result looks like this:
#!/bin/sh
/usr/sbin/ddclient -syslog -force

Sunday, July 5, 2009

Upgraded to Virtualbox 3.0

I notiec that Virtualbox 3.0 was released, so I upgraded my previous install using the directions from www.virtualbox.org. This time I went the route of editing /etc/apt/sources.list by adding the following line:

deb http://download.virtualbox.org/virtualbox/debian jaunty non-free


Then adding the Sun VBox key:

wget -q http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc -O- | sudo apt-key add -


Then did the install:

apt-get install virtualbox-3.0


Then I also downloaded and installed the new 3.0 version of the SDK from the Virtualbox download page (which seems to have been updated to work with Python 2.6 btw).

Monday, June 29, 2009

Getting Django running under Apache

I heard a number of good things about Django and wanted to give it a try. After following the tutorial and playing around with it, I found it really cool. BTW, there is also good documentation to be found at the Django Book site.

After playing a little, I decided I wanted to try deploying Django into my existing Apache instance. And well, I found the documentation for doing this somewhat lacking (even in the book). But I forged ahead and catched what it took here. Hopefully it will either be helpful or someone can come along and tell me I missed something.

First, I started by installing Django on my Ubuntu server. I already had Apache installed and working btw.
sudo apt-get install python-django

Reading through the Django document I decided to go the modwsgi route since that seem to be the recommended course. I followed the directions for installing modwsgi:
sudo apt-get install libapache2-mod-wsgi

Then I created a Django site to run my applications in. Pick the name of your site carefully - as far as I can tell, it will appear in all your URLs (maybe I'm wrong on this as I haven't experimented too much):
cd /usr/local
sudo django-admin startproject django_site

Now, you could just go ahead and make your site owned by the Apache user (www-data), but I decided to make it owned by me so that I could easily edit things:
sudo chown -R vwelch django_site
Now create /usr/local/django_site/django.wgsi that looks like the following:
import os
import sys

os.environ['DJANGO_SETTINGS_MODULE'] = 'django_site.settings'
sys.path.append('/usr/local')
sys.path.append('/usr/local/django_site')

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

Now go ahead and edit /usr/local/django_site/settings.py and set up your database. I used SQLite3 since it was the simplest. You will need to put the database somewhere the Apache user (www-data) has write access. In my case I created a directory just for this purpose:
sudo mkdir /usr/local/django_db
sudo chown www-date /usr/local/django_db

So the relevant two lines of my settings.py file looked like:
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = '/usr/local/django_db/database.db'

Now go ahead and create the database - you must do this as the Apache user:
sudo -u www-data ./manage.py syncdb


Time to proceed with Apache configuration. Create the file /etc/apache2/sites-available/django.conf (using 'sudo vi') so that it looks like the following. Note that I believe the first argument to WSGIScriptAlias "/django_site" must patch your site name. The second line lets the admin application find it's CSS (I haven't dealt with the case another application also wants CSS).
WSGIScriptAlias /django_site /usr/local/django_site/django.wsgi
Alias /media /var/lib/python-support/python2.6/django/contrib/admin/media

Now enable the site in Apache and restart it:
sudo a2ensite django.conf
sudo apache2ctl restart


Now visit you should be able to visit http://hostname/django_site and get a Django welcome page. If not, well, something is wrong :-/

At this point you can add applications under /usr/local/django_site as you normally would and have them appear at http://hostname/django_site/appname

Good luck. And as I mentioned I figured this out through mostly trial and error. If anyone can correct me or point me at better docs, I'd be grateful.

Sunday, June 14, 2009

Uninstalling VMWare 2.0.1, installing VMWare 1.0.9 on Ubuntu 9.0.4

I had previously installed VMWare 2.0.1 and I hate it. I'm probably going to move to VirtualBox, but I need VMWare for a while until I transition, so I decided to take another run at getting VMWare 1.0.9 to install.

First, to uninstall VMWare 2.0.1:
# /usr/bin/vmware-uninstall.pl
Then I downloaded VMWare 1.0.9 from the VMWare website.

Previously I had run into this bug which caused the vmmon build to fail.

The trick to getting it to build is to use this patch following the directions from this tutorial, which worked for me despite it being for an older version.

USB thumb drive mounting writable only by root...

I had a thumb drive that was mounting on my Ubuntu laptop OK, but was writable only by root.

Long story short, I figured out it was something about the way it was formatted. When I tried to put the same thumb drive into my Mac, it wouldn't mount it and I had to reformat it. After that it mounted just fine on my Ubuntu laptop and was owned by when when I did so.

Not sure how I formatted it in the first place, but lesson learned is that certain formats mount OK but will not be user writable.

Monday, June 8, 2009

Installing Virtualbox and creating Ubuntu VMs on headless Ubuntu 9.04 server

Here's my situation: Ubuntu 9.04 server, headless and I want to install Virtualbox on it and get Ubuntu 8.04 LTS servers running as root.

Step 1: Install Virtualbox

Following the directions at the Virtualbox Linux download page I did the following:

1a) Edited /etc/apt/sources.list and add the virtual box repository:
deb http://download.virtualbox.org/virtualbox/debian jaunty non-free

1b) Add the virtualbox key to the apt keyring:
wget -q http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc -O- | sudo apt-key add -

1c) And install:
apt-get install virtualbox-2.2

Step2: Configured bridged networking

I basically followed the directions on the help.ubuntu.com wiki.:

2a) Install bridge-utils:

apt-get install bridge-utils

2b) Now edit /etc/network/interfaces and add the br0 interface with the same address as your primary interface (eth0 in my case). Note that these directions assume you are using a static IP, if not you are on your own. My /etc/network/interfaces now looks like this:

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

# Configured per https://help.ubuntu.com/community/VirtualBox/Networking
# Address of br0 should be the same as eth0
auto br0
iface br0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
bridge_ports eth0 vbox0 vbox1


2c) Now restart the networking:

/etc/init.d/networking restart

...wait a couple minutes for the network to come back - my SSH session survived the restart YMMV...

Now I have a br0 interface:

# ifconfig br0
br0 Link encap:Ethernet HWaddr 00:18:8b:76:32:11
inet addr:192.168.1.10 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::218:8bff:fe76:3211/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:87 errors:0 dropped:0 overruns:0 frame:0
TX packets:74 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6130 (6.1 KB) TX bytes:11447 (11.4 KB)

2d) Create /etc/vbox/interfaces:
vi /etc/vbox/interfaces

So that it looks like:
vbox root br0

2e) Restart virtualbox networking, but hmmm, I don't have /etc/init.d/vboxnet, but I do have /etc/init.d/vboxdrv so I restarted that instead:
/etc/init.d/vboxdrv restart

2f) I skipped setting permissions on /dev/net/tun since I'm running VMs as root.

Step 3: Create a VM

I basically followed these directions, updated as I went. Also kudos to Sasquatch for the nic1 and bridgeadapter1 options.

3a) Create the new VM. You should be able to set the memory as you see fit. Other options you probably don't want to mess with.

VBoxManage -q createvm -name Ubuntu-Server -register
VBoxManage -q modifyvm Ubuntu-Server -memory 384MB -acpi on -ostype ubuntu -pae on -nic1 bridged -bridgeadapter1 br0

Note that if you have other VMs using vrdp you probably want to add "-vrdpport #" to use an available port (default port is 3389).

3b) Create disk for the new VM and attach it. I created an 8GB disk based on my experiences trying to use smaller disks.
VBoxManage -q createhd -filename "Ubuntu-Server.dvi" -size 8192 -register
VBoxManage -q modifyvm Ubuntu-Server -hda Ubuntu-Server.dvi

3c) Download the iso for 8.04 server from Ubuntu. Note I use 8.04 since it has long-term support and hence I won't have to worry about upgraded the OS on the VM as often. Note that while the Ubuntu page tried to get me to use the 64 bit version, I found it did not work for me (I got the following error trying to boot with it: "This kernel requires an x86-64 CPU, but only detected an i686 CPU. Unable to boot - please use a kernel appropriate for your CPU.") so I used the 32 bit version instead. You should also choose a copy from a local mirror.

wget http://osmirrors.cerias.purdue.edu/pub/ubuntu-releases/hardy/ubuntu-8.04.2-server-i386.iso


3d) Register the iso image and attach it to the VM:
VBoxManage -q registerimage dvd /path/to/ubuntu-8.04.2-server-i386.iso
VBoxManage -q modifyvm Ubuntu-Server -dvd /path/to/ubuntu-8.04.2-server-i386.iso

Ok, we now have a VM that's ready to boot and install Ubuntu...

Step 4: Start the VM and Connect to it via vrdp

4a) Start the VM in vrdp mode:
VBoxManage -q startvm Ubuntu-Server --type vrdp

4b) Connect using a remote desktop client. What I found worked for me from my Ubuntu 9.04 laptop was 'rdesktop' from the commandline:
rdesktop server-name

Or from my Mac, Remote Desktop Connection, though it does give a warning about "Remote Desktop Connection cannot verify the identity of the computer that you want to connect to."

Step 5: Do a standard Ubuntu Install
Ok, you should now be looking at the console on the VM which has booted from the CD. Go ahead and do your standard Ubuntu install.

When the install completed, I found the system automatically rebooted from the hard drive without me having to do anything to unmount iso image.

Step 6: Clean up

The only thing to do is detact the iso from the VM. After powering off the VM, do the following:
VBoxManage -q modifyvm Ubuntu-Server -dvd none

Saturday, June 6, 2009

sftp subsystem dying

I tried to open a nautilus bookmark of a sftp session to my server today and it closed immediate with a "Could not open location 'sftp://vwelch@host' ssh program unexpectedly exited' message.

Running a sshd in debug mode on the server and I saw the following:
subsystem request for sftp
debug1: subsystem: exec() /usr/lib/openssh/sftp-server
debug1: Received SIGCHLD.
So for some reason my sftp-server subsyst is immediately failing. No idea why. Will update here when I figure it out.