Setting up Experimental Virtual Machine with Hyper-V

I know many developers have seen tremendous amount of new technology that is being developers at Microsoft.  Windows 10, new version of Visual Studio which will include new Roslyn compiler and new version of ASP.Net.  Although preview versions are generally save and un-installable, I like to have a separate computer to play with early bits on.  In this post I want to document how easy it is to setup such virtual machine using Hyper-V.  Hyper-V is the virtualization technology that ships with all supported versions of Windows.  If you want to play with Windows 10, which is what I want to do, you will need to download ISO image for it.  Since this version is in preview, you can download it for FREE.  You can find it on Microsoft site here.  It is 64 bit technology. If you are using Windows 8 or later, and you should be, these are the steps to follow.  Hit Windows key on your keyboard and type “Hyper”.  You should see Hyper-V Manager.  Go ahead and launch it. If you do not see the manager, then you do not have it enabled on your machine.  To address this issue, go to Control Panel –> Programs –> Turn Windows Features On or Off and turn all options under Hyper-V section there.

Next, click on New under Actions and select Virtual Machine option

image

You will see the wizard window that you will need to walk through.

Give you machine a name.

image

Pick a generation, and I go with default

image

Net allocate memory.  I would go with at least 4 GB, although 3 seems to work well enough for running Visual Studio.

image

Net setup networking.  You do want this because you want to be able to access the internet from within virtual machine.

image

Net size the disk.  If you want to install Visual Studio and SQL Server, you are going to need to 100 GB.

image

Next we want to install operation system.  Just pick the option shown below and browse to the ISO file for Windows 10 you downloaded earlier.  If you want to install a released version of Windows, such as Windows 8, you will need to have n ISO with licensed copy and registration code.

image

Now just review the summary and lick finish to complete the process.

image

One this is done, we need to tune the machine a bit.  By default, Hyper-V will assign one processor, which is not going to give you decent performance.  So, select your machine in Virtual Machines windows, then click Settings in lower right corner of the manager window.  Got to processor option and change the number of processors to a higher number. I use 4 since I have laptop with 8 cores.  You can also use settings to change other options.

You are done!.  Now to use your new machine, locate it in Hyper-V manager listing, select it by clinking on it, then click Connect.  You could also click Start first, then connect.  If you click on Connect first, you will find green Start button in the window that the virtual machine is launched in.  You can also change window size at the time the machine is launched, you can run it in full screen mode, which is how I usually do it.

A few final tips.  I highly recommend to use SSD on your computer, which will give you great performance in comparison to regular hard drives.  Hyper-V provides hardware isolation, so you will not be able to see primary machine’s hard drive from within your virtual machine.  You can however treat any ISO on your primary machine as virtual disk.  To do so, just select  Media –> DVD Drive –> Insert Disk from running virtual machine’s window.

image

Finally, I am going to start a series of posts on ASP.NET v.Next in the upcoming weeks.  I want to document my experiences primarily, and maybe help someone get started as well.  However, you need to setup the environment first, and this post describes how to setup your machine for free.  As a side note, you will get some experience using Windows 10, which is slightly different than both Windows 8 and 7.

Enjoy.

Leave a Reply

Your email address will not be published. Required fields are marked *