Remotely manage Hyper-V on Vista Using Management Console

With the Hyper-V Manager Microsoft Management Console (MMC) snap-in for Windows Vista you can now manage your Hyper-V servers on your network.

If you have Windows Vista Business, Windows Vista Enterprise, Windows Vista Service Pack 1, Windows Vista Ultimate  either on x86 and x64 versions, you may install this MMC thru this windows update links:

Hyper-V Remote Management Update for Windows Vista for x64-based Systems (KB952627)

Hyper-V Remote Management Update for Windows Vista for x86-based Systems (KB952627)

Note: I have a Vista 64 and my samples and screenshots are for Vista 64

You may need to validate if you are using a Genuine Windows Vista, Click Continue

After the validation, you will now be able to Download the update, click Download to begin.

Download and Run the downloaded .msi file.

 

When you run the .msi file it would search for updates and prompt you if you want to install, click OK

 

 

After installing click close, there you may now find the Hyper-V manager on your administrative tools!

To use the hyper-v Manager, just run the .msc (double click the icon)

 

then right click the hyper-v manager icon on the left hand corner of the tree view then select Connect to Server…

or you can go to Action, Connect to Server…

A prompt would appear, choose Another Computer, type the Computer Name or IP address of the Server Running the Hyper-V. (You may also navigate by clicking Browse…)

There ya go! Your simple remote hyper-V administration!

Note : If you have any error like this

Allow these folks (vmconnect) thru your, the MMC and the WMI

 

or we can use our ever favorite cmd prompt, we need to elevate (run as administrator) our permissions then run this two commands.

netsh advfirewall firewall set rule group="Windows Management Instrumentation (WMI)" new enable=yes

netsh firewall add allowedprogram program=%windir%\system32\mmc.exe name="Microsoft Management Console"

Advertisements

The remote computer disconnected the session because of an error in the licensing protocol.

If you have followed a step by step guide for a bare installation of Windows Server 2008 Terminal Services role (TS Remote) or a similar how-to in our TechNet session in Makati last June 17 2008  on Deploying remote programs using Windows Server 2008 Terminal Services, we have not  configured the licensing role services of the Terminal Services server role. I have been receiving emails and inquiries (including our own internal infrastructure group) about installing TS Licensing and the error "The remote computer disconnected the session because of an error in the licensing protocol. Please try connecting to the remote computer again or contract your sever administrator".

 

 

Note: You must be logged on as or can run as a member of the machine administrators group and domain administrators group. For this example, I will assume that you have already logged on as an admin.

To install TS Licensing role services

Go to the Server Manager, expand Roles and the Terminal Services Role. Right click Terminal Services and click Add Role Services.

 

 

On the Add Role Services window, check the TS Licensing, then click Next >

 

 

On the configure Discovery Scope for TS Licensing, I choose "The domain" then  clicked Next >.

 

On the confirm installation Selections, click Install >

 

Takes about a few moments to install.

After the installation, we now need to configure the newly created role services.

To configure and to verify the install, go to Administrative tools, the expand Terminal Services and click TS Licensing Manager.

On the TS Licensing Manager Window, Expand the All Servers, then your Server Name, in this example I’m using the SANDBOX server.

Right click the server on the server list then click Activate Server.

 

On the welcome to the activate server wizard, click Next >


 

We need to activate our TS Server, I choose automatic connection just like activating your windows. Click Next >

Wizard now activates the Server thru Internet.

 

Install Licenses wizard options or selection depends on your Client Access Licenses, review your License program first if you are doing this on a production environment but for now for demo purposes, let us choose License pack (Retail Purchase). Click Next then Finish.

  

You may have to fill in two Info Forms.

 

We don’t need to install the Licenses now, clear the Start Install Licenses Wizard now check box, and then click Finish.

 

Continuing our installation. on the Server Manager, Expand the Roles to Terminal Serves and the Terminal Services Configuration.

As you can see in the screen shot, I have highlighted the Terminal Services Licensing mode link, and it is labeled Not yet configured. Double click to activate.

For this demo, I will be configuring Per User for the Terminal Services licensing mode. Since we have installed the licensing server on the same server as the terminal services server, we can specify the license server as localhost. Click Ok

 

