Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

Windows Server 2008 R2 : Build Virtual Machines (part 4) - Import & Export a Virtual Machine

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
6/21/2011 4:20:34 PM

7. Import a Virtual Machine

One of the things you will love about virtual machines is that they are really pretty portable. When it comes right down to it, a virtual machine and a virtual hard disk are easy to move. It is easy to see some of the reasons you might want to import virtual machines. Imagine Microsoft is releasing a new operating system. You decide you would like to try it before you buy it. What if Microsoft made a VHD file available for you to load in Hyper-V so you could try the new operating system? This is actually happening today. Or imagine a situation where you are a software developer, and you have a standard development environment you use for testing. Why not build that environment in Hyper-V, export those files from the machine where they were built, and then import them on other machines throughout your development network?

You can import virtual machines using two different methodologies. The method you choose really depends on what you have to work with to begin with.

If you have a .vhd file and no settings information, you will create a new virtual machine using the Virtual Machine Creation Wizard. When you are given the option for creating a virtual hard disk or using an existing virtual hard disk, simply locate the VHD file and create the virtual machine.

Now if you are lucky, you will have more than just the VHD, and you might have the settings files associated with the virtual machine as well. If this is the case, you don't need to create a new virtual machine. You already have the virtual machine, so you just need to get that virtual machine and its settings associated with Hyper-V Manager and running on this server. It is important to remember that virtual machines can be reused or imported to more than a single Hyper-V server. To import a virtual machine more than once, it is important that when you import, you make a copy of the virtual machine files so that the VM can be imported again elsewhere. To accomplish this task, you use the import tool in the Actions pane.

  1. Open the Hyper-V Manager.

  2. Click Import Virtual Machine in the Actions pane.

  3. In the Import Virtual Machine Wizard, shown in Figure 21, browse to the location of the virtual machine.

  4. Select the desired import settings.

Figure 21. Importing a virtual machine

Remember that a virtual machine will stay in the directory from which it is imported. If you want the virtual machine to be housed in a specific location on your server, you need to copy it there before you import it to Hyper-V. Once you have imported the VM, it cannot be moved. Importing a virtual machine is a great way to configure a virtual machine with limited up-front configuration work. What if you had taken the time to build a great virtual machine and wanted to save it so that it could be used again, perhaps on another server in your network? You would want to export that virtual machine.

8. Export a Virtual Machine

The process of exporting a virtual machine is really the process of saving the name, configuration, VHD, and snapshots associated with a virtual machine. You have already seen how virtual machines are named, how the virtual hard disks are created, and how to make snapshots. The only part of the export process you have not seen is that although each virtual machine has a canonical name that you configured, each virtual machine also has a globally unique identifier (GUID), and each snapshot that you make also has its own unique GUID. Armed with this information, you can begin the process of exporting a virtual machine.

  1. Open the Hyper-V Manager.

  2. Select the virtual machine you want to export.

  3. Click Export in the virtual machine section of the Actions pane.

  4. In the dialog box that opens, shown in Figure 22, provide a directory location to save the virtual machine.

  5. Click Export.

Figure 22. Export directory location

Depending on the size of the virtual machine and its contents, this process can take some time, so be patient. There is no status bar to tell you how much of the export has completed.

During the export process, a new file will be created in the directory you chose for the export directory. The new file will be named with the name of the virtual machine. Inside the new file will be a series of subfolders:

Virtual Machines This folder will contain an export (.exp) file named for the GUID of the virtual machine. There is also an additional folder here that can be used for an additional .exp file for machines that were exported in their saved state configuration.

Virtual Hard Disks This folder will contain a copy of each of the virtual hard disks associated with the virtual machine.

Snapshots This folder will contain an .exp file for each of the snapshots you created in the virtual machine. There are some additional folders here named after the snapshot IDs for any saved state snapshot data and a folder named after the virtual machine ID that will contain the AVHD files for the snapshots.

Once the export has completed, you can use the files in the export directory at will. You can copy them, move them, save them to DVDs (if they are small enough), compress them (if they are not small enough), and of course import them.

While talking about importing, we said that if you want to import a virtual machine more than once, you need to copy all the associated files. The reason for this is that during import Hyper-V will delete the EXP files and replace them with XML files. If there are no EXP files, then the virtual machine cannot be imported. If you plan on using a virtual machine more than once, then you will need to copy the exported virtual machine and its associated EXP files to be certain it can be imported again.

Other -----------------
- Windows Server 2008 R2 : Build Virtual Machines (part 3) - Install an Operating System & Use Snapshots
- Windows Server 2008 R2 : Build Virtual Machines (part 1) - Create a Virtual Machine & Create Virtual Hard Disks
- Windows Server 2008 R2 : Maintaining Virtual Machines - Understand Virtualization with Hyper-V
- Troubleshooting Technologies That Support Exchange Server 2003 (part 2)
- Troubleshooting Technologies That Support Exchange Server 2003 (part 1)
- Troubleshooting Microsoft Exchange Server 2003 : Troubleshooting Security
- Windows Server 2008 R2 : View Server Events - Work with the Event Viewer
- Windows Server 2008 R2 : View Server Performance Data (part 2) - Understand Performance Monitor
- Windows Server 2008 R2 : View Server Performance Data (part 1) - Create a System Health Report
- Microsoft Dynamics CRM 2011 : Working with Activities and Notes - Managing Your Activities
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server