Tuesday, February 26, 2013

So that's what the Host-Only Adapter is used for! (Windows Phone SDK VM challenge)

Preparing for a talk this Saturday at Grand Rapids DevDays, I wanted to demo the new capabilities for mobile development with SharePoint 2013.  The Visual Studio tooling (alas, sorry MS people, but I have one of those fruit company phones and I like it!) has a good story for Windows Phone, but for the rest of us?  Another story - white paper forthcoming.

For Windows Phone development, here's the big kicker: can't use that Phone emulator virtualized.  Nope, nada, nil, ixnay, no can do.  The Windows 8 SDK requires hardware virtualization with SLAT support - great on physical iron but not virtual iron, so that's right out.  With the Phone 7.1 SDK, same issue - first there's a big warning about not having a compatible GPU, then the phone emulator would continuously reboot to the OS and my app never came up.

So...this gets us to the point of this post, what's a virtualization developer to do?  Ever notice in VirtualBox you have a bunch of choices for networking?


I've been using VirtualBox since I needed x64 support & Virtual-PC just couldn't do it...I've used NAT, Bridged, Internal Network...but Host-only adapter?  What the heck is that for?  Out of the box it has an IP address of 192.168.1.56, what good is that?

Well, turns out this is your way in from the host to your guest internal network.  I assigned an IP in the range of my guests, assigned the guest DNS and default router, changed the VM's to use Host-only Adapter instead of Internal Network, and look at that, I'm in!  The host is not part of my domain but no worries, I need to use Forms Based Authentication anyway for my mobile testing, so we're good to go.

The only other change is to add in entries to the Hosts file on the host for the DNS entries you'll need.  I wasn't able to resolve the hosts values otherwise, and no farm in it.

I'm installing the SDK 8.0 now on my Windows 8 VM with Visual Studio 2012...got a feeling this will work, I'll let you know.

Update: Strike One.  SDK 8.0 enables Hyper-V.  Not a good thing for running VirtualBox VMs.  And there can be only one hypervisor - if Hyper-V is enabled then VirtualBox can't run.  Uninstalling SDK 8.0 and VS 2012, going back to VS2010 and let's hope SDK 7.1 behaves better.

Update: Strike Two and probably three...the good news is I can start up Visual Studio 2010, connect to my SharePoint guest VMs, get list data, prepare my app, but then when I start up the emulator - wham!  There go the VMs.  Seems the VS2010 Windows Phone Emulator is also using the same virtualization VirtualBox needs, and so it knocks out my VirtualBox VMs.  I guess the answer will be to go to Hyper-V with the SDK 8.0 version, but I won't get to that til next week.  Oh well!

No comments: