The World’s Leading Microsoft .NET Magazine
   
 
The .NET Addict's Blog

My Top Tags

                                                           

My RSS Feeds








Latest Diggs - Programming

Internet Blogs - Blog Top Sites

Site Hits

Total: 2,502,482
since: 19 Jan 2005

iPhone Web Development: ASP.NET inside VMware Fusion on a Mac

posted Fri 01 Feb 08

So here's my precarious situation: I'm writing some sample web applications for the iPhone. Every once in a while, I poke around using Ruby on Rails, but by and large my web development lately has consisted entirely of the ASP.NET MVC framework CTP. I also don't own a PC anymore - I own a Macbook Pro and an iMac. So, what's an ASP.NET developer to do?

VMware Fusion of course. The problem is that I've been pulling out my few remaining hairs trying to figure out how I can point my iPhone at my Windows Vista IIS residing inside a VMware Fusion Virtual Machine. For the longest time, I couldn't ping the VM from my host Leopard environment, and I couldn't ping the Leopard machine from the VM, so I thought I was dealing with a VMware problem. Turns out it was a little bit of both, and you need to configure both things properly.

Configuring VMware Fusion for IIS-related activities

First set the networking mode on the VM to "Bridged". Since both the VM and the host machine are connected to the same IP-supplier (if you're using DHCP like an in-home router), they will both have the same gateway (which is ridiculously important...if they don't have the same gateway you need a RIP-enabled router to forward packets...blick on that).

When this is working, you'll probably end up with a router/gateway IP address of 192.168.1.1 (though some routers prefer to use the 10.* local network, but it's far less common). In my case, my Windows Vista virtual machine had an IP address of 192.168.1.11 and my host Leopard OS had an IP address of 192.168.1.8, and the iPhone has an IP of 192.168.1.6. 

Configuring Windows Vista inside a VMware Fusion VM for IIS-related activities

Here's where the fun starts. You will have to do the following in order, because if you don't Windows Firewall will turn itself back on and you'll have to add another extra step of shutting the Firewall off again.

1. Turn on some or all of the sharing features like public folder sharing, printer sharing, media sharing, etc. You need a couple of these on to make the Windows Vista machine pingable. Without these on, it will not respond to pings.

2. Turn off Windows Firewall. You might've turned it off before, but check again. Just to be sure, uncheck the checkbox next to the "Local Area Network" connection that indicates the firewall is protecting that connection.

3. You should now be able to ping the host Mac from the VM

4. You should be able to ping the VM from the host Mac

Finally, as a test, hit the IP of your Vista machine from Safari inside Leopard and you should end up with the IIS7 welcome screen below:

It really should not be this difficult to get working, but between the complexity of bridged VMware networking and the zealousness with which Windows Vista protects its innards, it can be daunting.

With all of this infrastructure in place you can now use the file-based ASP.NET MVC project and test it locally within your VM using the Cassini internal VS2008 web server. When you're ready to test the iPhone GUI, layout, and responsiveness on a real phone rather than using Safari for Windows as your test environment, just publish your project to IIS and you can hit it from your iPhone.

The frustration involved in getting this to work properly was almost enough to get me to switch to a different web development environment... almost. :) Hopefully this blog post makes your setup easy if you have a similar environment.

tags:              

links: digg this    del.icio.us    technorati    reddit




1. Edward J. Stembler left...
Fri 01 Feb 08 3:17 pm :: http://www.ejstembler.com

Awesome! Thanks for sharing this.

I have a similar setup with my MBP. Though, I still have one remaining Vista box I'm planning on re–incarnating as a web server later.

The ASP.NET MVC is nice. However, I'm eagerly waiting for them to figure out sub–views and validation before I adopt it full–force. Also, it will be nice to use IronPython or IronRuby with the MVC framework someday...


2. Kevin Hoffman left...
Fri 01 Feb 08 3:29 pm

Stay tuned to MIX '08. Scott Guthrie has said that they're going to be dropping another CTP of the MVC stuff that should fill in some of the gaps they've identified in the preliminary bits. I'm hoping for some improved Ajax support. Controls work fine for me so I don't need sub-views yet, but then I haven't tried out a lot of different scenarios. I've got a lot of validation working, but it's fairly manual at the moment. The "Flash" (TempData) dictionary works well for delivering validation failure messages.


3. David Orriss Jr left...
Tue 05 Feb 08 2:14 pm :: http://www.codethought.com/blog

I'm not *quite* like you. I use a Mac.. but I don't develop .NET stuff.. ;)


4. David Orriss Jr left...
Wed 06 Feb 08 2:47 am :: http://www.codethought.com/blog

Kevin, I can't recall seeing any posts about this in your blog.. so I'll ask.. I know you're using VMWare.. but did you ever try Parallels? What was your experience there?


5. Kevin Hoffman left...
Wed 06 Feb 08 8:10 am

I have tried parallels a few times during beta and then I believe I spent a little bit of time with the retail copy. I don't have anything against Paralells per se, but I have so many other VMware workstation images lying around from work and on other machines that it made perfect sense for me to use Fusion, since it can work with existing VMware workstation files (provided they are using 2GB files.. I had trouble with a single 18GB disk image file..)

I would assume that you can achieve the same level of networking ability with Parallels that you can with VMware Fusion, though don't quote me on that. I've had a lot of really good experiences with VMware's networkin support inside VMs and that was a pretty big key requirement for me.


