| By Kevin Hoffman | Article Rating: |
|
| February 5, 2008 03:45 PM EST | Reads: |
9,332 |
Kevin Hoffman's BlogSo 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.
Published February 5, 2008 Reads 9,332
Copyright © 2008 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
Related Stories
- Why Build Applications for the iPhone and iPod Touch?
- AJAX World's iPhone Developer Summit to Take Place March 18-20, 2008 in New York City
- iPhone Developer Summit Names Kevin Hoffman Conference Tech Chair
- iPhone Developer Summit Offers Priceless Insight in San Jose, California
- iPhone as Biz-Phone - Sybase to Present at AJAXWorld's iPhone Developer Summit
- Web Apps for the iPhone: Duplicating the iPhone Look and Feel in Safari
- iPhone's Early Adopters: The Key to Free Publicity or the Fall of a Technology
- Aptana IDE: Your Unfair Advantage for AJAX, iPhone, Adobe AIR, PHP and Rails Development
- Behind-The-Scenes Look at iPhone & Apple
- How to Display Safari Address Bar on iPhone v1.1.3
- How to Develop Open Source Mobile Messaging and Sync Apps for iPhone vs. Android
- Web Apps for the iPhone: How to Duplicate the iPhone Look and Feel in Safari
- Introduction to the iPhone SDK
- iPhone as Biz-Phone: Enabling iPhone Support for Enterprise Applications
- Social Computing: the iPhone as an Ideal Platform
- Developing AJAX Applications for the iPhone and iPod Touch
More Stories By Kevin Hoffman
Kevin Hoffman, editor-in-chief of SYS-CON's iPhone Developer's Journal, has been programming since he was 10 and has written everything from DOS shareware to n-tier, enterprise web applications in VB, C++, Delphi, and C. Hoffman is coauthor of Professional .NET Framework (Wrox Press) and co-author with Robert Foster of Microsoft SharePoint 2007 Development Unleashed. He authors The .NET Addict's Blog at .NET Developer's Journal.
- Kindle 2 vs Nook
- Installing Geneva Beta 2 on Windows 7
- Binary Serialization and Azure Web Applications
- Get Your Red Hot VS2010 Beta 2
- Templated Helpers in ASP.NET MVC 2 (VS2010 Beta 2 Version)
- LINQ to SQL and Entity Framework on top of SQL Azure
- Working with Table Storage on the Windows Azure
- ADO.NET Data Services Projections Makes Sliced Bread Jealous
- Creating and Manipulating Your SQL Azure Database
- Setting up an ASP.NET MVC 2 Application for Windows Azure
- Breaking Changes for .NET Services in Azure
- Windows Identity Foundation (WIF) Release Candidate Is Out
- Kindle 2 vs Nook
- The Difference Between Web Hosting and Cloud Computing
- ASP.NET Membership Provider in the Cloud
- Binary Serialization and Azure Web Applications
- Installing Geneva Beta 2 on Windows 7
- Get Your Red Hot VS2010 Beta 2
- Templated Helpers in ASP.NET MVC 2 (VS2010 Beta 2 Version)
- LINQ to SQL and Entity Framework on top of SQL Azure
- Using ASP.NET MVC Action Filters to Declare Reference Data for Views
- Creating Correlated Workflow Services in WF4 / .NET4 : Part 1
- Working with Table Storage on the Windows Azure
- ADO.NET Data Services Projections Makes Sliced Bread Jealous
- Want to Learn How to Write iPhone Applications?
- iPhone Will Make Mobile AJAX and Web 2.0 Happen
- Will Silverlight Be DOA?
- Why Build Applications for the iPhone and iPod Touch?
- Silverlight 2 - Adobe Flex Killer Is on Its Way!
- Why Is iPhone Better? Here's My Story...
- Silverlight and Astoria - First Impressions
- iPhone Developer Summit 2008 East
- Is the Silverlight Adoption Rate Artificially Inflated?
- iPhone with High-Speed G3 Support at Macworld
- Will Google's Android Sink or Swim?
- iPhone Price Cut? Here is My Objective View on This!

























