Archive for the ‘Hyper-V’ Category

Hyper-V Memory   Leave a comment


With Hyper-V’s “knobless” design, the biggest thing you have to remember about managing Hyper-V’s memory is to not try to assign more to virtual machines than you actually have available in your host. That’s not to say that you can’t find some room for tweaking.

Single Role

The first rule about Hyper-V is to not install anything inside the parent partition that isn’t directly related to Hyper-V or the hardware it lives on. Part of that is for security, but for the purpose of this discussion, it’s about resource contention. Any applications within the parent partition have to share resources with Hyper-V and all the guest machines. As a general rule, that contention is on equal footing; Hyper-V can’t prioritize itself over other applications operating at the same level. Make absolutely certain that everything in the parent partition is absolutely essential.

Design Virtual Machines

Spend some time in the design phase of your virtual machines thinking about how your Hyper-V memory is to be allocated. Memory is not to be wasted under any circumstances. Microsoft Exchange and most editions of Microsoft SQL are going to use up as much RAM as you assign to their virtual machines, so follow sizing guidelines for those applications to ensure that you are not allocating more than is actually needed for your projected workload.

Dynamic Memory

Microsoft introduced “Dynamic Memory” with Service Pack 1 for Hyper-v R2. This technology works by only assigning a minimum amount (that you specify) of RAM to a virtual machine at startup. Working through the Hyper-V Integration Services, a Windows virtual machine that supports hot add memory can dynamically request and release RAM as its needs fluctuate. Hyper-V is the arbiter of how these requests are granted or denied. You can adjust the properties on individual virtual machines to increase or decrease their weighting in case more RAM is being requested than is available.

Only recent Windows guests can use Dynamic Memory. Linux, Windows XP, and other guests that cannot communicate with the Hyper-V Integration Services’ hot-add driver will never use more memory than is set as the minimum. However, because Hyper-V does not validate that the guest system is hot add capable, it will at least attempt to set aside any specified buffer amount, causing that RAM to be completely wasted.

As previously mentioned, Exchange and SQL will generally just gobble up whatever they can, which makes dynamic memory sort of pointless. Editions of SQL that don’t support h0t add memory won’t be able to allocate anything beyond whatever the startup RAM is, and that bar is unfortunately high. In SQL 2005 through 2008 R2, Express and Standard Editions couldn’t use hot add memory. In SQL 2012, this capability has been granted to the Standard Edition as well, but still not to Express. You will definitely need to manually size these installations.

As a general rule, I do not employ Dynamic Memory. I spend the time to size each virtual machine. For those that might have fluctuating workloads that can justify using Dynamic Memory, I am careful to spend time setting their memory prioritization.

Hyper-V Memory Prioritization

You can use Hyper-V Manager to set weights on how memory is allocated to individual virtual machines. Look on the Hyper-V memory tab of a virtual machine’s properties. By default, they are all given equal weighting. If you aren’t using Dynamic Memory, the weighting only applies when virtual machines start up. If there is insufficient available memory to start a particular virtual machine, it is simply left off. If you are using Dynamic Memory, memory is allocated in your preset priority order from high to low. If all machines are the same priority, Hyper-V decides.

Basic Mechanics of Hyper-V Memory Utilization

Hyper-V does not “overcommit” or “thin provision” memory. Whatever RAM a virtual machine is reporting that it has access to is actually allocated to that machine and you cannot instruct Hyper-V to assign a greater total of RAM to virtual machines than you actually have available. Hyper-V will never page the RAM of its guest machines. In Hyper-V R2, this opens the door for some tweaking of the way the parent partition utilizes its page file; we produced an article outlining how to modify this. In Hyper-V 2012, the default page file configuration is much more suitable to the Hyper-V role and doesn’t really need any modifications.

If you want to see how memory is being utilized by Hyper-V itself, including how it has allocated memory to virtual machines, you’ll need a third-party tool. Task Manager won’t do it. This is because what you actually have access to is a parent partition, not the actual hypervisor itself. Task Manager won’t have access to anything other than what’s inside the parent partition, and that is nothing more than a special-case virtual machine that operates at the same level as any other virtual machine. Hyper-V Manager can show you how much memory is currently allocated to individual virtual machines, but doesn’t have any sort of totalling system. System Center Virtual Machine Manager can show you how much memory the host has available.

Memory Changes in Hyper-V 2012

The biggest news is the addition of “Smart Paging”. This is a pseudo-overcommit technology in which Hyper-V will temporarily page RAM for virtual machines under specific circumstances. Aidan Finn has already written a great summary of this technology. While reading that post, also take note of the change to the way .BIN files are handled in Hyper-V 2012. This addresses an annoyance to many Hyper-V R2 administrators who didn’t expect to lose those extra few gigabytes of storage space.

Posted 18/10/2012 by Petri in Hyper-V

Howto copy files to your Guest Microsoft Hyper-V   Leave a comment


Powershell and Hyper-V go hand in hand, learn more about an easy way to create a VHD file and connect it to your virtual machine in this blog.

Where I came from

A few weeks ago I decided to start with Microsoft Windows 8, the world is changing and I thought I better change along. With Microsoft Windows 8 comes Hyper-V, Microsoft answer to VMware ESX/vSphere.

Sharing folders

With Microsoft Windows 7  I ran VMware Workstation and I used to share several folders on my laptop to share ISO or common installation files with the virtual machines. It’s handy when you play around with new stuff and have to install virtual machine regulary. You don’t have to download the same stuff over and over, it’s easier to have DotNet stuff and stuff like that easy accesible for your virtual machine.

Hyper-V

I was kinda shocked to find out that Microsoft Hyper-V for Windows 8 lacked this kind of option, to share folders to a guest virtual machine. To people using Microsoft Hyper-V on Windows 8 for a longer time it might not have been a suprise but to me, using VMware products since like ever it was a suprise. Of course the Windows 8 version of Hyper-V is nothing compared to the server version, but then again VMware also has a client version and a server version of it hypervisor. So here I’m talking about the client version, with VMware it’s Workstation and with Hyper-V, it’s Hyper-V for Windows 8.
In the menu you can find a way to copy clipboard text to the machine, another feature not so greatly implemented. The clipboard option is to be found under the clipboard menu.
You can connect a ISO file to the guest virtual machine, this will be used mostely when you have to install a certain product. Connecting a ISO file is done in the Media/DVDDrive option from the menubar

Getting data

So the first thing I needed to figure out is how do I get data to my guest virtual machine when I can’t connect my guest to the network. I have some virtual machine that run DNS/DHCP and other services I don’t want to expose to outside networks. I usually create a internal VLAN’d network where my servers run freely without the chance of interrupting any network services  at the office or at customers.
So I still was stuck with getting the data, no way Hyper-V let me get my data.
After a few hours of frustration I decided to create an ISO of the folder I use mostly for standard software. This ISO I connected to the guest virtual machine and I was able to finish my work.