6. David Orriss Jr left...
Sat 09 Feb 08 8:30 pm :: http://www.codethought.com/blog

I hear ya. That's actually an excellent point about Fusion. I pulled a VMWare machine that was built with VMWare for Windows... shuffled things into a folder .vmwarevm extension and I was off and running. That's very slick. For me I've just found that for Windows, Parallels and coherence just seems to work *better*... Unity on VMWare just still seems a little rough around the edges (for lack of a less cliche term).


Tag Related Posts

MobileMe vs. Live Mesh Throwdown - Round 1

Wed 16 Jul 08 10:33 A GMT-05

Building Model Classes in C# and Cocoa

Sun 15 Jun 08 3:13 P GMT-05
tags:            

MobileMe vs. Live Mesh - Round 1

Wed 11 Jun 08 12:20 A GMT-05

NYC SharePoint Developer Needed

Mon 12 May 08 12:09 P GMT-05

My Macbook Air is masculine, dammit!

Mon 17 Mar 08 6:59 P GMT-05
tags:          

iPhone Developer Summit

Sun 16 Mar 08 8:39 P GMT-05

iPhone Underrated as a Gaming Device?

Fri 14 Mar 08 1:50 P GMT-05
tags:        

My take on the iPhone SDK

Sat 08 Mar 08 1:39 P GMT-05

Jobs says "not likely" to Flash on the iPhone

Thu 06 Mar 08 1:39 A GMT-05
tags:          

My Macbook Air Review

Sun 02 Mar 08 4:20 P GMT-05

iPhone Roadmap March 6th

Fri 29 Feb 08 10:41 P GMT-05
tags:        

Video of the Macbook Air in Action

Wed 20 Feb 08 3:04 P GMT-05

Macbook Airはきれいですよ!

Sun 17 Feb 08 2:38 A GMT-05

Scott Guthrie Updates the ASP.NET MVC Roadmap

Wed 13 Feb 08 3:49 P GMT-05
tags:    

Why is O'Reilly Condoning iPhone Hacking?

Mon 11 Feb 08 3:55 P GMT-05

Evaluating my next laptop purchase

Wed 06 Feb 08 8:40 P GMT-05

Volta is to Ajax what Tums is to my Stomach

Wed 30 Jan 08 4:11 P GMT-05

The iPhone SDK key has been leaked! Oh Noez!!!1

Tue 29 Jan 08 11:36 A GMT-05
tags:        

Why Geeks just don't "get" the Macbook Air

Thu 17 Jan 08 2:30 P GMT-05

Popcorn + TiVo + Macbook Pro + iPhone == Hell Yeah!

Tue 15 Jan 08 3:11 P GMT-05
tags:          

How my ADC membership changed my life

Mon 31 Dec 07 3:57 P GMT-05
tags:      

ASP.NET 3.5 Extensions Preview Released

Mon 10 Dec 07 2:10 P GMT-05

Leopard Code Sample : Sprinkling in some Bonjour

Tue 27 Nov 07 2:32 P GMT-05
tags:        

Celebrity Death Match: iPhone vs. gPhone

Tue 06 Nov 07 1:52 A GMT-05
tags:    

Leopard Sample: A Bound NSCollectionView

Mon 29 Oct 07 1:41 A GMT-05

Leopard is out - let the code samples begin!

Fri 26 Oct 07 10:09 A GMT-05
tags:          

My life is complete : iPhone SDK is CONFIRMED.

Wed 17 Oct 07 6:38 P GMT-05
tags:          

Leopard Shipping October 26th!!

Tue 16 Oct 07 4:59 P GMT-05
tags:        

Microsoft unveils an MVC framework for ASP.NET

Mon 08 Oct 07 12:58 P GMT-05
tags:      

Editorial : My thoughts on iPhone Hacking

Tue 25 Sep 07 6:10 P GMT-05
tags:      

$4800 iPhone Bill for International Data Roaming

Mon 10 Sep 07 1:15 P GMT-05
tags:    

iPhone Apps are now also iPod Touch Apps

Sat 08 Sep 07 7:33 P GMT-05
tags:    

Using the iPhone Keyboard

Fri 31 Aug 07 2:08 P GMT-05
tags:      

Meebo on my iPhone - a useable IM client!

Tue 24 Jul 07 2:56 P GMT-05
tags:    

My iPhone Review

Mon 23 Jul 07 1:09 P GMT-05
tags:        

Wil Shipley Discusses the lack of iPhone SDK

Mon 09 Jul 07 1:50 P GMT-05
tags:    

OMFGWTF iPhonez0rz!!1!one!!

Fri 29 Jun 07 5:45 P GMT-05
tags:  

Microsoft Codename Acropolis - Unwrapped

Wed 20 Jun 07 3:22 P GMT-05
tags:              

My Appearance in the RIA Shootout on sys-con.tv

Tue 05 Jun 07 11:41 A GMT-05
tags:              

Exploring the Delegate Design Pattern

Mon 14 May 07 6:30 P GMT-05

Installing Orcas Beta 1 - VMware Style

Mon 23 Apr 07 12:16 P GMT-05

Core Data - Almost too Easy?

Wed 18 Apr 07 2:23 P GMT-05

Will Silverlight be DOA?

Mon 16 Apr 07 8:02 P GMT-05