Running Windows 10 IoT Core in a Virtual Machine

14.dec.15Yavor Ivanov

Yavor Ivanov

Running Windows 10 IoT Core in a Virtual Machine

 

Introduction

Internet of Things is the 2015 buzzword, no doubt about it. For years Linux was the operating system of choice for small and cheap devices, but this year Microsoft announced a stripped down version of Windows 10 designed for these devices. Windows 10 IoT Core has a build for ARM devices (Raspberry-pi) and a x86 build for another, less popular board – the MinnowBoard Max. It all points out that Microsoft is determined to get a slice of the pie, but is Windows 10 IoT ready for serious business applications?

My experience thus far shows there are still many teething issues. Sure you can run windows universal applications, but there are stillAPIs that are not implemented. Device drivers are also an issue, because since the failure of Window RT, device manufacturers don’t create windows drivers for ARM. Is the situation different for the x86 version of Windows 10 Core? The best bet is to try it and find out for yourself! But I suggest before rushing to the hardware store for a board, run it in a virtual machine. I will show you how to do it in VirtualBox, a free hypervisor from Oracle.

Downloads

First, of course, download and install VirtualBox if you don’t already have it.

You will also need a Windows 10 Core image. You can get one from Microsoft here. Choose Download Windows 10 IoT Core for MinnowBoard Max. This is important, because its easier to virtualize the x86 build. We now have to install it. Microsoft has bundled Windows 10 Core in an installer together with some tools for helping you provision it on a sd card and controlling it. So go ahead and run the downloaded installer. After the installation is complete you can find the image in C:\Program Files (x86)\Microsoft IoT\FFU\MinnowBoardMax.

Creating the virtual hard drive

Next we need to expand the ffu and create a virtual hard drive that VirtualBox can use. To do that we are going to use a 3rd party tool called ImgMount. it’s a community tool that can be found on xda developers here. What it does is it reads the ffu, converts it to a vhd virtual hard drive and mounts it. Download it and place it some place easy to call from the console. Now follow these steps:

    1. Open a privileged powershell. Right click on powershell icon and click Run as administrator.
    2. “cd” into the Windows 10 core image
    3. Run the ImgMount tool providing the flash.ffu as an argument. You should see output similar to this:imgmount
    4. Now you have to unmount the image. Open Disk Management inside of Computer management. You will see a new disk that shows below your hard disks. To unmount it right click around the disk name and in the menu that opens select Detach VHD. A new dialog will open that will give you the location of the virtual hard disk that ImgMount has created. Copy this location to notepad, we gonna need it. Now press OK in the dialog to unmount the virtual hard disk.
    5. Navigate to the location of the virtual disk that we saved in notepad. After being unmounted it can be safely moved. Move it to the place you will going to store the virtual machine.

Creating the virtual machine

Now that we have everything we need we can proceed and create the virtual machine itself. Open VirtualBox and click New. Type in name of the virtual machine and select Windows 10 (32-bit) for version. In the hard disk section click Use an existing virtual hard disk file and select in the file picker the virtual hard disk that we created in the previous section.NewMachine
Click the create button to create the virtual machine, but don’t start it yet! We have to tweak it a little bit.

Open the virtual machine settings and select System. Click the checkbox under Extended features that says Enable EFI (special OSes only). Next we need to expose the virtual machine to your network. Select Network in the virtual machine settings. In Adapter 1 Attached to select in the combo Bridged adapter. This will connect the virtual machine to your network directly, giving it internet access possibly and allowing the Windows IoT Core watcher app to pick it up.

Now the virtual machine is ready to roll. Click start to launch it. You should see the familiar windows logo and soon you will be greeted to your new Windows 10 IoT Core device. Well, not really device. Click trough the menus and soon you will be at the landing app. This means that the “board” is setup correctly and it is ready to do some IoT stuff. You can find the IP address of the machine on the landing screen. Also the watcher app that comes with the installer should pick it up. landing

That’s it! You can now deploy a UWP app on it using Visual Studio.

As a side note I want to say that usually I am using Hyper-V and Vmware Workstation for my day to day work, but I found out that virtualizing a Windows 10 Core is much simpler and easier in VirtualBox. Here are some notes that can help those of you who wish to use other hypervisors:

  • Enable EFI. It won’t boot otherwise.
  • Attach the virtual hard disk on a SATA controller. Vmware uses SCSI disk type by default, but it won’t work here.

Thanks for reading!