Software solutions for a mobile world

If you have read my blogs in the past, you will know I am a big fan of virtual machines for different development environments. I have several VM's with different development environments for Windows Mobile, VB6 (honest), and several other configurations.

Windows 8.1 and Windows Phone 8 development threw all this into confusion. This is because the emulator for Windows Phone 8 uses a virtual Hyper-V machine for its emulators. It is also not possible to run VMWare when your Windows 8.1 machine is set up for Hyper-V. 

So - why not just convert my VM machines to Hyper-V systems, and continue developing under Hyper-V? The problem is that Hyper-V virtual machines do not have USB support, and Windows Mobile devices need a USB connection. I could have worked on the emulators, but that isn't real life, as we all know. 

A rock and a hard place. After various bits of research, I discovered I could use bcdedit and turn Hyper-V on and off, and reboot. So I had 2 batch files - HypervOn.bat and HypervOff.bat.

HypervOn.bat is:-

cd c:\
bcdedit /set {current} hypervisorlaunchtype auto
@Echo Off
SET /P ANSWER=Do you want to reboot now (Y/N)?
if /i {%ANSWER%}=={y} (goto :yes)
if /i {%ANSWER%}=={Y} (goto :yes)
goto :no
:yes
shutdown -r
:no exit

HypervOff.bat is:-

cd c:\
bcdedit /set {current} hypervisorlaunchtype off 
@Echo Off 
SET /P ANSWER=Do you want to reboot now (Y/N)? 
if /i {%ANSWER%}=={y} (goto :yes) 
if /i {%ANSWER%}=={Y} (goto :yes) 
goto :no 
:yes 
shutdown -r 
:no exit

Using this method, I could do HypervOff, reboot my system, and then run VMWare to run my various VM's - not ideal, but a solution. It also meant I needed to reboot again to do any Windows Phone development. 

I worked with this for a while, getting increasingly frustrated. One of my fellow MVP's, Alberto Silva pointed me at a product I had looked at in the past - USB Redirector. This software allows you to re-direct USB ports, but more importantly, it supports Hyper-V machines. 

The next part was to get my VM's from VMWare to Hyper-V. Again, some judicious searching led me to StarWind V2V Convertor. They provide a free version which converts from VMDK to VHD and  vice-versa.

I converted my VM that runs Visual Studio 2008 using V2V Convertor, set up a new HyperV machine using the new VHD, and fired it up. Kudos to StarWind - it worked like a dream. 

I then set up USB Redirector. USB Redirector works over TCP/IP, so when you run it, it will configure the firewall for you. You run it on your 'host' machine, and it lists all the USB ports and devices. Simply click on a port, and then click on 'share' to share that port and device. 

Next fire up the Hyper-V machine, run USB Director on that, and it should pick up the device you have shared. 

Then came a problem - I could share most of my USB devices without a problem, and the Hyper-V system would system would pick them up. I could share USB attached disc drives, and many other devices, but when it came to sharing my Windows Mobile devices, WMDC wouldn't pick them up on the Hyper-V system. I set it up on another physical device, and that worked fine, but I needed it to work on the Hyper-V system.

I contacted Incentives Pro support, and they got back to me, and remotely logged in to my system. They spent some time looking at my system, and then they came up with the solution. "You need to disable Enhanced Session Mode in the Hyper-V settings to prevent Hyper-V console from using RDP connection, because WMDC does not work inside RDP session." - see here for more details.


I restarted my Hyper-V machine, and the Windows Mobile Device (a Motorola MC65) was picked up by WMDC - sucess!!

This now means I can do all my development on one system, without the need for rebooting. 

My thanks to everyone who helped me to get this running - it is a great solution.


Contact

M: +44 (0)7860 907493
B:  +44 (0)1204 657497

pete@gui-innovations.com

More

Connections

   

Twitter Feed