Friday, June 5, 2009

VirtualBox VM startup script

VirtualBox, Sun's (^H^H^H^H^HOracle's) free virtualization project for X86/X64 PCs, looks somewhat promising, with Seamless Windows and snapshots support. Better still, it runs like a champ on my aging PC, which I've demoted into a lowly Ubuntu 9.04 server install, running headless. Space around here is at a premium, and even though I have access to unlimited bandwidth and cabinet space at my job, so is money. There will be no fancy hypervisors in my immediate future.

The same things that make VirtualBox appealing make it less so: it's a very simple program to install, even deviating from Debian conventions. It takes only 30MB of space and everything can be tucked neatly away in /opt/VirtualBox, only to be accessed through $PATH and $LD_LIBRARY_PATH when needed. Everything can be command-line oriented: no web access that requires Java or ActiveX, and it's MUCH more intuitive than Citrix XenServer. It also doesn't require VT on the chip, which is a hard requirement for Citrix's Xen product. That said, running VMs as one would with VMware Server, or ESX, is a bit daunting. To accomplish this goal I created start/stop scripts that adapt to the VMs I have installed on the system. The script requires a "vboxmgr" account that owns all of the VMs, so give it a nice shell, like BASH.


#!/bin/sh

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/VirtualBox
export LD_LIBRARY_PATH

if [ "$USER" != "vboxmgr" ]; then
su vboxmgr -c "$0 $1"
else
PATH=${PATH}:/opt/VirtualBox
export PATH
case "$1" in

start)
VBoxManage list vms | while read LINE
do
UUID=`echo $LINE | awk -F'{' '{print $2}' | awk -F '}' '{print $1}'`
if [ "$UUID" != "" ]; then
NAME=`echo $LINE | awk -F'{' '{print $1}'`
echo "Starting the $NAME vm...\c"
# There could probably be better error checking here.
VBoxHeadless --startvm $UUID > /dev/null 2>&1 &
echo "done."
fi
done
;;

stop)
# This is a hard crash! Something better could be done?
VBoxManage list runningvms | while read LINE
do
UUID=`echo $LINE | awk -F'{' '{print $2}' | awk -F '}' '{print $1}'`
if [ "$UUID" != "" ]; then
NAME=`echo $LINE | awk -F'{' '{print $1}'`
echo "Stopping the $NAME vm...\c"
VBoxManage controlvm $UUID acpipowerbutton > /dev/null 2>&1
sleep 30 # Just to be safe...
VBoxManage controlvm $UUID poweroff > /dev/null 2>&1
echo "done."
fi
done
;;

*)
echo "Usage: /etc/init.d/vboxstartvms (start|stop)."
echo "Note: You must have a vboxmgr account! It should be a member of"
echo "the vboxusers group. This user will run all VMs!"
;;
esac
fi

Sunday, January 25, 2009

Indianapolis Fat Ass 500h

I'm not organizing anything, but *if* there were a Club Fat Ass event in Indianapolis this route looks like a perfect 50K:

Theoretical Club Fat Ass Indianapolis 500 (Hectometers).

Saturday, January 24, 2009

Babies cost a lot of money, please don't make me * you honey

I wouldn't give this song a best EVER for lyrics, but it's up there.

http://www.youtube.com/watch?v=V7j2gHahhr4

Tuesday, January 20, 2009

Yay!

Wednesday, January 7, 2009

Goblin Cock

Goblin Cock is on tour. Personally, I don't listen to Goblin Cock. However, I think it would funny as hell to drive to a close show to hear people yell "Fuck yeah! Goblin Cock rules!" The closest show where people may not get the joke is Toledo, OH. My uncle is recently unemployed and I need to pay a visit anyway. Maybe I can make a night of it.

ASA Notes

Brief ASA notes...

1. Set a hostname: hostname testasa1
2. Set an enable password: enable password blah level 15
3. Generate an RSA key: crypto key generate rsa
4. Create your username: username gswallow password blah privilege 2
5. Create an ASDM user: usernaem asdmuser password blah privilege 15
6. Set up some names for access: name 10.1.1.0 nFrame description "nFrame Admin"
7. Set up an interface:
interface Ethernet 0/0
nameif "Outside_10.1.1.0/24"
ip address 10.1.1.254 255.255.255.0
no shut
exit

8. Set up a default route: route Outside_10.1.1.0/24 0 0 10.1.1.1
9. Set your ASDM image file: asdm image disk0:/asdm-611.bin
10. Set up local authentication:

aaa authentication http console LOCAL
aaa authentication ssh console LOCAL

11. Set up HTTP access:

http server enable
http nFrame 10.1.1.0 255.255.255.0 Outside_10.1.1.0/24

12. Set up SSH:
ssh nFrame 255.255.255.0 Outside_10.1.1.0/24

Test!

Sunday, January 4, 2009

A Wii Bit of Acrimony

Visiting my dad's house, we were all immediately addicted to the Nintendo Wii. So I bought one. And ever since, the noise level in this house is maddening. The damned thing has been on all day. I've had to play sysadmin at least five times and it's just noon. Plus there's been a lot of yelling and just a little enjoyable game play.

Why do people like these things so much? I'm off to the gym.