ISO Emulator

Still this didn’t satisfy me, I didn’t see myself creating an ISO everytime I needed a file… that’s not gonna work. I went to search  on the Internet for a solution to have an ISO but not having to create one every time you want to add files. I was looking for a dynamical ISO or like @AndrewCooke said on Twitter a “Writeable ISO emulator”.@PeterNoorderijk pointed out, as you can read in the comments, that we live in the VHD/PowerShell era. He’s right of course about that, these days it would be more logical to add a VHD to a guest virtual machine containing the data you need. 

How would this work?

With an ISO emulator you would assign a folder to be read by a service, that service would provide an virtaul ISO file to the guest virtual machine. The virtual machine read the ISO as is and will handle it like a normal ISO file. Everytime you add or delete files from the folder you would see the difference when you refresh your drive content in the virtual machine.

VHD and Powershell

I wanted to see how easy it is to create a VHD, copy data on it and connect it to the guest virtual machine. I could have done that manually but I perfer to use Powershell for this.

Create a VHD

With Microsoft Windows 8 it logical to use VHD for the disks are in VHD format. So (inspired by @PeterNoorderijk his comment) I created a VHD, copied files to it and attached it to the guest virtual machine.
Creating a VHD with Powershell is easy, so I started of with creating a 20GB VHD file.

The VHD file is created in the C:\VM folder on my local harddisk, as you can see below.

The VHD file is not mounted automatically and therefore not visible as a drive at this moment.

To copy data to the VHD file you need to mount it…but again PowerShell comes to the rescue.

After we mounted the disk we  have to initialize it..So let’s see which disks we have

So it turn out we have to initialize Disk 1. To initialize the disk, type the command as shown above “Initialize-Disk 1 -PartitionStyle MBR” .
Next job is to create a partition so that we can drop some data on the disk.

The last job is to format the volume.
The Format process is shown in your PS screen.

Of course this could be written in a more fashionable way by a real scripter but the proces is the same.
the disk is ready now and we can drop data on it..
After you copied the data to the disk you can dismount it… with PowerShell of course.

The disk is not visible anymore in Explorer.
Now we can connect it to the Guest in Hyper-V..again with Powershell.

If we look at the settings of the virtual machine we see this VHD is added.

This could be made as a script to connect/disconnect the file and make data available to virtual machines.

Posted 17/10/2012 by Petri in Hyper-V

Windows Server 2012 Hyper-V Replica   Leave a comment


If you asked me to pick the killer feature of WS2012 Hyper-V, then Replica would be high if not at the top of my list (64 TB VHDX is right up there in the competition). In Ireland, and we’re probably not all that different from everywhere else, the majority of companies are in the small/medium enterprise (SME) space and the vast majority of my customers work exclusively in this space. I’ve seen how DR is a challenge to enterprises and to the SMEs alike. It is expensive and it is difficult. Those are challenges an enterprise can overcome by spending, but that’s not the case for the SME.

Virtualisation should help. Hardware consolidation reduces the cost, but the cost of replication is still there. SAN’s often need licenses to replicate. SAN’s are normally outside of the reach of the SME and even the corporate regional/branch office. Software replication which is aimed at this space is not cheap either, and to be honest, some of them are more risky than the threat of disaster. And let’s not forget the bandwidth that these two types of solution can require.

Isn’t DR Just An Enterprise Thing?

So if virtualisation mobility and the encapsulation of a machine as a bunch of files can help, what can be done to make DR replication a possibility for the SME?

Enter Replica (Hyper-V Replica), a built-in software based asynchronous replication mechanism that has been designed to solve these problems. This is what Microsoft envisioned for Replica:

  • If you need to replicate dozens or hundreds of VMs then you should be using a SAN and SAN replication. Replica is not for the medium/enterprise sites.
  • Smaller branch offices or regional offices that need to replicate to local or central (head office or HQ data centre) DR sites.
  • SME’s who want to replicate to another office.
  • Microsoft partners or hosting companies that want to offer a service where SME’s could configure important Windows Server 2012 Hyper-V host VMs to replicate to their data centre – basically a hosted DR service for SMEs. Requirements of this is that it must have Internet friendly authentication (not Kerberos) and it must be hardware independent, i.e. the production site storage can be nothing like the replica storage.
  • Most crucially of all: limited bandwidth. Replica is designed to be used on commercially available broadband without impacting normal email or browsing activity – Microsoft does also want to sell them Office 365, after all How much bandwidth will you need? How long is a piece of string? Your best bet is to measure how much change there is to your customers VMs every 5 minutes and that’ll give you an idea of what bandwidth you’ll need.

In short, Replica is designed and aimed at the ordinary business that makes up 95% of the market, and it’s designed to be easy to set up and invoke.

What Hyper-V Replica Is Not Intended To Do

I know some people are thinking of this next scenario, and the Hyper-V product group anticipated this too. Some people will look at Hyper-V Replica and see it as a way to provide an alternative to clustered Hyper-V hosts in a single site. Although Hyper-V Replica could do this, it is not intended for for this purpose.

The replication is designed for low bandwidth, high latency networks that the SME is likely to use in inter-site replication. As you’ll see later, there will be a delay between data being written on host/cluster A and being replicated to host/cluster B.

You can use Hyper-V Replica within a site for DR, but that’s all it is: DR. It is not a cluster where you fail stuff back and forth for maintenance windows – although you probably could shut down VMs for an hour before flipping over – maybe – but then it would be quicker to put them in a saved state on the original host, do the work, and reboot without failing over to the replica.

How It Works

I describe Hyper-V Replica as being a storage log based asynchronous disaster recovery replication mechanism. That’s all you need to know …

How Replication Works

Once Replica is enabled, the source host starts to maintain a HRL (Hyper-V Replica Log file) for the VHDs. Every 1 write by the VM = 1 write to VHD and 1 write to the HRL. Ideally, and this depends on bandwidth availability, this log file is replayed to the replica VHD on the replica host every 5 minutes. This is not configurable. Some people are going to see the VSS snapshot (more later) timings and get confused by this, but the HRL replay should happen every 5 minutes, no matter what.

The HRL replay mechanism is actually quite clever; it replays the log file in reverse order, and this allows it only to store the latest writes. In other words, it is asynchronous (able to deal with long distances and high latency by write in site A and later write in site B) and it replicates just the changes.

Note: I love stuff like this. Simple, but clever, techniques that simplify and improve otherwise complex tasks. I guess that’s why Microsoft allegedly ask job candidates why manhole covers are circular

As I said, replication or replay of the HRL will normally take place every 5 minutes. That means if a source site goes offline then you’ll lose anywhere from 1 second to nearly 10 minutes of data.

