views:

1084

answers:

12

Recently the buzz of virtualization has reached my workplace where developers trying out virtual machines on their computers. Earlier I've been hearing from several different developers about setting up virtual machine in their desktop computers for sake of keeping their development environments clean.

There are plenty of Virtual Machine software products in the market:

I'm interested to know how you use virtualization effectively in your work. My question is how do you use Virtual Machines for day-to-day development and for what reason?

+5  A: 

Virtualisation (with snapshots or non-persistent disks) is really useful for testing software installation in a known clean configuration (i.e. nothing left over from previous buggy installs of your software).

frankodwyer
+5  A: 

Having your development box on a single file (with a Virtual Machine) will make it much easier to backup and restore if an issue occurs.

Other than that, you can also carry your portable development box around different machines, since you aren't restricted on that single particular machine you usually work on.

Not only that, but you can test on different Operating Systems at once, with a single OS installed on a each Virtual Machine file you have.

Believe me, this will save quite a hassle when doing the jobs I mentioned above.

Andreas Grech
+2  A: 

I used the Virtualization approach using VMWare Server when the task in front of me was to test a clustered environment of WebSphere Application Server. After setting up VMWare Server i created a new virtual machine and did all the software installations that i would need like WebSphere App Server, Oracle, WebSphere Commerce etc, after which i shutdown the VM, and copied over the virtual hard disk image to two different files, one as a clone VM and another as a backup.

Created a new VM and assigned the one of the copied disk images, so i got two systems up and running now which allowed me to test the same scenario of a clustered environment. I took a snapshot of the VM through VMware and if i goofed up with any activities i would revert the changes to the snapshot taken thereby going to the previous state and increasing my productivity instead of having to find out what to reverse. The backup disk image can also be used if i need to revert to a very old state, instead of having to start from scratch.

The snapshot functionality which exists in both VMWare and Microsoft's Virtual PC/Server is good enough to consider Virtualization for scenarios where you think you might do breaking changes, which may not be that easy to revert.

Dinesh Manne
+3  A: 

I use a VM under Windows to run Linux. Even though there's already a version of emacs for windows, using it in Linux just feels more gratifying for some reason.

Jason Baker
You could run CygWin instead... >_>
Spoike
+15  A: 

I just built a real beefy machine at home so that I could run multiple VMs at once. My case is probably extreme though, but here is my logic for doing so.

Testing

When I test, particularly a desktop app, I typically create multiple VMs, one for each platform that my software should run on (Windows 2000/XP/Vista etc). If 32 and 64 bit flavors are available, I also build one of each. I also play with the VM hardware settings (e.g. lots of RAM, little RAM, 1 core, 2 core, etc). I found plenty of little bugs this way, that definitely would have made it into the wild had I not used this approach.

