次の方法で共有


Use an Internal Virtual Network to Move Files to a Virtual Machine

Applies To: Windows Server 2008 R2

In some circumstances, you might not want to connect a virtual machine to an external network. For example, you might want to isolate a virtual machine from your domain network to test a Dynamic Host Configuration Protocol (DHCP) server or a domain controller. Because the virtual machine is isolated, you cannot move files from the virtualization server to the virtual machine by using the domain network. To overcome this limitation, you can use an internal virtual network.

Note

Alternatively, you can create and attach a virtual hard disk on the virtualization server, copy to the virtual hard disk the files that you want to move to the virtual machine, and then attach the virtual hard disk to the virtual machine. Unfortunately, this alternative method requires attaching and detaching a virtual hard disk, which temporarily disrupts access to the virtual hard disk from the virtualization server or from the virtual machine. For more information, see Connect a Virtual Hard Disk to a Virtual Machine Without Shutting It Down, in this guide.

An internal virtual network connects the virtualization server and the virtual machines that are running on it. It does not provide access to a physical network connection like an external virtual network does. Also, it does not isolate the virtual machines completely like a private virtual network does.

Scenario prerequisites

To test this scenario, you will need the following:

  • Complete all steps in the main section of this guide. After you complete all the steps, you will have a virtualization server and two virtual machines: Base Virtual Machine (used for creating new virtual machines) and Imported Virtual Machine. Also, you will have an internal virtual network to use in this scenario.

  • Imported Virtual Machine is running, Windows Server 2008 R2 is configured, and the computer name for the virtual machine is VirtualMachine1.

Scenario steps

The following procedure explains how to configure the virtualization server and the new virtual machine that you created so that they can share files over an internal virtual network.

To use an internal virtual network to share files with the virtual machine

  1. On the virtualization server, open Hyper-V Manager. Click Start, point to Administrative Tools, and then click Hyper-V Manager.

  2. Connect the virtual machine to the internal virtual network as follows:

    1. In Hyper-V Manager, under Virtual Machines, right-click Imported Virtual Machine, and then click Settings. The Settings for Imported Virtual Machine dialog box appears.

    2. In the left navigation pane, click Network Adapter.

    3. In the Network list, click Internal Network, and then click OK.

      The virtual machine is now isolated from all computers that are connected to the external network, and it can no longer communicate with the virtualization server over the external network.

  3. On the virtualization server, assign the static IP address 33.0.0.100 to the network adapter that was created for the internal virtual network as follows:

Important

If your workgroup or domain network uses IP addresses in the same range as 33.0.0.100, use a different IP address.

1.  Click **Start**, in the **Search programs and files** box type **View network connections**, and then press ENTER. The **Network Connections** window appears.  
      
2.  Right-click the network adapter that is connected to **Internal Network**, and then click **Properties**. If the **User Account Control** dialog box appears, click **Continue**. The **Properties** dialog box for the network adapter appears.  
      
3.  In the list of connection items, double-click **Internet Protocol Version 4 (TCP/IPv4)**. The **Internet Protocol Version 4 (TCP/IPv4) Properties** dialog box appears.  
      
4.  On the **General** tab, click **Use the following IP address**.  
      
5.  In the **IP address** box, type **33.0.0.100**.  
      
6.  In the **Subnet mask** box, type **255.255.255.0**.  
      
7.  Leave all other fields blank, and click **OK**.  
      
8.  In the **Properties** dialog box for the network adapter, click **OK**.  
      
9.  Close the **Network Connections** window.  
      
  1. On the virtual machine, assign the network adapter the static IP address 33.0.0.2 in the same way that you assigned the IP address on the virtualization server.

Important

If you assigned the network adapter on the virtualization server an IP address that is not 33.0.0.100, use an IP address for the virtual machine that is on the same subnet as the IP address that you used for the virtualization server.

  1. On the virtual machine, share a folder that can be used to move files to and from the virtualization server, and turn on network discovery and file sharing for all public networks as follows:

    1. On the virtual machine, open Windows Explorer. Click Start, point to All Programs, click Accessories, and then click Windows Explorer. The Windows Explorer window opens.

    2. Browse to the root folder of drive C. In the address box, type C:, and then press ENTER.

    3. Create a new folder to share. On the menu bar, click New folder. The new folder is created and the Name field is automatically selected for renaming the folder.

    4. To specify a name for the new folder, type Transfer, and then press ENTER.

    5. Right-click the Transfer folder, point to Share with, and then click Specific people. The File Sharing dialog box appears.

    6. To start sharing the folder, click Share. The Network discovery and file sharing dialog box appears.

    7. In the Network discovery and file sharing dialog box, click No, make the network that I am connected to a private network.

    8. After the folder is shared, click Done.

  2. On the virtualization server, open Windows Explorer, and browse to the shared folder on the virtual machine as follows:

    1. On the virtualization server, open Windows Explorer as you did on the virtual machine.

    2. In the address box, type \\VirtualMachine1\Transfer, and then press ENTER.

Note

If you prefer, you can type the IP address of the virtual machine instead of the computer name.

3.  If a dialog box appears that prompts you to enter a user name and password, in the **User name** box type **VirtualMachine1\\Administrator**, and then type the password for the **Administrator** account on the virtual machine.  
      
  1. Use Windows Explorer on the virtualization server and on the virtual machine to test moving files from one computer to the other.