Skip to content


Setting up Virtualbox on ubuntu

This is written for Ubuntu hardy 8.04 and virtualbox 1.6.2

  • Download the deb package from virtualbox/sun.  Or install with apt

deb http://download.virtualbox.org/virtualbox/debian hardy non-free
wget -q http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc -O- | sudo apt-key add –

  • Install the package: dpkg -i package name, or apt-get install virtualbox-2.0 bridge-utils uml-utilities
  • create any machines you want and make any customizations you would like.
  • add a few lines to rc.local

# change permissions for vbox

chmod 0666 /dev/net/tun

  • add the following to /etc/network/interfaces “that will get you 2 tap devices, enough for two machines”

auto tap1 tap2
iface tap1 inet manual
tunctl_user desktop
iface tap2 inet manual
tunctl_user desktop
auto br0
iface br0 inet dhcp
bridge_ports eth0 tap1 tap2
bridge_maxwait 0

  • create /etc/vbox
  • nano /etc/vbox/machines_enabled
  • put a list of all virtual machines you want started and stopped at boot and shutdown/reboot
  • nano /etc/init.d/virtualbox

contents of above file

#! /bin/sh
### BEGIN INIT INFO
# Provides: virtualbox_vms
# Required-Start:    $local_fs $syslog $remote_fs
# Required-Stop:     $local_fs $syslog $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      S 0 1 6
# Short-Description: Control VirtualBox Virtual Machine instances
### END INIT INFO
#
# Version 20080531-0 AR
#
################################################################################
# INITIAL CONFIGURATION
VBOXDIR="/etc/vbox"
RUNAS_USER=desktop
SU="su $RUNAS_USER -c"
VBoxMDAEMON="VBoxManage"
VBoxSDAEMON="VBoxHeadless"

. /lib/lsb/init-functions

# Are we running from init?
run_by_init() {
([ "$previous" ] && [ "$runlevel" ]) || [ "$runlevel" = S ]
}

################################################################################
# RUN
case "$1" in
start)
cat $VBOXDIR/machines_enabled | while read VM; do
log_action_msg "Starting VM: $VM ..."
#                su $RUNAS_USER -c "$VBoxSDAEMON startvm \"$VM\" -type vrdp &"
su $RUNAS_USER -c "$VBoxSDAEMON --startvm \"$VM\" &"
done
;;
stop)
# NOTE: this stops all running VM's. Not just the ones listed in the
# config
cat $VBOXDIR/machines_enabled | while read VM; do
log_action_msg "Shutting down VM: $VM ..."
su $RUNAS_USER -c "$VBoxMDAEMON controlvm \"$VM\" savestate"
done
;;
start-vm)
log_action_msg "Starting VM: $2 ..."
su $RUNAS_USER -c "$VBoxSDAEMON --startvm \"$2\" > /dev/null 2 >&1"
;;
stop-vm)
log_action_msg "Stopping VM: $2 ..."
su $RUNAS_USER -c "$VBoxMDAEMON controlvm \"$2\" savestate"
;;
poweroff-vm)
log_action_msg "Powering off VM: $2 ..."
$VBoxMDAEMON "controlvm \"$2\" poweroff"
;;
status)
log_action_msg "The following virtual machines are currently running:"
echo "Still thinking about what to do here."
#$VBoxMDAEMON "list runningvms" | while read VM; do
#echo -n "$VM ("
# not yet figured this out
#echo -n `"$VBoxMDAEMON showvminfo $VM|grep Name:|sed -e 's/^Name:\s*//g'"`
#echo ')'
#done
;;
*)
log_failure_msg "Usage: $0 {start|stop|status|start-vm <VM name>|stop-vm <VM name>|poweroff-vm"
exit 3
esac
exit 0
  • chmod 755 /etc/init.d/virtualbox
  • update-rc.d virtualbox defaults
  • one last adjustment to make sure there is enough time between the vboxdrv and vboxnet starting and virtualbox: mv /etc/rc2.d/S20virtualbox /etc/rc2/d/S99virtualbox
  • That should be it. Now when you shutdown the virtualmachines should be saved and when you boot the virtualmachines should start up.

Init script created by a great co-worker of mine. Could not have done this without his help. It works great, think I like this setup better than vmware.

Posted in Linux.


Changed a few things with my mythtv network this weekend

