I've thought about this. How do you transfer files between the host and the guest? Do you develop in OS X, transfer the files and then run them? If yes, isn't this a little time-consuming?
Pretty much every desktop virtualization package supports setting up shared folders to facilitation moving files between the host and guest OS. I know for a fact that VMWare Fusion on OS X does this, though the preference tab to enable it did take a little bit of searching to find.
That being said, if your goal is to develop in an environment more like your production system(s), you're going to need to work out your automated deployment model sooner than later, anyway. You may as well do it locally, where the cost of a screw-up deployment is effectively nil.
You can mount your VM locally by running something like Samba on the VM side, then open stuff normally with TextMate or whatever.
It's a bit slow and has some quirks with huge projects, so I stopped doing it, personally. Mounting with ExpanDrive or MacFuse(SSH) were slower when I tried.
Personally, I just setup an rsync share on the VM, and then run a script on my local machine that rysnc's the project directory just checking timestamps for changes and ignoring all scm folders. It's super quick after the initial sync, since all your usually changing anyway per testing iteration is just a few small text files at a time. Works great for big projects too.
Although nowadays, I'm finding the 'separate VM & host os" for development a bit tedious. Even executing that script to see code changes vs. just saving the file and seeing it right away is a drain on productivity. And doing remote editing put's a noticeable lag to my editing.
Very true. Why not just setup a staging server on the VM and use MAMP and benefit from the quick save and preview. Then sync up to your VM for staging to test your deployment.
This sort of setup is great for working out server configuration kinks during development. To do it right, you need an editor with remote file support and a way to interact with a remote process.
Just about all of the text editors on the Mac that are oriented towards web development have support for automatic sftp/ftp/scp of files to a server, so use that route. The virtualization tools also support sharing folders/directories with OS X, so you could use that path but since the eventual goal is deployment to another server using the sftp option means that going from testing to deployment consists of changing the name of the server you are pushing to.
I'm doing some kernel development at work right now, so I test my code in a virtual machine (VMWare Fusion). I use SSH to both copy files (via SCP) to the VM and run things on it, and automate those actions with a Bash script or Makefile rule.
That way, the only direct interaction I have with the VM is to to click "revert to snapshot" whenever I mess it up.
You could use subversion or git, or if your a man you could cvs or perforce. that last bit was just a joke. Even though you can setup a shared drive between the two, I found that checking out a subversion repo is a lot easier then moving files around.