Friday, August 28, 2009

When you install Delphi 2010, put it in a virtual machine

I recently compared the performance of virtual machines with the real hardware. The figures were suprisingly good.

Shortly after that, disaster struck. My laptop wouldn't turn on. It took Dell 2 weeks to fix, replacing the motherboard and the video card.

If I had delphi installed directly, I would have had 2 weeks of very limited productivity. As it was, I ripped the hard drive out, stuck it in a usb caddy and continued working on another machine. I was back up to speed the next day.
Edit: It didn't take a full day to get productive again, I did other work until it became apparent that it would be a while before my computer was fixed. It only took about 30 minutes to transfer the data over and get going.

If it had been a hard drive problem, I would have restored the latest vm backup off a dvd, pulled the latest changes from the version control or the source backup and been back up to speed with limited data loss.

I get a new laptop next month. Installing delphi is going to be as easy as installing vmware and copying the vm files over. 30 minutes work, most of which is surfing the internet waiting for the files to copy. The last time I actually had to install Delphi, it took hours.

There are other advantages as well, my development backups fit on a single dual layer dvd, I get to run and test on multiple OSs and disaster recovery plan is much shorter.

So make Delphi 2010 your starting point. Download Virtual Box, VMWare Workstation ($$$) or Virtual PC and use that for development. If you are running Windows 7, you could look into Windows XP Mode and use that.

14 comments:

Daniel Grillo said...

Very good tip!!! Thank you

Jarrod said...

No need for $$$ with VMWare - just use VMWare server. It's free.

Lachlan said...

VMWare Workstation is well worth the money (which isn't all that much). Features like snapshots and cloning revolutionise the way you work.

VMWare Server really isn't up to scratch for use as a development environment.

Anonymous said...

Yeasterday afternoon i just did that, install Radstudio 2010 Pro in a Virtual Box. I used a plain windows XP SP 2, but this did not go well. After endless installation various things, which are not all on the Delphi DVD ISO it failed to start. I got only the start splash rectagle and after 30 second or so Windows had to terminate the programm. The installer repair funktion did solve the problem.

This time this seems to be tricky to accomplish as any previous version before.

Paul said...

I've been using VMWare Workstation with D2007 for a year or two now. Definately the way to go for development.

It's also good for VPN connections - you keep your host environment clean and pollute your VM's with client specific VPN software.

Speedwise. Yes, it's a little slower, but not so much as to move us back to a host development environment.

If you can afford it, a real beast of a host machine is the way forward, that way you can comfortably run several VM's at once. No need for test machines, more power etc...

vicente said...

I have a Mac with Os x 10.5. Mac has a virtual machine, Parallels 4.0.
I install with windows vista and runs with delphi 2007 very, very, very well. Sometime ago i used virtual box but parallels 4.0 is faster than others.

Sean said...

I use VMWare workstation myself. I haven't tried using Server to create VMs but Workstation is pretty good.

@Anon. I haven't tried D2010 in a windows xp vm but I have both D2007 and D2009 in XP. For D2010 I went with a Win 7 VM and it works fine, but takes up more disk space.

Fletch said...

I use VmWare Fusion on my Mac OS X and it runs very well.
Currently I am running Windows 7 and RAD 2010. No complaints here.

Xepol said...

What took a full day? I can be back up to speed in the time it takes to move the image files and install (if required) the virtual app software.

I think my worst time was an hour (copying files to a portable drive first). Moving the drive physically? 5 minutes tops - IF I have to install the software first.

Sean said...

@Xepol

I didn't take a full day to do, I do other things than programming so I left it for the day and got another laptop to use. Once it became apparent that it would take a while to fix, I copied the vm's over. It took more than 5 mins though, closer to 30.

Anonymous said...

I really dislike VMs but for test environments or the like. Booting one OS is enough. Having to boot two is too much. Most Vms software give you simulated hardware, so your fancy nVidia graphic card it's not used too much inside the VM. Virtual PC can't see USB devices, and can't resize virtual disks. Anyway, just resources wasted - and there's always the licenses issue.
It is true that disaster recovery is faster on a different machine.
That's why I don't use a laptop to work (I have a Dell workstation, RAID 1 disks and on-site support), and the laptop is just to work off-site, and a backup solution. Code is simply kept in sync using CVS.

Sean said...

@Anon2
VMWare can see usb drivers, and can resize virtual disks. Granted it can't use my video card to it's full extent but that's not much of a problem for me writing business apps.

Robsoft said...

I've been doing this for a long time, now, ever since I switched to a Mac and discovered how portable my development 'machine' could become.

I can make a copy of it, upgrade the third party components etc for one project without affecting a legacy project (etc). I've gone from having 2 machines, each with a Delphi, each responsible for several projects for different clients, to a VM per client, each Delphi (and third party components) safely protected against 'contamination' from other projects.

The whole 'snapshot' thing starts to change your approach to testing too - I have a couple of test VMs which I can duplicate and snapshot at will; remember testing a complicated installer in the past? I have no idea where we got all the time & patience from!

I use VMware Fusion on the Mac, but have also used Workstation on the PC and successfully taken my Mac VMs over to someone else's PC, used them for a few days, then brought them back to the Mac. It works much better than it probably has any right to!

Scott Lynn said...

I have been programming off of VMs in Delphi for maybe 4 years and I love it. I just setup Delphi XE6 on a brand new Win7 VM using VMWare Player, which is one of their free products. I test off of other VMs as well. The backup options and portability are fantastic. And keeping a "clean" development environment is much easier. Since making the move to VMs for development, I have upgraded machines three times (one an almost catastrophic hard drive crash) and I can restore my development environment almost as fast as I can get my favorite web browser installed and configured. I highly encourage this approach.