Archive for June, 2007 Page 2 of 17



VMWare vs. Parallels vs. QEMU

VMWare Fusion
I was right about VMWare on Mac OS X - they are going to charge for it. Its actually not a bad price though, $79 or $39 if you pre-order.

The nice thing about VMWare Fusion for Mac OS X is that they have all sorts of other products that can work with it. I believe they also use an open format for their disk images.

Parallels
These factors make VMWare a compelling alternative to Parallels, which has worked very well for me, but due to its proprietary disk format, it losing its luster.

QEMU, KQEMU, and “Q”
My favorite of all these virtualization systems is QEMU. It is open source, runs on a wide variety of platforms (even FreeBSD!), and offers a wide range of processors to emulate. The main problem I have with it right now is that the kqemu kernel module has not yet been ported to Mac OS X. I’ve considered running ubuntu in a VMWare or Parallels vm, and then trying to run kqemu inside of that, but that’s just crazy talk.

What would be optimal would be to run VMWare Fusion on Mac OS X, and run QEMU w/ KQEMU on everything else. However, while it is possible to convert VMWare .vmdk’s to qcows, QEMU and VMWare cannot run both types of files (AFAIK).

So what to do? My gut is telling me that since KQEMU is now GPL, it will likely get ported to Mac OS X at some point in the near future. As it stands, running Q on Mac OS X without hardware acceleration isn’t terrible. My gut is also telling me that the vde package which QEMU can work with is really awesome. I think it is even available on Mac OS X via MacPorts.

I may end up purchasing an advance copy of VMWare Fusion just so for the convenience factor, but going forward I’m planning to use QEMU.

m0n0wall Development Environment

I’m trying to setup a development environment for m0n0wall on my Macbook, but now I’m running into a weird problem with FreeBSD when installing the jail.

I’m following the AskoziaPBX how to install freebsd6 for m0n0wall development instructions, which is a combination of the m0n0wall development docs and the miniBSD docs available at ultradesic.com.

Here’s a screenshot of the problem I’m running into:
20070627_m0n0wall-development-error.jpg

Hmm, seems to have worked OK. Couple of notes:

  • Didn’t need to download the minichroot.sh to any particular directory.
  • Needed to put the ’set prompt = “MiniBSD %~ %# “‘ line at the bottom of /usr/jail/root/.cshrc

I’m rebuilding world now, and yes I am drinking a cup of coffee. Well a glass of iced coffee. :-)

m0n0dev Notes
m0n0dev is looking real good. Just one note so far:

  • After untarring the tarball, I chmodded m0n0dev.php: chmod 0700 m0n0dev.php

Getting an error when trying to patch everything:
COMMAND FAILED: cd /usr/src; patch -p0 < /usr/m0n06branch/build/patches/kernel/kernel-6.patch

DOH! I missed this step:

Change the ‘cvs tag’ line so we sync the OS sources to Release 6.2:

* default release=cvs tag=RELENG_6_2

Back to that cup of coffeee… good thing I just stocked up from Trader Joe’s!

While I’m on it, I did some reading up on FreeNAS, another distribution based off m0n0wall. There are a few things about FreeNAS that really caught my attention:

  • Uses lighttpd instead of mini_httpd
  • Uses PHP5 instead of PHP4

More information available at the FreeNAS Developer’s Handbook.

I’ve been using FreeNAS a little bit here and these, and although I was annoyed by the NFS bug (or lack of functionality), it is working quite well for me now. The thing that really interests me about FreeNAS is how it can gracefully coordinate the management of hard drives from a solid-state flash storage device. What I mean is that the operating system uses a rock-solid base of FreeBSD and a user-interface which allows very little to no changes to the operating system, but provides isolated management of other system resources, like drives, (whereas m0n0wall focuses on network interfaces), etc. This results in a very stable, yet configurable focus.

At this point, I have several m0n0wall-based servers:

  1. Network bridge for bandwidth management and traffic shaping. Runs stable m0n0wall 1.23, running on a generic PC (PC Chips V21G VIA C7 w/ dual gigE intel ethernet cards).
  2. Firewall and router for my LAN, also m0n0wall stable, running on WRAP platform.
  3. AskoziaPBX running on an HP t5135 (VIA EDEN) for our phone system.
  4. FreeNAS running on a generic PC (AMD)

