3.3. 将 Windows XP 作为全虚拟客户端安装

可将 Windows XP 作为全虚拟客户端安装。这部分论述了如何在 Linux 中将 Windows XP 作为全虚拟客户端安装。

进行此操作前请确定您可以作为根用户访问。

  1. Starting virt-manager

    Open Applications > System Tools > Virtual Machine Manager. Open a connection to the host (click File > Open Connection). Click the New button to create a new virtual machine.

  2. 为您的虚拟系统命名

    输入「系统名称」并点击 前进 按钮。

    3.3. 将 Windows XP 作为全虚拟客户端安装 - 图1

  3. 选择虚拟化方法

    If you selected KVM or Xen earlier (step 步骤 1 ) you must use the hypervisor you selected. This example uses the KVM hypervisor.

    只能使用全虚拟化安装 Windows。

    3.3. 将 Windows XP 作为全虚拟客户端安装 - 图2

  4. 选择安装方法

    这一步可让您指定操作系统的安装方法和类型。

    如果使用 CD-ROM 或者 DVD 安装,请选择有 Windows 安装磁盘的设备。如果您选择「ISO 映像位置」,请输入 Windows 安装 .iso 映像的路径。

    请在「操作系统类型」列表中选择「Windows」,在「操作系统变体」列表中选择「微软 Windows XP」

    本章不包括 PXE 安装。

    3.3. 将 Windows XP 作为全虚拟客户端安装 - 图3

    Press Forward to continue.

    Image files and SELinux

    For ISO image files and guest storage images the the recommended to use the /var/lib/libvirt/images/ directory. Any other location may require additional configuration for SELinux, refer to 第 7.1 节 “SELinux 和虚拟化” for details.

  5. The Assigning storage space window displays. Choose a disk partition, LUN or create a file based image for the guest storage.

    The convention for file based images in Fedora is that all file based guest images are in the /var/lib/libvirt/images/ directory. Other directory locations for file based images are prohibited by SELinux. If you run SELinux in enforcing mode, refer to 第 7.1 节 “SELinux 和虚拟化” for more information on installing guests.

    Your guest storage image should be larger than the size of the installation, any additional packages and applications, and the size of the guests swap file. The installation process will choose the size of the guest’s swap file based on size of the RAM allocated to the guest.

    Allocate extra space if the guest needs additional space for applications or other data. For example, web servers require additional space for log files.

    3.3. 将 Windows XP 作为全虚拟客户端安装 - 图4

    Choose the appropriate size for the guest on your selected storage type and click the Forward button.

    注意

    建议您使用默认目录保存虚拟机映像,默认目录为 /var/lib/libvirt/images/。如果您要使用不同的位置(比如在本示例中使用 /images/),请确定将其添加到 SELinux 策略中并在您继续安装前对其进行重新标记(后面会介绍如何修改 SELinux 策略)。

  6. Network setup

    Select either Virtual network or Shared physical device.

    The virtual network option uses Network Address Translation (NAT) to share the default network device with the virtualized guest. Use the virtual network option for wireless networks.

    The shared physical device option uses a network bond to give the virtualized guest full access to a network device.

    3.3. 将 Windows XP 作为全虚拟客户端安装 - 图5

    Press Forward to continue.

  7. The Allocate memory and CPU window displays. Choose appropriate values for the virtualized CPUs and RAM allocation. These values affect the host’s and guest’s performance.

    虚拟客户端需要足够的内存(RAM)才可有效运行。选择适合您客户端操作系统和应用程序需要的内存值。大多数操作系统需要至少 512MB 内存才可工作。请记住:客户端使用的是物理 RAM。运行太多客户端或者留给主机系统的内存不足将导致过量使用虚拟内存和交换。虚拟内存速度要慢很多从而降低系统性能和反应速度。确定您为所有客户端和主机分配了足够的内存以便其有效操作。

    Assign sufficient virtual CPUs for the virtualized guest. If the guest runs a multithreaded application assign the number of virtualized CPUs it requires to run most efficiently. Do not assign more virtual CPUs than there are physical processors (or hyper-threads) available on the host system. It is possible to over allocate virtual processors, however, over allocating has a significant, negative affect on guest and host performance due to processor context switching overheads.

    3.3. 将 Windows XP 作为全虚拟客户端安装 - 图6

  8. 在继续安装前您会看到小结页面。按 完成 按钮执行安装:

    3.3. 将 Windows XP 作为全虚拟客户端安装 - 图7

  9. 您必须选择硬件,因此请在安装开始后迅速打开一个控制台窗口。点击 完成 按钮后切换到 virt-manager 概述窗口,并选择您新启动的 Windows 客户端。双击系统名称则会打开控制台窗口。迅速重复按 F5 键来选择新的 HAL,当您在 Windows 安装中看到对话框时,请选择 ‘普通 i486 平台‘ 标签(您可以使用 Up 和 Down 箭头键在选项中进行滚动选择)。

    3.3. 将 Windows XP 作为全虚拟客户端安装 - 图8

  10. 使用标准 Windows 安装继续安装。

    3.3. 将 Windows XP 作为全虚拟客户端安装 - 图9

    3.3. 将 Windows XP 作为全虚拟客户端安装 - 图10

  11. 看到提示后对硬盘进行分区。

    3.3. 将 Windows XP 作为全虚拟客户端安装 - 图11

    3.3. 将 Windows XP 作为全虚拟客户端安装 - 图12

  12. 格式化驱动器后,Windows 会开始将文件复制到硬盘中。

    3.3. 将 Windows XP 作为全虚拟客户端安装 - 图13

    3.3. 将 Windows XP 作为全虚拟客户端安装 - 图14

  13. 将文件复制到存储设备中,现在重启 Windows。

    3.3. 将 Windows XP 作为全虚拟客户端安装 - 图15

  14. 重启您的 Windows 客户端:

    1. # virsh start WindowsGuest

    其中 WindowsGuest 是您的虚拟机名称。

  15. 打开控制台窗口时,您将看到 Windows 安装的设置阶段。

    3.3. 将 Windows XP 作为全虚拟客户端安装 - 图16

  16. 如果您的安装看起来停滞在设置阶段,您可以使用 virsh reboot *`WindowsGuestName`* 重启该客户端。这样通常可使得安装继续进行。您重启虚拟机后会看到如下信息:Setup is being restarted

    3.3. 将 Windows XP 作为全虚拟客户端安装 - 图17

  17. 完成设定后,您会看到 Windows 引导屏幕:

    3.3. 将 Windows XP 作为全虚拟客户端安装 - 图18

  18. 您现在可以继续对您的 Windows 安装进行标准设定:

    3.3. 将 Windows XP 作为全虚拟客户端安装 - 图19

  19. 设置过程已完成,出现 Windows 桌面。

    3.3. 将 Windows XP 作为全虚拟客户端安装 - 图20