I did say “normally take place every 5 minutes”. Sometimes the bandwidth won’t be there. Hyper-V Replica can tolerate this. After 5 minutes, if the replay hasn’t happened then you get an alert. The HRL replay will have another 25 minutes (up to 30 completely including the 5) to complete before going into a failed state where human intervention will be required. This now means that with replication working, a business could lose between 1 second and nearly 1 hour of data.

Most organisations would actually be very happy with this. Novices to DR will proclaim that they want 0 data loss. OK; that is achievable with EUR100,000 SANs and dark fibre networks over short distances. Once the budget face smack has been dealt, Hyper-V Replica becomes very, very attractive.

That’s the Recovery Point Objective (RPO – amount of time/data lost) dealt with. What about the Recovery Time Objective (RTO – how long it takes to recover)? Hyper-V Replica does not have a heartbeat. There is not automatic failover. There’s a good reason for this. Replica is designed for commercially available broadband that is used by SMEs. This is often phone network based and these networks have brief outages. The last thing an SME needs is for their VMs to automatically come online in the DR site during one of these 10 minute outages. Enterprises avoid this split brain by using witness sites and an independent triangle of WAN connections. Fantastic, but well out of the reach of the SME. Therefore, Replica will require manual failover of VMs in the DR site, either by the SME’s employees or by a NOC engineer in the hosting company. You could simplify/orchestrate this using PowerShell or System Center Orchestrator. The RTO will be short but have implementation specific variables: how long does it take to start up your VMs and for their guest operating systems/applications to start? How long will it take for you to get your VDI/RDS session hosts (for remote access to applications) up, running and accepting user connections? I’d reckon this should be very quick, and much better with the 4-24 hours that many enterprises aim for. I’m chuckling as I type this; the Hyper-V group is giving SMEs a better DR solution than most of the Fortune 1000’s can realistically achieve with oodles of money to spend on networks and storage replication, regardless of virtualisation products.

A common question I expect: there is no Hyper-V integration component for Replica. This mechanism works at the storage level, where Hyper-V is intercepting and logging storage activity.

Replica and Hyper-V Clusters

Hyper-V Replica works with clusters. In fact you can do the following replications:

  • Standalone host to cluster
  • Cluster to cluster
  • Cluster to standalone host

The tricky thing is the configuration replication and smooth delegation of replication (even with Live Migration and failover) of HA VMs on a cluster. How can this be done? You can enable a HA role called a Hyper-V Replica Broker on a cluster (once only). This is where you can configure replication, authentication, etc, and the Broker replicates this data out to cluster nodes. Replica settings for VMs will travel with them, and the broker ensures smooth replication from that point on.

Configuring Hyper-V Replica

I don’t have my lab up and running yet, but there are already many step-by-step posts out there. I wanted to focus on the how it works and why to use it. But here are the fundamentals:

On the replica host/cluster, you need to enable Hyper-V Replica. Here you can control what hosts (or all) can replicate to this host/cluster. You can do things like have one storage path for all replicas, or creating individual policies based on source FQDN such as storage paths or enabling/pausing/disabling replication.

You do not need to enable Hyper-V Replica on the source host. Instead, you configure replication for each required VM. This includes things like:

  • Authentication: HTTP (Kerberos) within the AD forest, or HTTPS (destination provided SSL certificate) for inter-forest (or hosted) replication.
  • Select VHDs to replicate
  • Destination
  • Compressing data transfer: with a CPU cost for the source host.
  • Enable VSS once per hour: for apps requiring consistency – not normally required because of the logging nature of Replica and it does cause additional load on the source host
  • Configure the number of replicas to retain on the destination host/cluster: Hyper-V Replica will automatically retain X historical copies of a VM on the destination site. These are actually Hyper-V snapshots on the destination copy of the VM that are automatically created/merged (remember we have hot-merge of the AVHD in Windows 8) with the obvious cost of storage. There is some question here regarding application support of Hyper-V snapshots and this feature.

Initial Replication Method

I’ve worked in the online backup business before and know how difficult the first copy over the wire is. The SME may have small changes to replicate but might have TBs of data to copy on the first synchronisation. How do you get that data over the wire?

  • Over-the-wire copy: fine for a LAN, if you have lots of bandwidth to burn, or if you like being screamed at by the boss/customer. You can schedule this to start at a certain time.
  • Offline media: You can copy the source VMs to some offline media, and import it to the replica site. Please remember to encrypt this media in case it is stolen/lost (BitLocker-To-Go), and then erase (not format) it afterwards (DBAN). There might be scope for an R2/Windows 9 release to include this as part of a process wizard. I see this being the primary method that will be used. Be careful: there is no time out for this option. The HRL on the source site will grow and grow until the process is completed (at the destination site by importing the offline copy). You can delete the HRLs without losing data – it is not like a Hyper-V snapshot (checkpoint) AVHD.
  • Use a seed VM on the destination site: Be very very careful with this option. I really see it as being a great one for causing calls to MSFT product support. This is intended for when you can restore a copy of the VM in the DR site, and it will be used in a differencing mechanism where the differences will be merged to create the synch. This is not to be used with a template or similar VMs. It is meant to be used with a restored copy of the same VM with the same VM ID. You have been warned.

And that’s it. Check out the social media and you’ll see how easy people are saying Hyper-V Replica is to set up and use. All you need to do now is check out the status of Hyper-V Replica in the Hyper-V Management Console, Event Viewer (Hyper-V Replica log data using the Microsoft-Windows-Hyper-V-VMMS\Admin log), and maybe even monitor it when there’s an updated management pack for System Center Operations Manager.

Failover

I said earlier that failover is manual. There are two scenarios:

Planned: You are either testing the invocation process or the original site is running but unavailable. In this case, the VMs start in the DR site, there is guaranteed zero data loss, and the replication policy is reversed so that changes in the DR site are replicated to the now offline VMs in the primary site.

Unplanned: The primary site is assumed offline. The VMs start in the DR site and replication is not reversed. In fact, the policy is broken. To get back to the primary site, you will have to reconfigure replication.Can I Dispense With Backup?No, and I’m not saying that as the employee of a distributor that sells two competing backup products for this market. Replication is just that, replication. Even with the historical copies (Hyper-V snapshots) that can be retained on the destination site, we do not have a backup with any replication mechanism. You must still do a backup, as I previously blogged, and you should have offsite storage of the backup.Many will continue to do off-site storage of tapes or USB disks. If your disaster affects the area, e.g. a flood, then how exactly will that tape or USB disk get to your DR site if you need to restore data? I’d suggest you look at backup replication, such as what you can get from DPM:

The Big Question: How Much Bandwidth Do I Need?

Ah, if I knew the answer to that question for every implementation then I’d know many answers to many such questions and be a very rich man, travelling the world in First Class. But I am not.

