Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a mac and until now I've installed my dev environment directly on the host OS. I would like to give a shot to virtualized dev environment.

I don't have the time to learn how to setup a 'reproductible' dev env (e.g. using Vagrant), so I'll go with a VMWare VM with ubuntu inside, and I'll manually install the dependencies. My first question: is this a bad practice? (Should I go with a scripted install instead?)

Second question: what are the good practices about editing source files in the VM? In a perfect world, I would like to edit them using a native client, from the host OS. Can I share the partition between host and VM easily?

share|improve this question
up vote 1 down vote accepted

It's not a bad practice to have a VM installed on your development machine and install all the dependencies you need by hand. I have a setup like this myself as well. My development machines are Windows machines, while my servers are all Linux. To avoid big differences between your development environment and the production environment, you can use a VM solution to reproduce the environment in which you intend to run the application. It would be no good if everything works on your mac, only to discover it breaks when you want to deploy it. Nobody has any benefit from that. Also, by using a VM you can make sure that you have all the modules and same versions installed as you have on your production environment, without breaking anything on your host OS.

As for your second question, you can use native clients on the machine, like by using the console (or even SSH'ing to the box) and then use tools like vim or nano to edit your files. Although, you can also use somthing like nfs and mount the drive of your development VM in your local machine. In my setup, I also use nfs and samba and I have mounted my DocumentRoot directory as a network disk on my Windows machine, so I can easily access the files. That way, you can also use an editor on your host machine to alter the files on your development environment. Just make sure that your editor recognizes and keeps the used line endings (breaks). But as far as I know Mac OS and Ubutu both use "Unix" type line breaks, so that shouldn't be an issue.

share|improve this answer

If you're going to have only one development environment then it's fine to manually install everything. You can copy guest machines later, if you need more. I did just like that for myself. OS X host with debian guest.

I mounted my source repository directories on host system to guest with VMware shared folders. I think this is the fastest way to access from both system to source. Much faster than any other alternatives.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .