Step-By-Step: Creating A Windows Development Environment in Hyper-V
Last week was a busy one for the CANITPRO.NET team as we ventured to Seattle to learn about the new upcoming advancements Microsoft has to offer. What is great about the event is the ability to collaborate with other countries as well as other expertise to create new ideas amidst all the new content being delivered. One idea which struck a cord with the CANITPRO.NET team was the developer requirements for lab computers to create software to be utilized by both enterprise and consumers alike. One of the challenges they face is while developers do sometimes do have a Windows enabled PC to utilize, other times developers use a Mac OS laptop or other OS offerings which may pose a challenge. One said work around to this would be to utilize a Windows To Go Workspace which can be enabled via the Step-By-Step provided on a previous post. Should an approved USB key not be available, enabling a Hyper-V session on a Windows 8.1 machine could be a quick and easy fix to enable a developer to build which ever windows based solution is required. Even a lab enabled with Windows Server 2012 R2 could be created via this method to appease developer demands. Once the solution is completed, the VM could be backed up for future development, transferred to another machine or discarded if no longer needed. Steps to enable this type of functionality are as follows:
Step 1: Prerequisites
The following prerequisites are required to successfully run Client Hyper-V on Windows 8.1 machine:
- Windows 8 Pro or Enterprise 64 bit Operating System
- 64 bit processor with Second Level Address Translation (SLAT)
- 4GB system RAM at minimum
- BIOS-level Hardware Virtualization support
Step 2: Setting Up Hyper-V
Ensure that hardware virtualization support is turned on in the BIOS settings.
Save the BIO settings and boot up the machine normally,
At the Start Screen, swipe the right hand side of the screen and select the Search Charm.
Type turn windows features on or off and select that item
Select and enable Hyper-V
If Hyper-V was not previously enabled, reboot the machine to apply the change.
NOTE: As a best practice, it’s a good idea to configure networking for the Hyper-V environment to support external network connections. Ensure that a virtual switch has been created and is functional.
Open the Virtual Switch Manager, found on the Actions panel in the Hyper-V Manager, by typing Hyper-V at the Start Screen.
Select “Virtual Switch Manager” in the Actions pane.
Ensure that “External” is highlighted, and then click on the “Create Virtual Switch” button.
If more than one NIC in is present, ensure that the proper NIC is selected for use on the VM external network connections.
Step 3: Initial VM setup
Now this is the part where the collaboration established last week comes into play. Microsoft colleague, Volker Will, provided CANITPRO.NET further insight as to creating the perfect environment for developers.
In Hyper-V Manager create a new VHD file via New…/Hard Disk. Make sure to create a Generation 1 VHD file. The size should be set to 80GB, dynamically expanding
Create a new virtual machine using Windows 8.1 Enterprise 64-bit Evaluation software
In Hyper-V manager create a new virtual machine and attach the VHD file created in step 1
Install Windows 8.1 Enterprise, however do NOT connect to the network
During installation you will create a local user account (CANITPRO [no password])
Do NOT connect to the network while creating the virtual machine (allows you to setup a local user account)
Make sure to turn off Windows Update (via Control Panel/Turn Automatic Updating On or Off)
In Hyper-V Manager, Connect the VM to the network but DO NOT APPLY ANY UPDATES via Windows Update yet
Once competed, you should now have a running version of Windows 8.1. Next we will load all the necessary tools developers would require to develop for developing a Windows Phone, Windows Azure, or Windows.
Step 4: Setup of Development Software
Load an elevated command prompt
Install Chocolately by running the following from the elevated command promp:
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
Run the following commands in that order from the same elevated command prompt
Once finished, continue and run the following command to install the .Net Framework 3.x
DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:d:\ sources\sxs
(Where d:\ should be replaced with the drive containing your Windows installation source)
Install Visual Studio 2013 Ultimate (select all options)
Reboot, log on as CANITPRO, and wait for the installation of Visual Studio to finish. Do NOT launch Visual Studio
From an elevated command prompt, run the following commands in the order presented
choco webpi WPDTV3_RTM
Exit the command prompt and start a new elevated command prompt
Run the following command
Reboot and log on as CANITPRO
Create a directory c:\temp
Run the following command from an elevated prompt
webpicmd /install /products:"ARR,ARRv2_5_KB2589179,ARRv3_0,ASPDOTNETandWebTools2012 _2,BasicAuthentication,ClientCertificateMappingAuthentication,DACFX,DefaultDocument,DigestAuthentication,DirectoryBrowse,ECacheUpdate,ExternalCache,HTTPErrors,HTTPLogging,HTTPRedirection,IISClientCertificateMappingAuthentication,IISExpress,IISExpress_7_5,IISExpress_ByPlatform,IISManagementConsole,MVC3,MVC3Loc,MVC4Vs2010_Loc,MySQLConnector,NETFramework35,NETFramework4Update402,NetFx3,NetFx4,NetFx4Extended-ASPNET45,PowerShell,RequestFiltering,ServerSideIncludes,SMO,SMO_11_0,SQLCE,SQLCE_4_0,SQLCEforWM,SQLCETools,SQLCETools_4_0,SQLCLRTypes,SQLDOM,SQLLocalDB,SSDTVS2012,StaticContent,StaticContentCompression,UrlRewrite2,VWDOrVs11AzurePack,VWDOrVs11AzurePack.2.1,VWDOrVs2013AzurePack,VWDOrVs2013AzurePack.2.1,WASConfigurationAPI,WASProcessModel,WebMatrixWeb,WIF,WindowsAuthentication,WindowsAzureLibrariesNET_2_0,WindowsAzureLibrariesNET_2_1,WindowsAzurePowershell,WindowsAzureSDK_2_0,WindowsAzureSDK_2_1, WindowsAzureSDK_2_2,WindowsAzureXPlatCLI,WindowsInstaller31,WindowsInstaller45,WorkflowClient,WorkflowManagerTools" /accepteula /log:c:\temp\webpi-log.txt
NOTE: If asked for the SQL server password, enter CANITPRO or a password of your choosing that you would be able to recall later. The installation will ask you to reboot to continue installing all components still missing from the initial run.
Allow the reboot and log back on as hal9000. The installation will continue to finish the application of products
Install Git Tools for Visual Studio
Reboot and log on as CANITPRO
At this point, feel free to install any other tools and applications
Useful stuff might be:
Manually install all updates to the OS and installed application via Windows Update (Choose updates for Operating System and installed Microsoft products)
You may want to delete existing Restore Points from earlier installations to free up some disk space by running "Disk Cleanup" from Control Panel/Administrative Tools
The virtual machine is now ready and can be prepared for redistribution. At an elevated command prompt run the following commands:
sysprep /generalize /oobe /shutdown
To learn about further functionality around Windows 8.1 for Enterprise, please visit Microsoft Virtual Academy and partake in the free Windows 8 for IT Pros Jump Start.