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.