This approach also makes it easy to play with different software scenarios (what happens if the user installing the program doesn't have .NET 3.5 sp1? What happens if he doesn't have XXX component? etc?

Development

When I develop, I have one VM running my database servers (SQL2000/2005/2008). This is for two reasons. First, it is more realistic. In a production environment your app is probably not running on the same box as the db. Why not replicate it when you develop? Also, when I'm not developing (remember this is also my home machine), do I really need to have all of those database services running? Yes, I could turn them on and off manually, but its so much easier to switch a VM on.

Clients

If I want to show a client some web work I've done, I can put just a single VM into the DMZ and he can log into the VM and play with the web project, while the rest of my network/computer is safe.

Compatibility

Vista64 is now my main machine. Any older hardware/software I own will not play nicely with that OS. My solutions is to have Windows XP 32 as a VM for all of those items.

Giovanni Galbo
+1 for well written ideas on how to use VM, I'd give one more for the great idea about database server VM
Spoike
@Giovanni: "I can put just a single VM into the DMZ and he can log into the VM and play with the web project, while the rest of my network/computer is safe." Can you describe how to accomplish that? I would like to be able to give my clients a login to a VM and as you say "the rest of my network/computers are safe".
Optimal Solutions
@Optimal Solutions - I do this through the router. I happen to have a pretty good home router (Dlink DGL-4500), but cheaper ones probably have similar options. The routers lists out all of the machines on the network (physical or virtual) and you can direct port 80 (or whatever) traffic to the particular VM.
Giovanni Galbo
@Giovanni: Ha. Cool. I just purchased the DGL-4100 and it just arrived an hour ago. I havent tried to set it up yet, its still in the box. I wonder if that one is capable of that too. Thanks! I will check into that now that you told me how!
Optimal Solutions
+5  A: 

Another nice use case for VMs is to create a virtual network of machines. For example you can bring up machines running the different tiers of your application stack, each running in its own VM. Think of it as a poor man's datacentre.

These VMs can also appear available on your physical network, so you can use RDP or similar to get a remote terminal session with them.

You can have a beefy machine (lots of memory) running these VMs, while you access them remotely from another machine such as a laptop, or whichever machine you have with the best screen.

frankodwyer
btw, virtual networks has been discussed in this question: http://stackoverflow.com/questions/444901/virtual-network-of-virtual-machines
warren
+2  A: 

From what I know, there is nothing like Parallels on Mac, but rather for work instead of testing.

The integration (with "coherence", your VM is not running "in a window" of your host system, all programs in the guest system have their proper window in the host system) is splendid and let's you fill all (ALL!) gaps:
My coworker has it configured that Outlook (there is nothing like Outlook for MacOsX) in Windows pops up when he clicks on a "mailto:"-link on a web page, browsed with Firefox on Mac !
In the other direction, if he get's send a PDF, he doubleclicks the attachment in Outlook (in Windows) which opens the PDF-File in the Mac-buildin PDF-viewer.

VirtualBox also offers this window-separation possibility (at least when windows is running in the VM on Linux), which is really useful for work.

For testing etc. of course, there is nothing like a cleanly separated environment.

lImbus
VMWare Fusion also has this feature, but alas, it's also OSX only (like Parallels).
R. Bemrose
are you familiar with MS Entourage (http://en.wikipedia.org/wiki/Microsoft_Entourage)? It's the "official" mail client in the Mac Office suite, and fairly similar to Outlook, for what I use either for.
warren
yes, I am, but where is the relation to VM ? :-P
lImbus
+5  A: 

When I started at my current company, most support/dev/PM staff would run Virtual PC with 1-3 VMs on their desktop for testing.

After a few months I put together a proposal and now we use a VMware ESXi server running a pool of virtual machines (all on 24/7) with different environments for our support staff to test customer problems and reproduce issues on. We have VMs of Windows 2000/XP/Vista with each of Office 2000/2002/2003/2007 installed (so that's 12 VMs) plus some more general test VMs, some Server 2003/2008 machines running Citrix, Terminal Services, etc. Basically most of the time when we hit a new customer configuration that we need to debug, and it's likely other customers also have that configuration, I'll setup a VM for it. (eg. We're only using three 64-bit VMs at the moment - mostly it's 32bit)

On top of that the same server runs a XP VM that I use for building installers (InstallShield, WiX) debugging (VS 2005) and localization (Lingobit) as well as a second VM that our developers use for automated testing (TestComplete).

The development and installer VM have been allocated higher priority and are both configured as dual-cpu VMs with 1Gb memory. The remaining VMs have equal priority and 256-1Gb RAM.

Everything runs on a dual-quad-core Xeon with 8Gb of RAM running ESXi and hardware raid (4x1Tb RAID10)

For little more than US$2.5k investment we've improved productivity 10 fold (imagine the downtime while a support lackie installs an older version of office on their desktop to replicate a customer problem, or the time that I can't use my desktop because we're building installers). Next step will be to double the RAM to 16Gb as we add more memory hungry Server 2008 and Vista VMs.

We still have the odd VM on our desktops (I've got localized versions of Windows, Ubuntu and Windows 7 running under VMware Workstation for example) but the commonly/heavily used configurations have been offloaded to a dedicated server that we can all remotely connect into. Much, much easier.

sascha
Excellent example. Thanks for sharing!
Cory House
+7  A: 

Here's something that hasn't been mentioned yet.

Whenever a project enter maintenance mode (aka abandonded), I create a VM with all the tools , libraries, and source code necessary to build the project. That way if I have to come back to it a year later, I won't bet bit in the ass by any upgraded tools or libraries on my workstation.

The idea of creating a VM for a project's development environment sounds great. But I wonder if this shouldn't be a standard practice from the beginning, i.e. create a VM when you start up a project from scratch and distribute it to all who work on the project.
Spoike
I'd make it standard from the beginning in any group I was a part of, but in the event it wasn't, doing it near the end of the project's lifecycle is certainly a Good Thing
warren
+1 brilliant idea
Tony Ennis
+2  A: 

We have a physical server dedicated to hosting virtual machines in our development environment. The virtual machines are brought up and torn down on a regular basis and are used for testing software on known Standard Operating Environments.

It is also really helpful when we want an application to run on a domain that is different to the development environment.

Also, the organisation I am working for are in the planning stage to create a large virtual testing ground. This will be a large grid of machines, sitting on it's own network, and all of the organisations' internal staff, contractors and third-party vendors will be able to stage their software for testing purposes prior to implementing into the production environment. The virtual machines will reflect the physical machines in the production environment.

It sounds great, but everyone's a bit skeptical: This is a Government organisation... Bureaucracy and red-tape will probably turn this into a big waste of time and money.

abrereton
+3  A: 

Maintaining shelved computers

I have the situation where schools in my region are closed down but their finance system has to be maintained for up to 2 years to ensure all outstanding bills are paid. This used to be handled by maintaining the hardware from the mothballed schools which had some problems:

  • This wasted scarce hardware resources and took up a lot of physical space.
  • Finance officers had to be physically present at the hardware to work on each system.

Today I host each mothballed school on its own virtual box inside a single physical host. Each individual system is accessed by rdp on the IP number of the host, but with its own port number and the original security of each school is maintained.

Finance officers can now work on the mothballed schools without having to travel to where they are physically located, there is more physical space in the server room and backup of all the mothballed schools at once is a simple automated process.

With each mothballed school in its own vbox there is no way for cross contamination of data between systems. Many thousands of dollars worth of hardware is also freed up for redeployment.

Virtualisation appears to be the perfect solution to this problem.

this answer was difficult to read so I edited it to break it up to paragraphs, and whaddayaknow: I read a perfectly good use-case scenario to use virtualisation
Spoike
+1  A: 

Hi,

If we are using Virtual machine (vpc 2007,Virtual Server 2005,VMWare application etc..)

1.We can run multiple operating systems(windows98,2000,XP,Vista,Windows Server 2003,2008,Windows 7/linux/solaris) on a single server

2.We can Reduce hardware costs & Data Center Space

3.We can Reduce power & AC cooling cost.

4.We can reduce admin resource,

5.We can reduce Application Cost

6.We can run ADS/DNS/DHCP/Exchange/SQL/Sharepoint Server/File Server...etc

Velmurugan

related questions