7 Apr 2013

Windows 8 Client Hyper-V : Importing Virtual Machines

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.

If you recall from part one of this series, in which I installed and configured Hyper-V, my original intent in using Hyper-V on Windows 8 was to move from Oracle's VirtualBox. Next time we'll look at taking an existing VHD file and building a new virtual machine from it.

No comments:

Post a Comment