Move a few things around so m1box is upstairs now and m2box is down stairs for the time being.  All boxes have been rebuilt with a fresh new install of ubuntu hardy i386.  Install takes just about 2 hours from start to finish now.  Not bad at all.  I got rid of all x64 files in my local repo and that got rid of about 10.2 gig of data.  Apt-mirror should not take long at all to update at night now.  I have a total of 4 backend processes running on 4 different boxes.  That will help out tremendously with commercial flagging.  I am going to try out commflagging 24×7 now and see if that causes any problems.  I may actually start commflagging immediately also.  May try that later this week.  Next project is to get svideo working on m2box and hooking that to an old tv in our living room.  Want to get that working so we can watch movies in the living room.  Mostly dvd’s for Emma.  Want to get this all working good by winter.

Posted in Mythtv.


How to get a lava pci serial card working in ubuntu hardy

apt-get install setserial

When you run a lspci -v it will list your lava card and it should look something like this:

Serial controller: Lava Computer mfg Inc Unknown device 0900 (prog-if 02 [16550])
Flags: slow devsel, IRQ 16
I/O ports at 9800 [size=256]
I/O ports at 9400 [size=256]
From this info you can create a command with setserial.  For me the command I run is below

setserial /dev/ttyS0 port 0×9800 irq 16 uart 16550a baud_base 115200

If that works you can now just create a file:

/etc/serial.conf

/dev/ttyS0 port 0x9800 irq 16 uart 16550a baud_base 115200

Is the only thing in the file.   You should be up and running. That is all I had to do.

Posted in Linux.


Building a mythfrontend box on hardy from scratch

start os install ( I use the hardy i386 alternate cd)

during install routine I create a default user and we will call it desktop.

make desktop user login automatically

install nvidia restricted driver

apt-get install openssh-server portmap nfs-common xfsprogs lm-sensors snmpd smartmontools mutt postfix ssh dstat iptraf subversion checkinstall apache2 php5 qt3-dev-tools libdts-dev libfreetype6-dev lame apcupsd apcupsd-cgi logwatch dselect openbox phpmyadmin lirc mailx sysv-rc-conf mysql-client libqt3-mt-mysql

nano /etc/fstab

192.168.1.210:/offline /offline nfs soft,intr,rsize=32768,wsize=32768,async,nfsvers=3,bg,actimeo=0,tcp
192.168.1.210:/dvr /dvr nfs soft,intr,rsize=32768,wsize=32768,async,nfsvers=3,bg,actimeo=0,tcp
mkdir /dvrmkdir /offline

mount -a

cp /offline/archive/common/etc/apt/sources.list.hardy /etc/apt

apt-get clean

apt-get update

apt-get upgrade

apt-get build-dep mythtv

apt-get install libmad0 libmad0-dev flac libflac-dev libcdaudio-dev libtag1-dev libcdparanoia0-dev xine-ui libxine1-ffmpeg mplayer

download nx debs

sudo dpkg -i nxclient_3.0.0-89_i386.deb
sudo dpkg -i nxnode_3.0.0-93_i386.deb
sudo dpkg -i nxserver_3.0.0-79_i386.deb

RSYNC
cp /offline/files/rsync/rsyncd.conf /etc
cp /offline/files/rsync/rsyncd.secrets /etc
nano /etc/default/rsync and enable
chmod 600 /etc/rsyncd.secrets

/etc/init.d/rsync restart

SNMP

cp /offline/archive/common/snmpd.conf /etc/snmp

nano /etc/default/snmpd remove 127.0.0.1 our of config line

/etc/init.d/snmpd restart
SMARTD

cp /offline/archive/common/smartd.conf /etc/smartd.conf
nano /etc/default/smartmontools
start_smartd=yes
/etc/init.d/smartmontools restart

WEBMIN

apt-get install libauthen-pam-perl libio-pty-perl libmd5-perl libnet-ssleay-perl
dpkg -i webmin_1.390_all.deb

apt-get update

apt-get upgrade

Wake on lan if supported

echo 'ethtool -s eth0 wol g' >> /etc/rc.local

APCUPSD
cp /offline/archive/common/apcupsd/apcupsd.conf /etc/apcupsd
nano /etc/default/apcupsd and make isconfigured=yes
/etc/init.d/apcupsd restart

Customize desktop for mythtv

nano /usr/share/xsessions/mythtv.desktop
[Desktop Entry]
Encoding=UTF-8
Name=MythTV
Comment=Use this session to run MythTV
Exec=/usr/local/bin/mythtv.sh
Icon=
Type=Application

nano /usr/local/bin/mythtv.sh
mythfrontend&
killall irexec
irexec -d
nvidia-settings -l
mtd -d

exec openbox

chmod +x /usr/local/bin/mythtv.sh

LIRC

cp /dvr/files/lircrc /home/desktop/.mythtv
ln -s /home/desktop/.mythtv/lircrc /home/desktop/.lircrc

