Networking and Using Windows XP Mode
First Time Use of Windows XP Mode
Windows® XP Mode is a Virtual Machine (VM) created by Windows Virtual PC on Windows 7 host. Just as with any new PC you acquire, you would want to connect it to the network, maintain it securely, connect and use USB devices such as printers, storage devices and smartcards. When you launch the Windows XP Mode VM from Windows 7® Start menu for the first time after setup, you will notice that the VM is already connected to the network and is ready to use:
- You can domain join the VM same way you would join a physical Windows XP host to a domain.
- You can install applications which require network connection, such as Internet Explorer for example, and use them right away, both in a full VM and as virtual applications.
- Similarly, you can easily attach USB devices to the VM and use them.
- Maintenance of a Windows XP Mode VM which is connected to the network is similar to maintaining a physical Windows XP desktop, using Windows Updates.
In this article, we will look at the usage of these features in more detail.
Networking a Windows XP Mode VM
The default network setting of Windows XP Mode is NAT (Network Address Translation), but you can change it. NAT allows the host machine to act as an agent between the external network (e. g. Corpnet or Internet) and the VMs running on that host. The network will use the host's IP address itself, which represents the group of VMs on that host, to communicate with the VMs. The host can resolve the network packets to the specific VM they are intended for, using port numbers. This is why, the Windows XP Mode VM, using NAT as the default configuration, is ready to connect to the network upon first launch. However, note that the network communication has to be initiated first by the NAT configured VM. In VM settings in Windows XP Mode (Fig. 1), you can specify up to four emulated network adapter options, which can be assigned to any network card installed on the physical computer.
To change this configuration, the Settings dialog box shown in Fig. 1 can be accessed using ‘Settings’ option under ‘Tools’ element from the VM Window’s toolbar. When you click on the ‘Networking’ setting, you will find the following four options to choose from:
- Shared Networking (NAT) option shown in Figure 1 (Left) refers to a virtual NAT (Network Address Translation) which allows the VM to leverage the external TCP/IP network connected to the host. This is very useful if you regularly move the host computer between different network configurations. NAT is the preferred networking option when there is a shortage of IP addresses, a need to ensure the VM’s IP address is not targetable from an external network, or a need for connecting using WWAN.
- In contrast, Bridge mode uses the network adapter on the host. This option appears in the drop down menu as the name of the adapter. In Figure 1 (Right), it is shown as Intel® 82566DM-2 Gigabit Network Connection under Adapter 1. The VM is connected directly to the selected network connection of the Windows 7 host, and will behave like a separate physical computer on the same network. If the host has a wireless adapter, its name will appear in the dropdown list. In Bridge mode, Virtual Machine Network Services driver helps redirect the incoming network traffic to the correct VM and associate the correct MAC address in all outbound network traffic. In scenarios using VPN, Bridge mode is the preferred option.
- Choosing the option ‘Not connected’ disables the VM’s networking ability and completely isolates it from the network.
- ‘Internal Network’ option enables networking among only the VMs on the single Windows 7 host.
Figure 1. Settings dialog box to configure a VM’s networking adapters as (a) Shared Networking (NAT) on the Left, or (b) Bridged mode on the Right
Windows Virtual PC (WVPC) emulates up to 4 DEC/Intel 21140A-based Ethernet cards per VM, each with its own unique MAC address. WVPC translates the instructions executed by the Windows XP network driver into network activity. Because the packets are handled as Ethernet packets, WVPC is protocol agnostic and can support protocols other than TCP/IP. All VMs connected to a specific virtual network can access traffic sent from and received by any other VM on that same virtual network.
Maintaining a Windows XP Mode VM
Network connection is necessary to properly patch a Windows XP Mode VM with latest security patches etc. Just as a physical machine with Windows XP OS on the network, the Windows XP Mode VM has the capability to contact the WU (Windows Updates) server, find out the available updates, and install the required ones. You can configure the Windows Updates during the initial setup of Windows XP Mode (Figure 2). It is recommended that Automatic Update option is selected. The VM will get serviced based on the selection (Automatic Updates, Only download, Only Notify, or No updates). This capability should be used to service VM for regular Windows XP updates, which requires that the VM is running and has network connectivity.
Figure 2. Selecting Automatic Update option during Windows XP Mode setup and connecting the VM to network are recommended
If you are running only virtual applications, then any notification from WU (e. g. reboot required, updates downloaded and ready for installation, or updates available) will be relayed to the Windows 7 host machine. You will then be able to take the necessary action, such as closing all virtual applications, opening the Windows XP Mode as a full VM, downloading and installing the updates etc.
Other security best practices, including installing an anti-virus software, are essential to the healthy maintenance of Windows XP Mode VM as well. For example, consider running an application based on Internet Explorer® 6 (IE 6) as a virtual application in Windows XP Mode. In this case, it is necessary to install anti-virus software in the Windows XP Mode VM, to prevent, detect, and remove malware, such as computer viruses, worms, and trojan horses, adware and spyware.
Using USB and other Devices in Windows XP Mode
Printers, flash memory sticks, external hard disks and backup disks, followed by digital cameras and smartcards are USB devices important to business users. In a Windows XP Mode VM, USB devices can be used in two different ways: Sharing and Redirection. In the default mode with all integration features enabled (explained in the previous article), Storage devices, Printers and Smart cards can be used without having to redirect the device manually, by simply sharing it with the host. This requires that the device driver is available both in the Windows XP VM and on the host. If the driver is not available on Windows 7, the device can be redirected to the VM, using these steps (Figure 3A):
- Plug in the USB device to the system, and click on the USB icon of the virtual machine toolbar. The device is then listed in the drop down menu.
- Install the device driver inside the VM when prompted, and start using the device in Windows XP Mode.
In the above scenario, clicking on the device name redirects it to the VM. When the device is redirected to the VM, it is available to the VM but not to the host; when the device is released, it becomes available to the host again. Thus, at any point in time, the device is available either to the VM or the host but not both, as shown in Figure 3A. Here, a USB pen drive plugged into the PC is shown (as USB 2.0 in VM Tool Bar under USB option) attached to the VM, and appears as ‘Removable Disk (E:)’ in the VM’s ‘My Computer folder’. Note that this device does not appear in the host’s ‘Computer’ folder (shown to the left) anymore. After selecting the ‘Release’ option for this USB device in the VM Tool Bar, it is not exclusively attached to the VM anymore (Figure 3B), but becomes shared between the host and the VM. In Figure 3B, the same pen drive can be seen shared as drive letter F:\ in the VM, and as a USB device on the host as well. Sharing option is available only for Storage devices, Printers and Smart cards, whereas a variety of USB devices can be used in the VM via Redirection.
Figure 3A. USB Option Menu on the VM Tool Bar showing a USB pen drive exclusively attached to the VM
Figure 3B. USB Option Menu on the VM Tool Bar showing a USB pen drive shared between the VM and the host
Users can also attach USB devices to virtual applications directly from the Windows 7 task bar. This means USB devices, such as printers and flash drives, are available to applications running in Windows XP Mode, without the need to go into a full VM mode. In Figure 4, to attach a USB pen drive to a virtual application (Microsoft Project®), user right clicks on the VM icon on the Windows 7 task bar, and selects the ‘Manage USB Devices’ option, which displays the shared device as ‘USB 2.0’. User can access the necessary data from the USB device from within the virtual application in this manner.
Figure 4. Using a USB device from within a Windows XP Mode virtual application
Windows XP Mode also supports up to two communication ports, for COM port devices. Each of these ports (listed in Settings as COM1 and COM2; Figure 1) can support a physical serial device such as a modem, a named pipe as a means to transmit information using shared memory with another process, or log the output of the specified I/O communication to a text file. Parallel port devices are not supported, as they are relatively rare today.
Using the Networking and USB device features of Windows XP Mode and WVPC is simple. Maintenance of Windows XP Mode VM works the same way as the maintenance of any computer connected on a network. Check out Windows XP Mode RC Build today, and let us know what you think, either via the comments section here, or sharing your feedback on the WVPC and Windows XP Mode Forum on Technet here.
Principal Program Manager
Microsoft Virtualization Team