then that’s it, we have already configured the Terminal Serves Licensing Server.

 

You may now use the Terminal Services Remote Applications.

Installing Hyper-V Server Role on a Standalone Server

 

I recently had to rebuild my Windows Server 2008 laptop, a Dual Core Athlon X64, 2 GB of RAM  with hardware virtualization capabilites. I usually use this for demo’s implementations and for personal practice as well.

Hyper-V gives me a virtual environment where I can have networked guest operating system interacting even on the physical host. I love snapshots, I have fat fingers and when ever I misconfigured a test guest I can just roll back to its previous state.

 

 

 

 

 

Adding Hyper-V Server Role

On the server manager, Click Roles.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Then Click Add Roles and the add roles wizard appears.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

On the add roles wizard, click next >

 

 

On the Select Server Roles window, Select Hyper-V then click Next >

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Introduction to Hyper-V. There are some useful info in here, most of the basics are covered in this window. I suggest that we skim over those info here and bookmark important links. For now, lets click Next >

Let us not choose any network for now, we can configure our networks later.

On the confirm installation window, this summarizes our installation configuration. I would also suggest that we skim this page for any changes before we actually install the Hyper-V server role.

 

Hyper-V is being installed at this moment, after the wizard completes there is a prompt that a restart is pending, click close.  

 

You must restart to finish installing.

 

After a restart, the server would have a windows update. Then after logging on again, the configuration resumes.

 

There! Installation succeeded! Click close and your Hyper-V Server Role is now installed and ready to be used!

 

Before we create our first virtual machine, lets our virtual networks. (saves me a lot of time in the long run)

Go to the Server Manger, go to Roles then expand Hyper-V and the Hyper-V Manager and right click the Server Name and chose Virtual Network Manager.

 

On the Virtual Network Manager, I will going to create an Internal virtual network. Click Add.

Name your new Virtual Network then click Apply and OK.

Lets now create our first virtual machine!

On Server Manager, Click Roles then expand the tree to Hyper-V, Hyper-V manager then to the name of the server.

 

 

 

Right click the server name then click New Virtual machine..

 

On the Before You Begin window, click Next >

 

I’m installing a new virtual instance of a Window Server 2008, and I will save this on a different location.

 

to change the location, click Browse and browse thru the local file system and select the directory where you want to save your VM’s. I usually create my own folder for the virtual hard disk and virtual machine configurations. After finishing this, click Next >

   

How much RAM would we give the new virtual machine? Is 512 enough for a Windows Server 2008?

 

Choose network. We have already configured our Internal Network and for my demo’s and practices, I’m going to use this.

We would also need to create a new virtual hard disk for our virtual machine. So we need to choose Create a virtual hard disk. Click Next > if finished.

 

We can also install an operating system on upon boot of the Virtual Machine. We can choose from different media’s and I have a Windows Server 2008 ISO, I’ll gona be using this. Just browse thru the file system and select the ISO.

After selecting the ISO, click Next >

We are now presented with a summary and if we are finished reviewing, we can click Finish to begin the creation process.

Note : Notice that the Start the virtual machine after it is created box was not checked. Quoting a good mentor on Hyper-V, never make it a habit to start a newly created VM right after creation, specially on a production environment and if you are converting Physical to Virtual Machines.

 

After creating the VM. We can now boot the new VM!

On Server Manager, Click Roles, Expand to Hyper-V and Microsoft Hyper-V Manager and select the server name.

The virtual machine list comes up, you can boot the Windows Server 2008 VM by right click and click Start.

 

This doesn’t immediately let you view the server that is running, you can view it by right click then click Connect. 

And the hyper-v connection window appears and you are now installing a new Windows Server 2008 running on top of a Hyper-V!

Installing Microsoft Loopback Adapter on Windows Server 2008

 

Installing the loopback is really easy. Just go to the control panel and Open Add Hardware.

 

Wizard appears and you may click Next >.

On the selection on "What do you want the wizard to do?" Select Install the hardware that I manually select from a list (Advanced) then click Next >

On the list, scroll down to and select the Network Adapters then click Next >

Scroll down the Manufacturer list and select Microsoft then on the network adapter list, select Microsoft Loopback Adapter and click Next >

The wizard will now confirm to install the virtual hardware. Clicking Next > will start the installation process.

   