To get basic things setup for myth I just do a apt-get install mythtv. Then go and uninstall all mythtv packages(that is if you want to build your own packages, just let it be if you are going to use the packages)

Otherwise a few steps you will have to take to get things working like the Backend at reboot and what not.

cp /dvr/scripts/mythtv-backend /etc/init.d

cp /dvr/scripts/mythtv-backend.default /etc/default/mythtv-backend

update-rc.d mythtv-backend defaults

mkdir /var/log/mythtv

make sure /root/.mythtv/mysql.txt is created and correct

/etc/init.d/mythtv-backend start

Install medibuntu stuff

sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list
wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add - && sudo apt-get update

Posted in Linux, Mythtv.


Nagios2 Ubuntu

This always gets me.  The nagios2 package for ubuntu (hardy and many others) is broken.  If you want to submit any commands from the web interface do the following.

/etc/nagios2#/etc/init.d/nagios2 stop
/etc/nagios2# dpkg-statoverride –update –add nagios www-data 2710 /var/lib/nagios2/rw
/etc/nagios2# dpkg-statoverride –update –add nagios nagios 751 /var/lib/nagios2
/etc/nagios2# /etc/init.d/nagios2 start

Posted in Linux.


New GPS

Last week I ordered a new gps. Thanks to Fedex Home I did not get it until late on saturday. Can you tell I hate fedex home. They come about noon everyday during the week. Don’t deliver because they need signiture. Then saturday they don’t come till about 2:30pm. Remember to always use ups. At least you can go pick up the package once you see they left a tag. fedex home does not allow you to do that until the 3rd attempt. Thankfully they started trying to deliver on thursday.

Anyway, I ended up getting the Mio C230 from amazon for $139 shipped. This unit is easily unlocked. I bought a 2 gig sd card and loaded up the files from that site and everything was unlocked. To easy. I now have many more poi and a few more things like speed cam locations and what not. Now to look into what it will cost to get upadated maps on the unit and also a mount for the car. Very slick unit and just the little bit of playing around that we have done. This unit looks like it will be perfect for what we need.

Posted in New toys.


Mythtv has been upgraded

Today I went ahead and upgrade mythtv. So far it is working great. The only thing I have come accross that doesn’t seem to work is mythvideo. I plan to start with a fresh db here shortly. I want to make sure everything seems clean before I clear out the db and create a new one and import all of the recordings. I will probably bring my mythbox that is hooked to the project into the main myth setup (currently pointing to my test master backend right now) later tonigt. Things seem to be chugging along great so far. I will have a few sd recordings later tonight and some hd recordings later this weekend.

Posted in Mythtv.


Time to upgrade to the latest svn of mythtv 0.21-fixes

Well it has been almost a week since the upgrade to our master backend box at home. Had a few hiccups that were self induced, but everything seems very stable. I hope to upgrade to the latest version of mythtv 0.21-fixes either tomorrow or the weekend. After that goes smooth I want to rebuild the two frontend boxes as clean hardy boxes. One box has been upgraded from gutsy to hardy and it is running great so far. The test backend setup I have running on an old box is also running great and that has been running the latest svn of the fixes branch for almost a week also.

Posted in Mythtv.


Master backend is now ubuntu hardy

After a small mistake on saturday, the main server at home is now running Ubuntu Hardy. It was a pretty easy process and fast since I had the whole mirror setup at home for almost everything I needed. Only a few small problems here and there but for the most part the box is up and happy. Still working on vmware since it is not quite supported yet. Thinking about going to virtualbox anyway. Other than that I think I have everything back to what it was on fedora core 6.

The small mistake was I forgot to unplug the main ide drive I had fc6 installed on. It was the first boot drive and ubuntu wrote to the master boot record. I really didn’t feel like digging into that to much to fix it so I just started fresh. I didn’t miss a recording with myth. Now to compile the latest .21-fixes and I will be all set for quite awhile. I have it compiled on almost all boxes already. Just have to uninstall the old version and install the new one.

Posted in Mythtv.


Back to the daily grind

Well Jen and I are back from Florida and Emma and Taylor are back from the ville.  Jen had a conference near St. Augustine Florida.  We stayed at the Ginn Hammock Beach Resort.  We were there the week after the big golf event.  Had wifi for 2 days and then they had pretty much everything cleared out.  Still had wired internet access at least.

Taylor and Emma had a great week at the grand parents.  Emma is cutting her first tooth also.  It was good to be home.  Now getting caught up at work and now that it is spring I need to get back to the yard and clean it up for summer.

Posted in General.