There’s a sizing process that you will have to do. Remember that once the initial synchronisation is done, only changes are replayed across the wire. In fact, it’s only the final resultant changes of the last 5 minutes that are replayed. We can guestimate what this amount will be using approaches such as these:

  • Set up a proof of concept with a temporary Hyper-V host in the client site and monitor the link between the source and replica: There’s some cost to this but it will be very accurate if monitored over a typical week.
  • Do some work with incremental backups: Incremental backups, taken over a day, show how much change is done to a VM in a day.
  • Maybe use some differencing tool: but this could have negative impacts.

Some traps to watch out for on the bandwidth side:

  • Asynchronous broadband (ADSL): The customer claims to have an 8 Mbps line but in reality it is 7 Mbps down and 300kbps up. It’s the uplink that is the bottleneck because you are sending data up the wire. Most SME’s aren’t going to need all that much. My experience with online backup verifies that, especially if compression is turned on (will consume source host CPU).
  • How much bandwidth is actually available: monitor the customer’s line to tell how much of the bandwidth is being consumed or not by existing services. Just because they have a functional 500 kbps upload, it doesn’t mean that they aren’t already using it.

Very Useful Suggestion

Think about your servers for a moment. What’s the one file that has the most write activity? It is probably the paging file. Do you really want to replicate it from site A to site B, needlessly hammering the wire?

Hyper-V Replica works by intercepting writes to VHDs. It has no idea of what’s inside the files. You can’t just filter out the paging file. So the excellent suggestion from the Hyper-V product group is to place the paging file of each VM onto a different VHD, e.g. a SCSI attached D drive. Do not select this drive for replication. When the VMs are failed over, they’ll still function without the paging file, just not as well. You can always add one after if the disaster is sustained. The benefit is that you won’t needlessly replicate paging file changes from the primary site to the DR.

Posted 15/10/2012 by Petri in Hyper-V

Install Windows XP in Windows 8 Client Hyper-V   Leave a comment


As you may remember, Windows 7 came with Windows Virtual PC and Windows XP Mode allowing you to download and install a fully functional copy of Windows XP SP3 in a virtual machine running inside of Windows 7 Professional, Enterprise, and Ultimate. XP Mode was designed to ease migration and compatibility issues by allowing you to easily run Windows XP application in Windows 7.

The XP Mode for Windows Virtual PC included specialized integration components designed to allow applications installed in the Windows XP virtual machine to appear as if they were running directly in Windows 7 – the applications even appeared on the Windows 7 Start menu. When you launch such an application from the Start menu, the virtual Windows XP loads in the background without any UI and it looks and feels as though you are running the application directly in Windows 7. Microsoft calls this feature Seamless Mode.

As I explained in my last blog post, Create a test machine in Windows 8 Client Hyper-V, Microsoft has done away with Windows Virtual PC in favor of focusing on Hyper-V, which is a much more powerful and feature rich virtualization platform and also is the main virtualization platform in Windows Server. However, as a side effect of doing so, the XP Mode capability has also gone by the wayside.

Now, before you get all excited, losing XP Mode was not part of some evil plan by Microsoft to push folks away from Windows XP. In fact, the reason for the disappearance of XP Mode is related to the differences in the hypervisor platforms used by Windows Virtual PC and Windows 8’s Client Hyper-V. Windows Virtual PC uses Type-2 hypervisor while Hyper-V is a Type 0 hypervisor. The differences in Hyper-V’s hypervisor type means that it can’t provide the same access that made XP Mode’s integration feature possible.

However, that doesn’t mean that you can’t still run a Windows XP on a virtual machine in Windows 8. In this post, I’ll show you how to install Windows XP in Windows 8 Client Hyper-V virtual machine. As I do, I’ll show you some of the neat features in Client Hyper-V.

Launching Windows 8’s Client Hyper-V

To begin, just press the [Windows] key to bring up the Start Screen. Then, type Hyper and press [Enter] when Hyper-V Manager appears, as illustrated in Figure A.

Figure A

Accessing Windows Feature tool from the Start Screen is easy.

Creating the virtual machine

In last week’s article, I told you that there are two ways that you can create a virtual machine from the New Virtual Machine Wizard. You can work through the wizard to create a virtual machine or you can quickly create a virtual machine using the preconfigured default settings, which you can then change later. Since we worked through the wizard to create a virtual machine last time, we’ll create a virtual machine using the preconfigured default settings. We’ll then edit the virtual machine’s settings. While going this route is a bit more time consuming, it will allow us to take a look at some of the features available in the virtual machine Settings window.

After you launch the Hyper-V Manager, navigate to the Actions pane and select the New | Virtual Machine command. When the first screen of the New Virtual Machine Wizard appears, just click the Finish button, as shown in Figure B, to immediately create a virtual machine with preconfigured default settings.

Figure B

You can quickly create a virtual machine using the preconfigured default settings.

When you see the new virtual machine appear in the Virtual Machines list, right click the name and rename it to something like XP Virtual Machine, then go back to the Actions pane and click the Settings command, as shown in Figure C.

Figure C

Renaming the virtual machine will help you to keep track of it.

Editing the virtual machine’s settings

When the Settings window appears, you’ll see that there are a multitude of settings that you can configure to customize how your virtual machine will work. For the purposes of this article, I’ll just cover the basic settings that you need to get started with your Windows XP virtual machine.

Because Windows XP is an old operating system, it isn’t compatible with Hyper-V’s network adapter. As such, the first thing that you will need to do is add a legacy network adapter. Select the Legacy Network Adapter item, as shown in Figure D, and click the Add button.

Figure D

Because Windows XP is an old operating system, the first thing that you need to do is add a legacy network adapter.

When you do, Hyper V will add the Legacy Network Adapter to the Hardware list and immediately take you to that section. Since I already created a virtual switch for my last article, I’ll select the Test 1 Virtual switch from the virtual switch drop down, as shown in Figure E. Then, click Apply to save your changes. If you haven’t already set up a Virtual switch for the Network Adapter, you can do so at any time. (See my blog post, Create a test machine in Windows 8 Client Hyper-V.)

Figure E

If you have already configured a Virtual switch, just select it.

Now, move up the Hardware list and select the Memory section. I’m going to specify 1GB of RAM for my XP Virtual Machine. As you can see in Figure F, I’ve specified 1024 in the Startup RAM text box and left the Enable Dynamic Memory check box unselected. Even though the text box is titled Startup RAM, in the case of the Windows XP operating system, this will be the total amount of available RAM.

In other words, it will essentially be static memory. Being an older operating system, Windows XP is not supported by Hyper-V’s Dynamic Memory feature, so you’ll need to leave that check box unselected. The Memory Weight slider is designed to allow you to prioritize memory usage but it is related to the Dynamic Memory feature and so in the case of Windows XP we’ll just leave it as it is in the middle.

Figure F

Hyper-V doesn’t support Dynamic Memory for Windows XP.

To continue, go ahead and click Apply to save your settings. Then move down to the IDE Controller 0 | Hard Drive section.

