linux kvm 命令行安装Windows xp虚拟机(二)

简介: linux kvm 命令行安装Windows xp虚拟机

14,

15,设置administrator的密码

image.png

16,网络安装会失败,一会安装完了需要编写xml文件

image.png

17,确定一哈

image.png

18,

5e3c6c485ec24c4ab851f3b4df48802e.png

19,

85ed3a066a4645c696064bc0ced33aab.png

20,有驱动没有安装,尤其是网卡的,怎么办呢?

b31bf435f9a24ea499b34f7562fa6b2c.png

21,关机,修改配置文件,在开机,安装驱动就可以啦

关机前复制一份配置文件到/opt目录下

cp /etc/libvirt/qemu/xp-2.xml /opt/

关机命令:

1. virsh destroy xp-2
2. virsh undefine xp-2

关机后,修改一个单词,修改前:

<interface type='bridge'>
      <mac address='52:54:00:f2:2b:52'/>
      <source bridge='br0'/>
      <model type='e1000'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

修改model type= rtl8139,也就是这样的(修改后):

<interface type='bridge'>
      <mac address='52:54:00:f2:2b:52'/>
      <source bridge='br0'/>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

在通过该xml文件启动kvm镜像:

virsh create xp-2.xml

vnc 连接kvm镜像,IP+5956(端口是前面的安装命令定义过的哦)端口即可。

22,手动安装驱动

image.png

image.png

23,可以看到网卡驱动已经自动安装好了,pci可以不用管,不影响使用啦。

266ba33cd58949f981f54d8990988436.png

6ba7e0a2aed540b19faab89c73e76221.png

现在在其它的服务器上就可以远程连接这个kvm虚拟机啦(IP地址是192.168.217.132)

54262562909542fc8666dd18869b42a2.png

xsl文件的完整内容:

<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh edit xp-2
or other application using the libvirt API.
-->
<domain type='kvm'>
  <name>xp-2</name>
  <uuid>61ce1eca-a0cb-483d-835e-9ab1325d5aeb</uuid>
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
    <boot dev='cdrom'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
    </hyperv>
  </features>
  <cpu mode='custom' match='exact' check='partial'>
    <model fallback='allow'>SandyBridge</model>
  </cpu>
  <clock offset='localtime'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
    <timer name='hypervclock' present='yes'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/opt/winxp-2.img'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='floppy'>
      <driver name='qemu' type='raw'/>
      <source file='/opt/virtio-win-0.1.96_x86.vfd'/>
      <target dev='fda' bus='fdc'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='fdc' index='0'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:f2:2b:52'/>
      <source bridge='br0'/>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <input type='tablet' bus='usb'>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='5956' autoport='no' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='vga' vram='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
</domain>


目录
打赏
0
0
1
0
43
分享
相关文章
YashanDB Windows客户端安装
本文介绍YashanDB客户端(Windows)的安装、使用及卸载步骤。首先,下载并解压软件包至本地路径,配置环境变量。接着,通过cmd窗口使用yasql命令连接数据库,执行SQL操作。最后,卸载时删除相关环境变量和客户端目录。更多功能请参考官方文档。
YashanDB Windows客户端安装
【YashanDB知识库】使用vmware虚拟机安装的YashanDB,本机无法访问
在 VMware 虚拟机中安装并测试 YashanDB,数据库及虚拟机运行正常,但本地 IDE 工具无法连接虚拟机中的数据库。问题可能与 VMware 网络适配器配置或网络模式(如 NAT、桥接)有关,导致网络通信异常。需检查虚拟机网络设置、IP 地址配置以及防火墙规则,确保本地与虚拟机间网络连通性。目前无明确修复版本。
windows下和linux下cmake的规则有区别吗
通过合理使用CMake的条件逻辑和平台特定的配置选项,开发者可以编写更加灵活和健壮的CMake脚本,确保项目在Windows和Linux上的一致性和可移植性。
136 76
Windows 环境下 Odoo 安装保姆级教程
本教程详细介绍了在 Windows 系统上通过虚拟机部署 Odoo 的完整流程。首先确认硬件需求,确保 CPU、内存和磁盘空间满足最低配置;接着安装 VMware Workstation Pro 并创建 Ubuntu 虚拟机,配置桥接网络以实现主机与虚拟机的通信;随后借助微聚云快速安装预配置好的 Odoo 环境,简化复杂环境搭建;最后通过浏览器访问虚拟机 IP,完成 Odoo 数据库初始化及基础设置。整个过程清晰易懂,适合新手快速上手 Odoo 部署。
73 4
YashanDB Windows客户端安装
本文详细介绍了YashanDB客户端(Windows)的安装、使用与卸载步骤。安装部分包括解压软件包至本地路径,并配置系统环境变量;使用部分通过cmd窗口运行`yasql`命令连接远程数据库,执行相关操作;卸载部分则说明了删除环境变量及客户端目录的具体方法。更多功能可参考官方文档中的C驱动、imp、exp、yasldr和yasql工具说明。
YashanDB Windows客户端安装
【2025最新】VMware Workstation Pro 虚拟机配置与安装VMware Tools 感受它的强大~
VMware Tools 是 VMware 虚拟机中自带的一种增强工具,能够显著提升虚拟机的性能和用户体验。它提供了优化的显卡驱动程序、文件共享与拖放功能、时间同步以及跨虚拟机和宿主机的复制粘贴功能。安装 VMware Tools 可以让虚拟机在 VMware 平台上运行得更加高效,并且对于老旧系统(如 Win98、Win2000、WinXP)也能提供必要的驱动支持。每个虚拟机都需要独立安装与其操作系统版本相匹配的 VMware Tools,以确保最佳兼容性和性能表现。
150 6
【2025最新】VMware Workstation Pro 虚拟机配置与安装VMware Tools 感受它的强大~
Docker Desktop 4.38 安装与配置全流程指南(Windows平台)
Docker Desktop 是容器化应用开发与部署的一体化工具,支持本地创建、管理和运行 Docker 容器。4.38 版本新增 GPU 加速、WSL 2 性能优化和 Kubernetes 1.28 集群管理功能,适用于微服务开发和 CI/CD 流水线搭建。安装要求为 Windows 10 2004 及以上(64 位),需启用 Hyper-V 或 WSL 2。硬件最低配置为 4GB 内存、20GB 存储和虚拟化技术支持的 CPU。安装步骤包括启用系统功能、下载并运行安装程序,完成后配置镜像加速并验证功能。常见问题涵盖 WSL 2 安装不完整、磁盘空间清理及容器外网访问等。
2978 15
【独家揭秘2025】VMware Workstation Pro虚拟机:免费安装教程大放送,一键解锁操作系统模拟神器!
VMware Workstation Pro 是由威睿(VMware)公司开发的一款功能强大的桌面虚拟化软件,允许用户在同一台物理计算机上同时运行多个操作系统,如Windows、..
120 2
【独家揭秘2025】VMware Workstation Pro虚拟机:免费安装教程大放送,一键解锁操作系统模拟神器!
【YashanDB知识库】使用vmware虚拟机安装的YashanDB,本机无法访问
【YashanDB知识库】使用vmware虚拟机安装的YashanDB,本机无法访问
下一篇
oss创建bucket