Tuesday, January 13, 2009

VirtualBox 2.1 Upgrade Windows Host

I had a annoying problem while upgrading VirtualBox on my Windows Host.

One of the major improvements of version 2.1 is that Host based networking has been made significantly easier. No longer is it necessary to have TAP devices and bridge them together. Now it just works, almost...

The problem I had was that once VirtualBox was upgraded my configuration was no longer valid. My configuration files were still expecting to use the TAP devices that were previously installed.

So I went under the network configuration section of the VirtualBox GUI to update the device selection. However where the list of network devices usually is displayed there was nothing. Just an empty list.

In previous versions, you could just add a new TAP device and go from there. However that is no longer required (or an option), so the question is how do I get a device in the list?

Fortunately I'm not alone and someone has already solved this issue on the forum. Here is a link.

In case the link doesn't work.

The trick is to go into your network control panel, select the device's properties, and under the general tab in the list where it says This connection uses the following items check the item for VirtualBox Host Interface Networking Driver.

Monday, January 05, 2009

Python Simple Database Library

I have just released the second version of pysimpledb. It is a simple wrapper to the standard Python DB-API 2.0 which aims to take the repetitive boiler plate code out of creating a good database access layer.

The project is not a full ORM and is not meant to be. It is fashioned after projects like Apache's iBatis and Spring's JDBC templates, and is intended for use in cases where it is important to be able to directly control the SQL that is being used.

Here is a link to the project page, link.

Please try and and let me know what you think.

Wednesday, December 10, 2008

Parallels 4.0 Upgrade - Windows XP Guest

I recently upgraded to version 4.0 of Parallels for Mac. Everything went well, with the exception of one minor issue. While upgrading some of my Windows XP guests, the driver for the sound card was not found.

In fariness to Parallels, I use a customized install of Windows XP which was created by using nLite. It allows for faster setup and smaller Parallels images. The catch is that it does this by removing things that are not normally used. Like programs and drivers...

So when I went to upgrade my Windows XP guests to Parallels 4.0, the guest OS couldn't find the sound card driver. Normally this driver is included, but I believe it was stripped out by nLite.

After trying the usual tricks (uninstalling the device, searching the Windows XP CD, etc...) nothing worked.

Fortunately I was able to locate the driver that is needed to work with Parallels. It is an Intel 82801 AC97 Audio driver. I was able to download a free copy of it from DriverGuide.com. Installed fine, sound works great now!

Monday, November 24, 2008

Ubuntu, Virtualbox, and Shorewall

If you are running virtual servers using VirtualBox and you are using the host based networking, then this post may be helpful for you.

I am running my development servers (Tomcat, Asterisk, Apache, etc...) using VirtualBox since it allows me to consolidate machines and run everything from one dual core box. Since I also try to practice good security (even at home) I have enabled UFW (uncomplicated firewall). While this works great for a basic desktop setup, it breaks networking for my virtual hosts.

To get around this you can use a more sophisticated firewall configuration tool like shorewall or you can edit your iptables directly. I went with shorewall since it is easier to work with.

Here is what I did to get everything working...

1.) Installed shorewall,
sudo aptitude install shorewall

2.) Disabled UFW,
sudo ufw disable

3.) Copy the default shorewall configuration files,


cd /usr/share/doc/shorewall-common/examples/one-interface
sudo cp interfaces policy rules zones /etc/shorewall/


4.) Configured the files as based on this post on the Ubuntu forums.

http://ubuntuforums.org/showthread.php?t=968278

5.) Validate your configuration,
sudo shorewall check

6.) Turn on shorewall by editing /etc/default/shorewall and changing the startup=0 line to startup=1.
7.) Start shorewall,
sudo /etc/init.d/shorewall start



I followed the post on the Ubuntu forum with the following exceptions...

1.) I have multiple VirtualBox host adapters (tap0, tap1, and tap3). So I have additional lines in the interfaces file for them.


vbx tap0 detect dhcp
vbx tap1 - -
vbx tap2 - -


2.) I didn't start with adding this line to the policy file, all all ACCEPT info. Mostly because I'm lazy and didn't want to remove it a few steps later.

3.) I tweaked my rules file a bit so that I could ping my virtual hosts.


# Reject Ping from the "bad" net zone.. and prevent your log from being flooded..
Ping/REJECT bri $FW

# Permit all ICMP traffic FROM the firewall TO the net zone
ACCEPT $FW bri icmp
ACCEPT $FW net icmp
ACCEPT $FW vbx icmp


At this point everything should be working fine. That being said, I do not claim to be an expert on shorewall or linux network security. So please feel free to leave a comment if you notice something that could be improved.