When you arrive at the Hard Drive section, as shown in Figure G, the only thing that you may want to do is increase the size of the hard disk. By default, the hard disk is set to 127GB in size. For this example machine, I want to increase the size of the hard disk to 500GB. To do so, click Edit button.

Figure G

Chances are that you’ll want to expand the size of the virtual hard disk.

When the Edit Virtual Hard Disk Wizard appears, you’ll see that it immediately advances to the Choose Action page. You’ll then select the Expand option, click Next, and then specify the size as 500GB. These two steps are illustrated in Figure H. To complete the operation, click the Finish button. When you return to the Settings window, click Apply to save your changes.

Figure H

You’ll use the Edit Virtual Hard Disk Wizard to expand the size of the virtual hard disk.

Keep in mind that Hyper-V creates dynamically expanding virtual hard disks. This means that the hard disk only takes up as much room as needed and can only grow to the specified size. For example, clicking the Inspect button (next to the Edit button in the Hard Drive section) displays the Virtual Hard Disk Properties dialog box, shown in Figure I. As you can see, at this point the size of the virtual hard disk file is 4MB. As I install the operating system and applications, the virtual hard disk will grow in size until it reaches the maximum size of 500GB.

Figure I

The Virtual Hard Disk Properties dialog box shows the current size of the virtual hard disk.

At this point, move down to the IDE Controller 1 | DVD Drive section and choose how you want to install the operating system and applications on your virtual machine. You can use ISO images files or the physical CD/DVD drive. As shown in Figure J, I’ve selected the Physical CD/DVD drive option and indicated the appropriate drive letter. This will make it easy to install Windows XP from the optical disc. Click Apply to save your changes.

Figure J

You’ll specify how you want to configure the DVD Drive that you’ll use to install the operating system and applications on your virtual machine.

Launching the installation

Installing Windows XP in a Hyper-V virtual machine is easy. To begin, insert the Windows XP CD in the drive, go back to the Actions pane in the Hyper-V Manager, scroll down to the virtual machine section and click the Connect command. When you do, you’ll see a virtual machine window that tells you that the machine is turned off. At this point, just click the Start button on the menu bar, as shown in Figure K.

Figure K

Click the Start button on the virtual machine window’s toolbar.

You’ll then see the installation begin. Figure L shows the Windows XP Setup screen.

Figure L

Seeing the basic looking Windows XP Setup screen in Windows 8 is quite a stark picture.

Once the installation is complete, you’ll see the Windows XP desktop in a virtual machine in Windows 8, as shown in Figure M.

Figure M

Once the installation is complete, you’ll see the Windows XP desktop in a virtual machine in Windows 8.

Posted 12/10/2012 by Petri in Hyper-V

How To Convert VHD to VHDX with Hyper-V 3   Leave a comment


Windows Server 2012 and Windows 8 introduce a new virtual hard disk file format, VHDX, which is an upgrade from the current VHD format and provides for superior performance, reliability and several enhancements including:

  • Support for virtual hard disks larger than 2TB and up to 64TB.
  • Better performance of dynamic and difference files through new larger block sizes.
  • Improved alignment of the virtual hard disk on large sector disks.

Many of you already have a virtual infrastructure based on Microsoft Hyper-V and would need to upgrade all your existing VHDs in order to take advantage of all the new features and capabilities. Luckily, The Hyper-V team has taken that into consideration and provided a very simple way to convert existing VHDs into VHDX. Here’s how to do it:

  1. Launch Hyper-V manager and from the right side Action pane and select Edit Disk .
  2. The Edit Virtual Hard Disk Wizard starts; click Next to get past the initial screen.
  3. Enter the name and location of the existing VHD file (see Fig. 1) and click Next.

4. Select Convert and click Next.

5.Select the VHDX file format and click Next (see Fig. 2).

6. Complete the wizard by selecting the settings you need.

This process makes an exact copy of your existing VHD file, except now it’s in the new VHDX format. And should the need arise, you can always use the same process to convert from VHDX back to VHD.

Posted 11/10/2012 by Petri in Hyper-V

Create a Virtual Machine Based on an Exisiting VHD File Windows 8 Client Hyper-V   Leave a comment


Now that I’m running Windows 8, I want to use Hyper-V. I can’t import the virtual machines, but I can build new virtual machines from virtual disks. I have already converted the Virtual Box disk files from their format to VHD. But in order to test the entire process I’m going to use a copy of a VHD file previously created from another project.

The first thing I want to do, although not required, is to verify the VHD file. In Hyper-V Manager, there is an inspect disk action as I’ve highlighted below in Figure 1.

Windows 8 Hyper-V inspect disk

The action brings up a file browser. After navigating to the correct folder and selecting the VHD, I can see that it looks pretty good in Figure 2.

Windows 8 Hyper-V hard disk properties

No problems, so I’m going to build a new virtual machine around this disk. From the Actions pane I’ll click on New – Virtual Machine. This begins the wizard in Figure 3.

Windows 8 Hyper-V virtual machine wizard

Next, I’ll give my new VM a name. I’m going to accept the default location for now, as seen below in Figure 4.

Windows 8 Hyper-V virtual machine name

Clicking Next brings me to memory configuration. Because I intend to not have any other virtual machines running when this is running, I’ll go ahead and bump this to 4GB. My test machine has 8GB of RAM.

Windows 8 Hyper-V assign memory

Now it’s time to roll up my sleeves and do a little configuring networking. Remember, the VHD already has an installed instance of Windows Server 2012 RC, and I know it is configured for a single adapter. So I’ll create a new adapter with the virtual machine and bind it to my virtual switch that will connect it to the physical network. Eventually when I start the virtual machine, the guest OS will do some reconfiguring for the new hardware, but that’s okay.

Windows 8 Hyper-V configure network

Now comes the main part. I already have a preconfigured disk so I’m not going to create a new one. Instead, as you see below in Figure 7, I’m going to specify the path to the exiting VHD file.

Windows 8 Hyper-V connect virtual hard disk

Clicking Next brings me to the summary page as depicted below in Figure 8.

Windows 8 Hyper-V summary

Clicking Finish will get the job done, as you can see below.

Windows 8 Hyper-V click finish

Before firing up the virtual machine, I’ll take a quick look at its settings.

Windows 8 Hyper-V settings

When you are using an existing VHD with a pre-installed operating system, hopefully you know what hardware configuration it is using. You may need to adjust settings accordingly. For example, if I knew the operating system on the VHD is expecting two processors, I can go ahead and add a second one. These settings should be okay, so I’ll close them and fire up the new virtual machine based on an existing VHD.

Naturally, because an operating system is already installed, you’ll need to know the necessary credentials to log on. For Windows-based operating systems, the virtual machine should detect new hardware and install drivers or software as needed. More than likely you will need to reboot the virtual machine. By the way, if you need to send Ctrl+Alt+Del to the virtual machine, use Ctrl+Alt+End. Or, in the Virtual Machine Connection window, select Ctrl+Alt+Del from the Action menu.

