Programming under virtual machine - pros and cons
I'm an Ubuntu Linux user and I use Win XP only for my work purposes.
Lately I set up a virtual machine with XP + Visual Studio 2008 (powere开发者_运维问答d by kvm-quemu).
My questions are:
Have anyone tried to work efficiently under environment set on VM? Are there any performance issues? For example, does slightly worse performance under VM affects your normal efficiency?
Are there any other (beside performance) negative aspects of developing software under VM? Are there any problems that I would not be unable to detect/solve in such environment? (we are talking about developing some sort of bigger project, creating an application for Win environment, no hardware related or embedded stuff).
I do all of my client work in VMs and a great deal of my hobby work on VMs. The host operating system is Windows 7 and unless my client has a different preference, I use the very excellent VirtualBox.
I have a moderately powerful laptop that supports hardware virtualization, and whether I am running Linux or Windows XP as the guest O/S, performance does not seem to be a limiting factor for me at all. One essential technique for preventing a performance hit is having the virtual machine's disk on a different spindle than my computers main hardrive. I use an external USB 2 hard drive. Works great.
To me, the advantage of being able to configure my development environment in very specific ways for very specific projects is invaluable. It greatly reduces the uncertainties that are introduced by having multiple versions of programming languages, libraries and operating system features to support multiple projects. I am very rarely surprised by obscure bugs that are caused by unexpected interactions of components that bleed from one project to another.
The two most annoying things when using a development environment under a virtual machine
your virtual machine get's only a fraction of your host system's main memory
if you have to reboot your host, you will have to wait for the host and for the virtual machine to restart
Another issue may be when your application needs some special drivers, for example, a license key driver. We made the experience that not every VM vendor can deal with that (for us, VMWare was fine, every other vendor we tried did not work).
My shop develops SharePoint solutions. Our development environment on virtual machines. Other then the performance hit (which isn't that bad--we have really fast machines) and the tremendous use of disk space, we see no ill effects.
We really like it, the pro's easily outweigh con's: we can reboot our environment quicker, we can easily backup a virtual hdd, we can quickly switch VM's and test on a different OS, if we crash the "machine" we are quickly back up and running without damaging our host OS
I´m a Win7 user, but my company (I work remotely) uses Windows XP and all machines that are inside the company´s network (even through VPN) need to have a set of applications that I don´t want to install on my notebook so I created an VM with VMWarePlayer and it´s doing a pretty decent job. It´s not like the real one but the pros compensate de cons.
Pros:
- I don´t need to install trash software on my machine
- I don´t have to use the company´s internet so I´m not under it´s control policy
- I can install whatever software I want into the host since I´m admin of it
Cons:
- The performance is a little bit worse than it could be if it I wasn´t using the VM
I regularly develop and test using development environments running under VMWare Workstation and VirtualBox. If you have a fairly beefy workstation, you shouldn't see too much performance hit. The only time I've had problems is when I have run many (5+) instances of Visual Studio in a VM or more than two or three VMs on the same system.
There's a fairly good argument to being able to snapshot, restore, and redeploy your development environment at will, although in practice other tools you may need can limit this -source control settings for example.
Performance issues are machine independent. Heck, I have issues at times working with VS/Windows on metal when the machines I am working with are bogged down either due to low specs or corporate clutter (crap your company installs for you.)
Your biggest issues are going to be on disk and on memory. So give the VM as much memory as you can and if possible let it run on a real hard drive instead of virtual IO.
精彩评论