You can now click the Finish button.

 

While the control panel is open. its a good time to configure the new (virtual) network adapter. We can configure the new Network just like a physical network. Just go to Network and Sharing Center on control panel

On the Network and Sharing Center, click Manage network connections.

Find the Network connection with labels as Microsoft Loopback Adapter, right click, then choose properties.

 

On my virtual network, I will be using IPv4 only for now. Choose Internet Protocol Version 4 (TCP/IPv4), then click properties.

I’m using a static network, and I will use the 10.0.0.0/ 24 block. Using this series, I dont want to conflict the existing physical network :D.

On the General Tab, choose use the following IP address radio button. I will be using the 10.0.0.2 IP, my subnet mask is 255.255.255.0 and a dummy gateway of 10.0.0.1. Ill be using it self as the DNS server (127.0.0.1). Click Ok. Then close the wizard.

  

 

 

 

Getting all available network interface using NetworkInterface namespace

By using the NetworkInformation namespace
you can get all of the available network interfaces on the current machine.
http://msdn.microsoft.com/en-us/library/system.net.networkinformation.aspx
This is very useful for  applications that are network aware 
or that require to configure the network adapters.
 
using System.Net.NetworkInformation;
 
   1:  //Iterate to all available network interfaces
   2:  foreach (NetworkInterface netInterface in NetworkInterface.GetAllNetworkInterfaces())
   3:  {
   4:      // Filter to load only configurable interfaces
   5:      if (netInterface.NetworkInterfaceType == NetworkInterfaceType.Ethernet |
   6:           netInterface.NetworkInterfaceType == NetworkInterfaceType.Wireless80211)
   7:      {
   8:         //Use the ff as strings, add to a collection or a list
   9:          netInterface.Name.ToString();
  10:          netInterface.Description.ToString();
  11:      }
  12:  }

The above snippet came from a little project that I wrote for me and my Amy that configures our wireless and cabled adapters. Because we both have laptops that connects to both of our office wireless, LAN on their conference (no wireless signal there), wireless in the condo, wireless at Bataan (ssshhh its free, but we need to configure your DNS to SMART BRO :P, it seems that their neighbor has DHCP but did not configured / or has hidden the DNS) 

Sending data to and receiving data from a resource identified by a URI thru WebClient

 

As I have posted on msforums.ph about using a System.Net.WebClient to "Post" a Collection instead of posting this string postData = "client_id=" + 318 + "&tracking_id=" + 2000 thru HttpWebRequest. You can use this:

 
   1:  //Declare your Name-value Collection
   2:  System.Collections.Specialized.NameValueCollection objCollectionToPost = new NameValueCollection(2);
   3:   
   4:  //populate your collection
   5:   objCollectionToPost.Add(“client_id”, 318);
   6:   objCollectionToPost.Add(“tracking_id”, 2000);
   7:   
   8:  //Instantiate  your System.Net.WebClient
   9:  WebClient objClient = new WebClient();
  10:  objClient.BaseAddress = “https:/payment.example.com/gateway”; 
  11:   
  12:  //To capture the response, you may use a byte[ array or a long string, your implementation
  13:  //would depend on what you think is the response will be
  14:  // for this instance I will use a byte array (you will notice why siguro at the end)
  15:   
  16:  Byte objResponseCollection;
  17:   
  18:  //This is the actual posting, you would notice that when you UploadValues to the 
  19:  objResponseCollection = objClient.UploadValues(objClient.BaseAddress, "POST", objCollectionToPost);
  20:   
  21:  //since most likely it would be a length of bytes, and I know from the documentation of your payment
  22:   
  23:  //gateway, that this will be a “Comma Delimited” string, I will process it as follows
  24:   
  25:  String objRetValues;
  26:  objRetValues = System.Text.Encoding.ASCII.GetString(objResponseCollection).Split(",".ToCharArray());
 
When you post WebClient usually returns the response of the payment gateway. 
The response is usually a long string that you need to split into a specified delimiter. 
In my example I already know that the gateway will return a "Comma Delimited" String based on the documentation I got from the payment provider.
 
For more info on WebClient go to msdn: http://msdn.microsoft.com/en-us/library/system.net.webclient(VS.80).aspx