For developing web applications I run a development environment on OSX, this environment includes Django and apache with mod_wsgi. My staging server and production server are both virtual machines using KVM, running Ubuntu (10.04) with apache, mod_wsgi, mysql, solr on jetty.
As a result bringing new versions from staging to production server is hassle-free, just copy the VM from staging to production. Going from development to staging is painful though.
So may question is :
is there a way to use a VM running ubuntu on my mac that can be (easily) exported to a VM running on linux?
I've briefly looked into Virtual Box, but it's unclear to me if there's a reasonable chance this will work. Other stuff like virtuozzo/openVZ doesn't run on OSX apparantly.
VirtualBox runs fine on both MacOS X and Ubuntu. You can easily export/import appliances (ovf) from them. http://www.virtualbox.org/manual/ch01.html#ovf
It's not free, but if you virtualise using Fusion from VMware, it will allow you to export your VM from the Mac to virtually any VMware product - for instance Workstation or Server running on Linux.
Alternatively your Linux virtualisation solution of choice may be able to import VMware VMs - for instance if you are using Virtualbox see http://www.ubuntugeek.com/howto-convert-vmware-image-to-virtualbox-image.html
Virtualbox should run OS on both platforms, although as I;ve only used it on a windows host I can't say for sure. You can export the machine setting to a .ovf file which then can be moved to another machine.
Use a test machine and try it.
I've moved VM's from VMWare Server on Linux, to Fusion and to VMWare Player on Windows without problems. The biggest thing to pay attention to is your versions- if you make something in the latest and greatest format on one platform, you'll need to verify the VMWare on the other platform supports it.