There is one final step to make, especially if your VHD is running a Windows operating system: Install integration services after rebooting (or before if you can). These services make it easier to manage the virtual machine from the Hyper-V manager.

From the Action menu in the Virtual Machine Connection window, select Insert Integration Services Setup Disk. This assumes your virtual machine has a DVD device. Launch the setup according to your operating system. Follow the prompts and reboot if necessary. You can configure integration services under settings. But unless you have some very specific needs, I’d stick with the defaults.

Windows 8 Hyper-V settings

Posted 05/10/2012 by Petri in Hyper-V

Configuring Virtual Networks With Hyper-V   1 comment


The Virtual Switch

What really sets Hyper-V apart from Microsoft’s other virtualization products is that virtual machines perform much better because they can communicate with the server’s hardware directly rather than having to pass hardware requests through the host operating system (although there are some exceptions to this). Of course you can’t just bombard a network adapter with simultaneous traffic from multiple virtual machines. There has to be a way of managing the traffic. To get around this problem, Microsoft has introduced the concept of the virtual switch.

To understand how this is possible, you have to realize that Hyper-V is not a Windows Server 2008 add-on, but rather is a part of the operating system. When you install the Hyper-V role, the hyper visor is placed “underneath” the Windows 2008 operating system. The existing operating system (known as the host operating system) is placed into something called the parent partition, and each guest operating system is placed into a separate child partition.

To make this type of architecture possible, Microsoft had to unbind the host operating system’s TCP/IP stack from the server’s NIC. In doing so, they have created an additional layer of abstraction known as the virtual switch. The virtual switch is the only networking component that is bound to the physical network adapter. The parent partition and the child partitions use virtual network adapters (known as vNICs), which communicate with the virtual switch using Microsoft’s Virtual Network Switch Protocol.

I realize that this description may be difficult to follow, so I have created the diagram shown in Figure A as a way of helping you to understand the architecture.

configuring-virtual-networking-with-hyper-v-1_small.jpg

Figure A This is what the virtual switch architecture looks like.

Additional Virtual Switches

Hyper-V allows you to create additional virtual switches beyond the one that I just talked about. To do so, open the Hyper-V Manager and then click on the Virtual Network Managerlink. Upon doing so, Windows will display the Virtual Network Manager screen, shown in Figure B.
configuring-virtual-networking-with-hyper-v-2_small.jpg

Figure B The Virtual Network Manager allows you to create additional virtual switches.

If you look at the figure above, you can see that the default virtual switch is bound to my physical network adapter. You also have the option of creating a new virtual network, which is the same as creating a new virtual switch. As you can see in the figure, there are three different types of virtual networks that you can create.

Your first option is to create an external virtual network. Doing so creates a virtual switch through which virtual machines can access your entire network, and even the Internet assuming that you have the necessary infrastructure in place.

One thing that you do need to know about external virtual networks is that they must be bound to a physical network adapter. Additionally, each physical network adapter can only be used for a single virtual network. Therefore, if you are creating a secondary external virtual network then you’re going to need a secondary NIC that you can bind the new external virtual network to.

Your next option is to create an internal virtual switch. An internal virtual switch is not capable of accessing the yarn that, or even your private network as a whole. It serves primarily as a mechanism for allowing communications between the virtual machines that are hosted on the server. Additionally, an internal virtual network can facilitate communications between the host operating system and the guest operating systems that are running on it.

Your third option is to create a private virtual network. A private virtual network can only be used to facilitate communications between the virtual machines that are hosted on the current server. Private virtual networks can not access the outside world, nor can they access the host operating system.

Posted 04/10/2012 by Petri in Hyper-V

You should know about Hyper-V   Leave a comment


Hyper-V is getting good reviews, even from some Microsoft critics, and the release of the standalone version has made it even more attractive. Deb Shinder looks at the most important aspects of the Hyper-V platform.

Hypervisor technology is software on which multiple virtual machines can run, with the hypervisor layer controlling the hardware and allocating resources to each VM operating system. Hyper-V is the virtualization platform that is included in Windows Server 2008. Microsoft also recently released a standalone version, called Hyper-V Server 2008, that’s available as a free download from the Microsoft Web site.

As server virtualization becomes more important to businesses as a cost-saving and security solution, and as Hyper-V becomes a major player in the virtualization space, it’s important for IT pros to understand how the technology works and what they can and can’t do with it.

In this article, we address 10 things you need to know about Hyper-V if you’re considering deploying a virtualization solution in your network environment.

Note: This information is also available as a PDF download.

#1: To host or not to host?

Hyper-V is a “type 1″ or “native” hypervisor. That means it has direct access to the physical machine’s hardware. It differs from Virtual Server 2005, which is a “type 2″ or “hosted” virtualization product that has to run on top of a host operating system (e.g., Windows Server 2003) and doesn’t have direct access to the hardware.

The standalone version of Hyper-V will run on “bare metal” — that is, you don’t have to install it on an underlying host operating system. This can be cost effective; however, you lose the ability to run additional server roles on the physical machine. And without the Windows Server 2008 host, you don’t have a graphical interface. The standalone Hyper-V Server must be administered from the command line.

Note

Hyper-V Server 2008 is based on the Windows Server 2008 Server Core but does not support the additional roles (DNS server, DHCP server, file server, etc.) that Server Core supports. However, since they share the same kernel components, you should not need special drivers to run Hyper-V.

Standalone Hyper-V also does not include the large memory support (more than 32 GB of RAM) and support for more than four processors that you get with the Enterprise and DataCenter editions of Windows Server 2008. Nor do you get the benefits of high availability clustering and the Quick Migration feature that are included with the Enterprise and DataCenter editions.

#2: System requirements

It’s important to note that Hyper-V Server 2008 is 64-bit only software and can be installed only on 64-bit hardware that has Intel VT or AMD-V virtualization acceleration technologies enabled. Supported processors include Intel’s Pentium 4, Xeon, and Core 2 DUO, as well as AMD’s Opteron, Athlon 64, and Athlon X2. You must have DEP (Data Execution Protection) enabled (Intel XD bit or AMD NX bit). A 2 GHz or faster processor is recommended; minimum supported is 1 GHz.

Note

Although Hyper-V itself is 64-bit only, the guest operating systems can be either 32-bit or 64-bit.

Microsoft states minimum memory requirement as 1 GB, but 2 GB or more is recommended. Standalone Hyper-V supports up to 32 GB of RAM. You’ll need at least 2 GB of free disk space to install Hyper-V itself, and then the OS and applications for each VM will require additional disk space.

Also be aware that to manage Hyper-V from your workstation, you’ll need Vista with Service Pack 1.

