Showing posts with label virtual machines. Show all posts
Showing posts with label virtual machines. Show all posts

Monday, December 13, 2010

Developing for Windows Phone 7 in a virtual machine

According to Microsoft, installing the windows phone developer tools into a virtual machine is not supported. This is because the phone emulator is itself a virtual machine and, as Inception has shown, running a virtual machine inside a virtual machine gets really slow. The emulator also requires DirectX 10 for XNA develoment, and current virtual machines only offer DirectX9.

However I do all my development in virtual machines. I already have a VM setup with VS2010, version control, database etc. I don't fancy setting that up all over again just for a phone, particularly one that I only have for 2 weeks.

Time to do some testing...

Virtual PC
Running the dev tools in a Windows 7 Virtual PC works (or rather fails to work) as advertised. While I could create and compile a phone project, I couldn't actually run it in the emulator.

VMWare
Using a VMware vm was much better. I could compile and run a silverlight project on the emulator. On my laptop, the emulator performance was dire. On my desktop however, emulator performance was adequate but not stunning.

On either machine, XNA projects wouldn't run on the emulator due to the lack of DirectX 10. They would compile but trying to deploy would fail with "The current display adapter does not meet the emulator requirements to run XNA Framework applications."

However deploying and running on a real phone worked fine. Both Silverlight and XNA deployed and ran without any issues.

Booting from a virtual hard drive (thanks Paul)
Should work but requires Windows 7. See here.

TL;DR
You can develop Silverlight applications in a VMWare virtual machine, testing against the emulator (slow) or actual hardware (fast). You can develop XNA applications in a VMWare vm but you need to deploy to actual hardware.

Useful links
Microsoft's free tools: Create App hub
Charles Petzold giant ebook: Programming Windows Phone 7
Reddit Win Phone 7 section: http://www.reddit.com/r/wp7dev/

Saturday, February 13, 2010

Solving a mid-life crisis with a Solid State Drive

My development laptop is now 18 months old, which makes it older than me in computer years. As part of a mid-life refresh, I replaced the boot drive, (250gb 7200rpm) with an Intel X25M 160gb ssd.

The result of this is that things are much snappier. How much snappier? I timed a few things of importance to me, booting my laptop and virtual machines, starting delphi and rebuilding a medium sized project (600,000 loc).

Overall, using an ssd cut the times by an average of 39%. Not too bad an improvement. To put it another way, my "getting started" time (boot laptop, boot vm, start delphi) went from 6:05 to 3:37.




Edit:
The Delphi 2007 install is screwed up somewhere. It certainly never used to take 3 minutes to start up:( but sometime last year it started getting really slow. I don't use that install or vm much so I haven't bothered trying to sort it out.

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.

Friday, July 10, 2009

Windows Performance Index - VMware workstation v Virtual Box

Virtual Box 3 has been released. I haven't used previous versions of VB, but it has a good rep. Version 3 now supports 3d acceleration. I have been wanting to use Aero and Glass in my virtual machines so that I could develop Vista specific applications so I gave it a try.

First the bad news, VB doesn't support enough 3d features to run Aero (neither does VMware). I did discover a work around though, connect to your virtual machine using Remote Desktop Connection from a Vista machine, turn all graphics options to high and volia.

While I had VB installed, I did a quick and dirty comparision with VMware workstation using Windows Performance Index. Take these results with a grain of salt, I didn't spend much time playing with the setup and tweaking. I couldn't get dual core to work on VB, it just blue-screened, and I didn't have the time to spend sorting it out.

Windows Performance Index

Host VMware
Single proc
VMware
Dual proc
Virtual Box
Single Proc
Processor 5.4 4.4 5.2 4.4
Memory 5.1 4.9 5.2 5.9
Primary Hard disk 5.4 5.3 5.4 4.7

The memory figures are surprising, I am not sure if the VB figures of 5.9 are real or just a sign of something wrong somewhere. Draw your own conclusions on that.

VB is slower in hard drive, but otherwise up with the play processor wise. Getting dual core working would probably give similar processor figures to VMware dual core.

I was impressed with how well VMware matches up to the host system. While VB doesn't seem to be quite there yet, it is still doing pretty well, and you can't beat the price.