I had tried out pfsense a bunch of times and although it had some features I liked (CARP), there was a lot I didn’t need, so I’m opting for the simplicity of m0n0wall instead.

An email was posted to the development list recently mentioning m0n0AP, which is something I’d be interested in checking out at some point:

20070628_m0n0ap-screenshot.jpg

I expect there to be many more m0n0wall based embedded applications to come out very soon. Some ideas: a virtual machine server, where you can create, edit, start and stop virtual servers, kind of like virtuozzo, but free and open, based on FreeBSD and QEMU: FreeQEMU anyone? (pronounced “freak-a-moo”). Also, a database management system - SQLite would be perfect for this. Like FreeNAS, you’d need a hard drive (or possibly even an NFS share) for this stuff, due to performance, storage requirements, and the number of writes required.

Back to m0n0wall Development Environment

./m0n0dev.php patch everything
It worked this time:

Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- Makefile.orig       Tue Feb  6 12:03:13 2007
|+++ Makefile    Tue Feb  6 12:03:35 2007
--------------------------
Patching file Makefile using Plan A...
Hunk #1 succeeded at 27.
done
patched bootloader
MiniBSD ~/m0n0dev/m0n0dev-0.1.2 # 

I’m now building everything and I was just asked a bunch of questions about SNMP - I just used the defaults. Also given options for dnsmasq - didn’t select anything, just chose OK.

Running into a problem with ipsec:

cd: can't cd to /usr/ports/security/ipsec-tools/work/ipsec-tools-0.6.6

what’s up?

MiniBSD ~/m0n0dev/m0n0dev-0.1.2 # cd /usr/ports/security/ipsec-tools/work/
MiniBSD /usr/ports/security/ipsec-tools/work # ls
.build_done.ipsec-tools._usr_local      .extract_done.ipsec-tools._usr_local    ipsec-tools-0.6.7
.configure_done.ipsec-tools._usr_local  .patch_done.ipsec-tools._usr_local

Aha, no 0.6.6, how about installing it? Or how about just changing m0n0dev.php to use 0.6.7, that was easy enough. Will it work?? Had to also copy /usr/m0n06branch/build/patches/packages/ipsec-tools-0.6.6 to 0.6.7, but it worked! Resulting in this:
“built and patched racoon (albeit hackily)”

Couldn’t have said it better myself! Everything compiled and packaged without any serious problems, though I did get this:

fstab: /etc/fstab:0: No such file or directory

Didn’t stop the process though.

Embedded Thoughts




Compact flash is a pain in the neck.
* The fact that some cards support DMA and others don’t is really aggravating.
* Write limitations are aggravating as well. Even with jffs2 and yaffs, I’m nervous a database like sqlite or mysql would burn through a flash drive in no time at all.

Some disks have built-in wear leveling. Interesting - the Emphase disk-on-modules have up to 4,000,000 writes. How many writes does a database make?

Related Links:
http://www.filipdewaard.com/php/SQLite-in-memory-databases/

http://www.sqlite.org/cvstrac/wiki?p=InMemoryDatabase

AskoziaPBX on an HP t5135

Here are the technical details for the installation of AskoziaPBX on an HP t5135 thin client:

  1. Download generic pc Askozia PBX image
  2. Download Chris Buechler’s m0n0wall Live CD
  3. Copy the AskoziaPBX image onto an MS-DOS formatted usb drive.
  4. Boot off the CD using a USB CDROM
  5. Plug in and mount the usb drive: “mount_msdosfs /dev/da0s1 /mnt/tmp/” or something like that
  6. Follow the regular instructions, targeting the 64MB flash drive which came with the t5135: “gzcat /mnt/tmp/pbx-generic-pc-xx.img | dd of=/dev/ad0 bs=16k”, or something like that

These are the steps I took, your situation most likely differs so think about what you are doing before you do it.

The t5135 is actually a pretty nice little device:

  • 128MB RAM
  • 10/100 LAN (VIA Rhine)
  • VIA Eden C7 400Mhz
  • 64MB Flash drive

Consumes about 11 watts at idle, up to 16 watts (that’s the highest I’ve seen, might go higher).