#3: Licensing requirements

Windows Server 2008 Standard Edition allows you to install one physical instance of the OS plus one virtual machine. With Enterprise Edition, you can run up to four VMs, and the DataCenter Edition license allows for an unlimited number of VMs.

The standalone edition of Hyper-V, however, does not include any operating system licenses. So although an underlying host OS is not needed, you will still need to buy licenses for any instances of Windows you install in the VMs. Hyper-V (both the Windows 2008 version and the standalone) support the following Windows guest operating systems: Windows Server 2008 x86 and x64, Windows Server 2003 x86 and x64 with Service Pack 2, Windows 2000 Server with Service Pack 4, Vista x86 and x64 Business, Enterprise, and Ultimate editions with Service Pack 1, and XP Pro x86 and x64 with Service Pack 2 or above. For more info on supported guests, see Knowledge Base article 954958.

Hyper-V also supports installation of Linux VMs. Only SUSE Linux Enterprise Server 10, both x86 and x64 editions, is supported, but other Linux distributions are reported to have been run on Hyper-V. Linux virtual machines are configured to use only one virtual processor, as are Windows 2000 and XP SP2 VMs.

#4: File format and compatibility

Hyper-V saves each virtual machine to a file with the .VHD extension. This is the same format used by Microsoft Virtual Server 2005 and Virtual PC 2003 and 2007. The .VHD files created by Virtual Server and Virtual PC can be used with Hyper-V, but there are some differences in the virtual hardware (specifically, the video card and network card). Thus, the operating systems in those VMs may need to have their drivers updated.

If you want to move a VM from Virtual Server to Hyper-V, you should first uninstall the Virtual Machine Additions from the VM while you’re still running it in Virtual Server. Then, shut down the VM in Virtual Server (don’t save it, because saved states aren’t compatible between VS and Hyper-V).

VMware uses the .VMDK format, but VMware images can be converted to .VHD with the System Center Virtual Machine Manager (referenced in the next section) or by using the Vmdk2Vhd tool, which you can download from the VMToolkit Web site.

Note

Citrix Systems supports the .VHD format for its XenServer, and Microsoft, Citrix, and HP have been collaborating on the Virtual Desktop Infrastructure (VDI) that runs on Hyper-V and utilizes both Microsoft components and Citrix’s XenDesktop.

#5: Hyper-V management

When you run Hyper-V as part of x64 Windows Server 2008, you can manage it via the Hyper-V Manager in the Administrative Tools menu. Figure A shows the Hyper-V console.

Figure A: The Hyper-V Management Console in Server 2008

hyper-v console

The Hyper-V role is also integrated into the Windows Server 2008 Server Manager tool. Here, you can enable the Hyper-V role, view events and services related to Hyper-V, and see recommended configurations, tasks, best practices, and online resources, as shown in Figure B.

Figure B: Hyper-V is integrated into Server Manager in Windows Server 2008.

hyper-v

The Hyper-V management tool (MMC snap-in) for Vista allows you to remotely manage Hyper-V from your Vista desktop. You must have SP1 installed before you can install and use the management tool. You can download it for 32-bit Vista or 64-bit Vista.

Tip

If you’re running your Hyper-V server and Vista client in a workgroup environment, several configuration steps are necessary to make the remote management tool work. See this article for more information.

Hyper-V virtual machines can also be managed using Microsoft’s System Center Virtual Machine Manager 2008, along with VMs running on Microsoft Virtual Server and/or VMware ESX v3. By integrating with SCCM, you get reporting, templates for easy and fast creation of virtual machines, and much more. For more information, see the System Center Virtual Machine Manager page.

Hyper-V management tasks can be performed and automated using Windows Management Instrumentation (WMI) and PowerShell.

#6: Emulated vs. synthetic devices

Users don’t see this terminology in the interface, but it’s an important distinction when you want to get the best possible performance out of Hyper-V virtual machines. Device emulation is the familiar way the virtualization software handles hardware devices in Virtual Server and Virtual PC. The emulation software runs in the parent partition (the partition that can call the hypervisor and request creation of new partitions). Most operating systems already have device drivers for these devices and can boot with them, but they’re slower than synthetic devices.

The synthetic device is a new concept with Hyper-V. Synthetic devices are designed to work with virtualization and are optimized to work in that environment, so performance is better than with emulated devices. When you choose between Network Adapter and Legacy Network Adapter, the first is a synthetic device and the second is an emulated device. Some devices, such as the video card and pointing device, can be booted in emulated mode and then switched to synthetic mode when the drivers are loaded to increase performance. For best performance, you should use synthetic devices whenever possible.

#7: Integration Components

Once you’ve installed an operating system in a Hyper-V virtual machine, you need to install the Integration Components. This is a group of drivers and services that enable the use of synthetic devices by the guest operating system. You can install them on Windows Server 2008 by selecting Insert Integration Services Setup Disk from the Action menu in the Hyper-V console. With some operating systems, you have to install the components manually by navigating to the CD drive.

#8: Virtual networks

There are three types of virtual networks you can create and use on a Hyper-V server:

  • Private network allows communication between virtual machines only.
  • Internal network allows communication between the virtual machines and the physical machine on which Hyper-V is installed (the host or root OS).
  • External network allows the virtual machines to communicate with other physical machines on your network through the physical network adapter on the Hyper-V server.

To create a virtual network, in the right Actions pane of the Hyper-V Manager (not to be confused with the Action menu in the toolbar of the Hyper-V console or the Action menu in the VM window), click Virtual Network Manager. Here, you can set up a new virtual network, as shown in Figure C.

Figure C: Use the Virtual Network Manager to set up private, internal, or external networks.

virtual network manager

Note that you can’t use a wireless network adapter to set up networking for virtual machines, and you can’t attach multiple virtual networks to the same physical NIC at the same time.

#9: Virtual MAC addresses

In the world of physical computers, we don’t have to worry much about MAC addresses (spoofing aside). They’re unique 48-bit hexadecimal addresses that are assigned by the manufacturer of the network adapter and are usually hardwired into the NIC. Each manufacturer has a range of addresses assigned to it by the Institute of Electrical and Electronics Engineers (IEEE). Virtual machines, however, don’t have physical addresses. Multiple VMs on a single physical machine use the same NIC if they connect to an external network, but they can’t use the same MAC address. So Hyper-V either assigns a MAC address to each VM dynamically or allows you to manually assign a MAC address, as shown in Figure D.

Figure D: Hyper-V can assign MAC addresses dynamically to your VMs or you can manually assign a static MAC address.

MAC addresses

If there are duplicate MAC addresses on VMs on the same Hyper-V server, you will be unable to start the second machine because the MAC address is already in use. You’ll get an error message that informs you of the “Attempt to access invalid address.” However, if you have multiple virtualization servers, and VMs are connected to an external network, the possibility of duplicate MAC addresses on the network arises. Duplicate MAC addresses can cause unexplained connectivity and networking problems, so it’s important to find a way to manage MAC address allocation across multiple virtualization servers.

