Enter the Matrix: Virtualization in Server 2012

Evan King
Tech Jobs Academy
Published in
5 min readApr 21, 2016

Red or blue pill?

I know why you’re here. You’re here because you have the feeling that something is off. You’ve been using your computer the same way for years, but you’ve always had a sneaking suspicion that you could be using it more efficiently. You look around your company and see a bunch of different servers all doing one thing and you wonder, why? These machines cost thousands of dollars and you waste valuable hours setting each one of them up. You don’t know what it is but it’s there, like a splinter in your mind, driving you mad, driving you to me. But what is it? How are we going to fix this problem?

It’s virtualization, Neo. (I hope you’ve seen The Matrix)

Virtualization is quickly becoming an essential part of the computing world. By creating a virtual environment within our physical host, we can effectively utilize many independent computer systems within one. We can do this by using what’s called a hypervisor, which is software that allows you to create virtual machines (VMs). There are several different hypervisors you can use; Microsoft’s version is called Hyper-V, but a more popular alternative in the industry is VMWare.

Virtualization has several benefits, including energy conservation, increased uptime and availability, and saving physical space on your hard drive. In the past, common practice was to place one application on one server (to avoid compatibility issues and hardware strain), but that led to an abundance of underutilized machines. This meant hundreds of physical servers that cost a lot to manage and maintain. Virtual machines allow you to create, manage, and move servers easily and with less footprint.

Sold yet? After this, there is no turning back. You take the blue pill — the story ends, you wake up in your bed and believe whatever you want to believe. You take the red pill — you stay in Wonderland and I show you how deep the rabbit-hole goes.

Still here? Good. Let’s start with installing the Hyper-V role on your computer running Windows Server 2012 R2:

  1. First, open Server Manager and navigate to Manage > Add Roles and Features
  2. Review the “Before you Begin” section, then click Next.
  3. Choose which server we are installing the role on and click Next. On the next screen, we will select the Hyper-V role and subsequently all the features that will be needed to install it are automatically added.

4. Continue through the wizard and confirm your selections then proceed to install. You can close the wizard during this process and you will get a notification when it’s done.

Now that we have Hyper-V installed, we can proceed to the next step which is creating our first virtual machine.

  • Navigate to Tools and open Hyper-V Manager.
  • Once the service is started, right-click your server on the left, and from the context menu, go to New > Virtual Machine.
  • From the opened New Virtual Machine Wizard box, on the Before You Begin window, click Next to continue. (Alternatively you can also click the Finish button on this window to directly create a new virtual machine with all the default settings.)
  • Choose the name of your virtual machine, and where you want to store it. You will see a note advising you to take care that this location has enough space to store your virtual machine and any checkpoints you might create for it. Click Next.
  • The next screen asks you to choose which type of virtual machine you want to create, generation 1 or 2. For most purposes, generation 1 is fine. Generation 2 offers alternative boot options including booting from SCSI storage as well as PXE booting through a network adapter, but these features are only compatible with 64-bit Windows 8, Server 2012 or later. Make your selection and click Next.
  • Here you will choose how much memory to allocate to this VM. Keep in mind that the VM is pulling its resources from the host so you must have enough memory on the physical machine. If you plan on creating multiple VMs, it is a good idea to check the Dynamic Memory box as it will allow your VMs to efficiently share memory resources. Click Next.
  • Here, you will select whether to keep your VM’s network adapter disconnected or have it use a virtual switch that you have already created. If you’ll need internet access in your VM for updates or to download application components, you will want to configure an external switch through Virtual Switch Manager, which can be found in the action pane on the right side of the main screen in Hyper-V manager. After you have made your choice, click Next.
  • This screen will allow you to choose what disk your VM is using for storage. You can create a virtual hard disk or choose to use an existing virtual hard disk you’ve already created. There are a number of ways to use your disk space efficiently in this situation, and one of them is to use differencing disks. There are great blog posts on this here and here. Again, keep in mind the space on your physical host as you choose the amount of space on your virtual disk.
  • If you chose to create a disk, the next screen will give you the choice of whether you want to install an operating system from a bootable USB, a floppy disk, or a network-based installation. You can also choose to not install an OS for now. Once you have decided, click Next.

That’s it. You’ve created a virtual environment. The possibilities are (almost) endless, and virtualization is going to allow you to flex your IT muscles a little more. Remember, you can use Hyper-V manager to tweak the settings of your VM later and seamlessly switch between different machines. Now that you have this information, maybe you can convince a friend to virtualize their server. Ask them…red or blue pill?

--

--