Windows 8: Making VirtualBox and Hyper-V Play Nice
Windows 8: Making VirtualBox and Hyper-V Play Nice
Join the DZone community and get the full member experience.Join For Free
I got a new shiny this week (actually arrived on Friday, but since I was heading to Roanoke Code Camp over the weekend, I did not have time to set it up before I left). As an aside, pictures don't do this machine justice…I've always thought that ThinkPad was synonymous with chunky business laptops with squared edges, and a look only a CPA could love (sorry CPAs, not offense meant). The Lenovo X1 Carbon Touch is flat gorgeous. And fast.
After getting home from the code camp, I started the process of migrating data from my current day-to-day machine (thankfully, data migration is pretty automated and painless these days), and installing the various bits and pieces I need to use my
As part of setting up the machine, I was testing a variety of ways to get students and pro devs up and running quickly for building their apps for theWindows Store. Among these was testing how quickly I could get a developer VM up and running on VirtualBox, which is one of the solutions that I linked to in my post over the weekend on getting ready for game development.
When I walked through the process of building a VM using the 90-day eval version of Windows 8 Enterprise, not including download time, it took approximately 40 minutes to go from creating the VM to having a running Windows Store app inside the VM on Visual Studio 2012 Express for Windows 8.
So far, so good.
Sharing is Caring, but VM Managers Don't Like to Share
Yesterday, while running an app lab / hackathon at UMBC, I also installed Visual Studio 2012 Express for Windows Phone, to support exporting games from Construct 2, which was the focus of the app lab, to Windows Phone 8. For those who haven't used it yet, the new version of the Windows Phone emulator uses Hyper-V to virtualize the underlying Windows Phone OS for debugging purposes, so during the install Hyper-V was activated.
The trouble came when trying to boot to the virtual machine I'd created in VirtualBox, as the VM kept crashing on me during boot. Hmm.
Thankfully, after a quick Bing search, I found a blog post with a pretty straightforward explanation and workaround. The short version…both VirtualBox and Hyper-V want to have exclusive control of the hypervisor that enables virtualization at the hardware level. The solution is to create a boot profile that tells Hyper-V not to grab control of the hypervisor. The instructions (basically takes two commands at the command line…pretty easy) are in the post above, and worked great for allowing me to work with both Hyper-V and VirtualBox on the same machine.
Managing Virtual Switches
Another small issue I ran into, possibly because of the aforementioned issues, was that I got an error the first time I tried to run the Windows Phone emulator, "Something happened while creating a switch: Xde couldn’t find an IPv4 address for the host machine."
Again, Bing came to the rescue, pointing me to this post, which suggested ensuring that only one Virtual Switch was configured for Hyper-V, with the switch configured for Internal connection only. Worked for me, and all my virtualization environments are now happy and healthy.
UPDATE: Turns out, there's another issue you might run into (I did), where another virtualization software may enable a driver that interferes with the Windows Phone emulator's virtual network. This thread on the Windows Phone Developer forum, has the details. The short version is if you're having networking issues with the emulator including the error message above, right-click the adapter labeled vEthernet with "Windows Phone" and Internal also in the adapter name, and select Properties. Check to make sure that only the following items are checked:
- Client for Microsoft Networks
- QoS Packet Scheduler
- File and Printer Sharing for Microsoft Networks
- Microsoft LLDP Protocol Driver
- Link-Layer Topology Discovery Mapper I/O Driver
- Link-Layer Topology Discovery Responder
- Internet Protocol Version 6 (TCP/IPv6)
- Internet Protocol Version 4 (TCP/IPv4)
Uncheck any others, and click OK. Then try the emulator again. This resolved the issue for me when it cropped up again.
There are several conclusions I draw from this experience:
- I can't believe I waited this long to get a Lenovo laptop. The X1 Carbon Touch is a really nice machine, and so far (after a couple of days), my only real gripe is that the position of the left Ctrl key and the Fn key are reversed from my HP Elitebook, so I'm still trying to get used to the position of those keys (I'm an avid user of Ctrl for copy/paste and for skipping around in text quickly).
- It is SO much easier to transfer my day-to-day work environment from one machine to another than it has ever been. I copied my data from my old laptop to the new one (we have an internal tool for those, but you can easily do it with the Windows Easy Transfer tool), joined the machine to appropriate domain, logged in with my domain account, and then associated my Microsoft account with my domain account, which automatically pulled all of my roaming settings (including my preferred Start screen background) to the new machine.
- Thanks to SkyDrive, SkyDrive Pro, and DropBox, a good deal of the data I care about doesn't need to be moved. Rather, I can simply install the appropriate client software for each service, and let them sync at their leisure. The cloud has both plusses and minuses, but in terms of being productive quickly on a new machine, it's a big win.
- Thanks to a neat utility, Windows Live Writer Backup, I'm now blogging on the new machine, without having to manually reconfigure access to my blog, download plugins, etc. I just installed the current version of Windows Live Writer, ran Windows Live Writer Backup, and restored from a saved backup from my old machine.
- The X1 Carbon Touch is, so far, an ideal machine for my needs. It's powerful enough to replace my HP Elitebook, which was my go-to development machine (but REALLY heavy), almost as thin and light as my Samsung Series 9 (but with a higher-resolution screen that supports multi-touch), and with a 240GB SSD, I get both super-fast disk access AND enough room that I'm not likely to run out of space with a single drive. Between this for development, and the Surface RT for testing on ARM and light note-taking, I'll be able to whittle down the number of machines in my life, in a very good way. And did I mention this is a great-looking machine?
Published at DZone with permission of G. Andrew Duthie , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.