#10: Using RDP with Hyper-V

When you use a Remote Desktop Connection to connect to the Hyper-V server, you may not be able to use the mouse or pointing device within a guest OS, and keyboard input may not work properly prior to installing the Integration Services. Mouse pointer capture is deliberately blocked because it behaves erratically in this context. That means during the OS installation, you will need to use the keyboard to input information required for setup. And that means you’ll have to do a lot of tabbing.

If you’re connecting to the Hyper-V server from a Windows Vista or Server 2008 computer, the better solution is to install the Hyper-V remote management tool on the client computer.

Additional resources

Hyper-V is getting good reviews, even from some pundits who trend anti-Microsoft. The release of the standalone version makes it even more attractive. IT pros who want to know more can investigate the Microsoft Learning resources related to Hyper-V technology, which include training and certification paths, at the Microsoft Virtualization Learning Portal.

Posted 03/10/2012 by Petri in Hyper-V

Importing Virtual Machines Windows 8 Client Hyper-V   2 comments


If you have previously saved virtual machines from another Hyper-V environment, it is pretty simple to import them. For my test lab, I downloaded an Ubuntu virtual machine appliance, a preconfigured virtual machine that should be ready to go. Sometimes you can also find preconfigured virtual machines from Microsoft that you can use for testing and evaluation purposes. The import process should be the same regardless.

First, in the Hyper-V manager, click the Import Virtual Machine action, as seen below in Figure 1.

Hyper-V Import Virtual Machine

It’s your choice whether you want to see this page every time you run an import. I’ll go ahead and click Next. This is where I’ll specify the path to the virtual machine. All I had to do is browse to the top-level folder that had the config.xml file. Figure 2 shows my path.

Hyper-V virtual machine folder

The wizard found one virtual machine for me to import, as seen below in figure 3.

Hyper-V select virtual machine

Next, I need to decide how to register the virtual machine with this Hyper-V “server.” Figure 4 shows my options.

Hyper-V register virtual machine

The choice might depend on what your plans are for the virtual machine. Since I’ll likely only ever use this VM for this tutorial, I’m going to use the default Register option. If I was importing a previously created VM, say from a backup of this computer, then I would most likely use the Restore option. The ID is critical, especially if you are using any third-party Hyper-V management tools, since in a restore process you would want to retain the original ID. Of course, if you want to get a new and unique ID, then select the Copy option.

After clicking Next, the import wizard offers you a summary of what it is about to do.

Hyper-V virtual machine summary

So far so good, so I’ll finish the wizard. After the import, the new virtual machine is displayed in the Hyper-V manager as seen below in figure 6.

Hyper-V virtual machine in manager

Now, before I get ahead of myself and fire up the VM, I’m going to check the settings. I can either right-click the virtual machine and select Settings from the context menu or click it in the Actions pane. Figure 7 shows the current settings.

Hyper-V virtual machine settings

From here I could modify settings if necessary. Perhaps I don’t want to allocate 2GB of memory. Or, in the case of this particular virtual machine, I’ll need to manually add a network adapter. As you can see below in Figure 8, I can add the new adapter to my previously defined virtual switches.

Hyper-V add network adapter

I want this VM to be on the network, so I’m going to choose the Work network. I’ll accept all the other network adapter defaults for now.

At this point I’m ready to fire up the virtual machine. But because I imported this from a previously created machine, I know that Hyper-V will make some changes the first time I start it on this computer. This is especially true of virtual machines running Windows operating systems. So before I fire it up, I’m going to take snapshot either from the right-click context menu or the Actions pane. This allows me to start over without having to reimport the machine and reconfigure.

Now I’m finally ready to start it again, either from the context or actions menu. Figure 9 shows my new virtual machine in action.

hyper-v virtual machine

To use the virtual machine interactively all I need to do is connect to it. I can click the Connectlink in the Actions menu or double-click the virtual machine name. Hyper-V will then create a session to the virtual machine console as you can see in Figure 10.

Hyper-V connect to virtual machine

I can log on, and just like that I am running Ubuntu! Now, the goal of this article wasn’t necessarily to run Ubuntu in Windows 8. I wanted to demonstrate how to import a virtual machine. I could have just as easily imported a previously created virtual machine that ran a Windows operating system. The process is still the same as I demonstrated here.

Posted 03/10/2012 by Petri in Hyper-V

Configuring a Virtual Switch Windows 8 Client Hyper-V   Leave a comment


We need to configure networking. In the Hyper-V Manager, click Virtual Switch Manager link in the Actions pane. You should see something like Figure 1.

Hyper-V Virtual Switch Manager

You can create any number of switches from a variety of types, but because this is on a client operating system you may not need more than one or two. The type of switch to define depends on how you expect to use your virtual machines. If you are creating a VM that needs access to the physical network and resources then you’ll need an external switch. If you only need to communicate between the client and the VM then you can use an internal switch. The virtual machine won’t be accessible from nor can it reach the physical network. Another option is to use a private switch that is only accessible by your virtual machines. If your virtual machines will have multiple network interfaces you use these switches in any combination that you require.

In my situation, I want my virtual machines to access the network, so I’m going to create an external switch. I highlight “External” and click Create Virtual Switch. The result is Figure 2.

Hyper-V Create External Switch

I’ll go ahead and give my switch a name. You can see a drop-down list under Connection Type. This is for the different physical network adapters in my computer. Virtual network traffic will be bound to this adapter. The rest of the defaults are fine for me.

When you go to apply the settings you might get a warning, as seen below in Figure 3.

Hyper-V Apply Networking Changes warning

Basically there’s a chance your computer will drop off the network momentarily — don’t be doing anything important while configuring virtual networking! My new switch can be seen in Figure 4.

Hyper-V New Switch

Click the little + sign next to the switch name to expand the switch, and then selectExtensions. You should get Figure 5.

Hyper-V Extensions

These extensions are used by vendors, as well as Microsoft, to offer ways to hook into network traffic. For example, I might want to be able to capture packets, so I’m going to enable the Microsoft NDIS Capture extension. Again, you might get a warning about potential network interruptions.

Because I’m thinking I might test some services that require a private network for things like heartbeat, I’m going to go ahead and also set up a private switch. My final results are in Figure 6.

Hyper-V private Switch

If at some point in the future you need to delete a switch, simply select it and you should see a Remove button. For those of you who would like to dig into the technical details of these virtual switches take a look at Microsoft’s Hyper-V virtual switch overview.

That just about wraps up configuration. There is an option to configure a virtual fibre channel connection to a SAN, but this is of no use to me since I have no physical fibre channel connections. In the next installment of this series, we’ll get some virtual machines going.

Posted 03/10/2012 by Petri in Hyper-V