1. Installing the Software
1 234567 |
#在镜像制作服务器 安装qemu libvirtd 及window virt驱动
yum
install
libvirt libguestfs-tools qemu-kvm qemu-img
yum groupinstall Virtualization
"Virtualization Client"
-y
yum -y
install
libvirt libguestfs-tools -y
#window默认不支持virtio驱动,需要手动下载
yum -y
install
https:
//fedorapeople
.org
/groups/virt/virtio-win/repo/stable/virtio-win-0
.1.96-1.noarch.rpm
|
2. Download the disc image
123456 |
#window2008R2 ISO文件 \\10.10.0.3\Software\公共资源\软件\ISO\Windows2008r2\cn_windows_server_2008_r2_standard_enterprise_datacenter_and_web_with_sp1_x64_dvd_617598.iso #CloudbaseInitSetup \\10.10.0.3\Software\公共资源\软件\ISO\win2k8r2镜像制作软件包\CloudbaseInitSetup_x64.msi #wget https://www.cloudbase.it/downloads/CloudbaseInitSetup_x64.msi |
3. Create an empty disk file
1 |
qemu-img create -f qcow2 /tmp/win2008-work .qcow2 10G |
4. Start the virtual machine
123456789 |
virt-
install
--name win2k8-work --
ram
1024 --vcpus 1 \
--network network=default,model=virtio \
--disk=
/tmp/win2008-work
.qcow2,
format
=qcow2,device=disk,bus=virtio \
--cdrom=
/tmp/cn_windows_server_2008_r2_standard_enterprise_datacenter_and_web_with_sp1_x64_dvd_617598
.iso \
--disk=
/usr/share/virtio-win/virtio-win-0
.1.96.iso \
--disk=
/usr/share/virtio-win/virtio-win-0
.1.96_amd64.vfd,device=floppy \
--graphics spice,listen=0.0.0.0 --video qxl --channel spicevmc \
--os-
type windows --os-variant win2k8 --force
#注意:检查virtio-win-0.1.96_amd64.vfd和virtio-win-0.1.96.iso存放路径
|
123456 |
#命令执行结果 start installation ... Create a domain ...... | 0 b 00:00 run ' Virt-viewer --help '
|
5. Initializing the installation
12 |
#默认vnc/spice端口为5900,用VirtViewer客户端连接虚拟机 spice: //10 .10.2.168:5900 |
A. Successful connection
650) this.width=650; "width=" 650 "title=" 8fa01d35-8764-48d6-9fca-0eed0dc93a60.jpg "alt=" wKiom1WCZgjQDF89AAJ9Mb_ Hpzw671.jpg "src=" Http://s3.51cto.com/wyfs02/M02/6E/AE/wKiom1WCZgjQDF89AAJ9Mb_hPzw671.jpg "/>
B. When you install the operating system, you are promptedUnable to install Windows to this disk"or hint"no drives found"
650) this.width=650; "width=" 650 "title=" 23e66833-7c56-40ba-bbad-8b7367f64d13.jpg "alt=" Wkiol1wcz9iwr3gqaainioi3xxi506.jpg "src=" Http://s3.51cto.com/wyfs02/M00/6E/AA/wKioL1WCZ9iwr3gQAAIniOi3xxI506.jpg "/>
c. Click " Load Driver ", replace the drive
650) this.width=650; "width=" 650 "title=" 8053daff-006e-4b1c-b327-8dc419dc0894.jpg "alt=" wKiom1WCZlLSuDwPAAI_ 0dh2voe045.jpg "src=" Http://s3.51cto.com/wyfs02/M00/6E/AE/wKiom1WCZlLSuDwPAAI_0dh2VoE045.jpg "/>
d. Install " Red Hat VirtIO SCSI Controller (A:\amd64\Win2008E2\viostor.inf) "
650) this.width=650; "width=" 650 "title=" 9306791c-428e-4c57-81ec-448e8c3eb326.jpg "alt=" Wkiom1wcznlbpintaaii1zyzahc490.jpg "src=" Http://s3.51cto.com/wyfs02/M01/6E/AE/wKiom1WCZnLBpinTAAIi1zYzaHc490.jpg "/>
E. After waiting for disk drive installation, the 10G disk file that you just created appears, select the disk and click "Next"
650) this.width=650; "width=" 650 "title=" 44afe70c-c64a-40c8-9879-6f5d5ab2261b.jpg "alt=" Wkiol1wcaegsfgvnaai5mruxmgs230.jpg "src=" Http://s3.51cto.com/wyfs02/M02/6E/AA/wKioL1WCaEGSFgVnAAI5mrUxmGs230.jpg "/>
F. Wait for the system to install, long wait
650) this.width=650; "width=" 650 "title=" 9a0dc97e-0a46-497f-9dca-1459003ec5fe.jpg "alt=" Wkiom1wcztogbhg6aagu3kuarb0302.jpg "src=" Http://s3.51cto.com/wyfs02/M02/6E/AE/wKiom1WCZtOgbhG6AAGu3KUaRB0302.jpg "/>
G. System initialization: Select NIC Driver
650) this.width=650; "width=" 650 "title=" 463c9fb8-bb4c-4b4e-8bde-cad92f1f5536.png "style=" Float:none; "alt=" Wkiol1wcalgax_uxaaph-q0sd5u891.jpg "src=" Http://s3.51cto.com/wyfs02/M00/6E/AA/wKioL1WCaLGAx_uxAAPh-q0sD5U891.jpg "/>
G. System initialization: Installing the NIC driver
650) this.width=650; "width=" 650 "title=" 879e6edc-6211-4b44-b5af-28489921c43b.png "style=" Float:none; "alt=" Wkiom1wczwosdqkzaanlvhc-xhq805.jpg "src=" Http://s3.51cto.com/wyfs02/M00/6E/AE/wKiom1WCZwOSDqkzAANLVHc-XhQ805.jpg "/>
650) this.width=650; "width=" 650 "title=" 50423741-14f3-4503-ad80-448a27a0f78d.png "style=" Float:none; "alt=" Wkiom1wcz1qgcqwyaaj_fwajcdc189.jpg "src=" Http://s3.51cto.com/wyfs02/M00/6E/AE/wKiom1WCZ1qgcQwyAAJ_FWAJcDc189.jpg "/>
G. System initialization: Setting up the network for DHCP
650) this.width=650; "width=" 650 "title=" 593fd1b2-3884-450e-aaaf-c7e09ac69f96.png "style=" Float:none; "alt=" Wkiol1wcardiluf2aanbaa39vrg398.jpg "src=" Http://s3.51cto.com/wyfs02/M01/6E/AA/wKioL1WCaRDiLuF2AANBAa39VRg398.jpg "/>
g. System initialization: configuration system and OpenStack integration, install cloudbaseinitsetup_x64.msi; services.msc Remove cloud initialization service (services default on self-boot) authentication
650) this.width=650; "width=" 650 "title=" d34ec4ad-283b-417e-b504-fd810492e636.png "style=" Float:none; "alt=" Wkiom1wcz5pdtkotaamvhlrisbe956.jpg "src=" Http://s3.51cto.com/wyfs02/M01/6E/AE/wKiom1WCZ5PDTkOtAAMvHlRIsBE956.jpg "/>
650) this.width=650; "width=" 650 "title=" f35d8a4b-d955-4b3c-80da-fa78c94062c7.png "style=" Float:none; "alt=" Wkiol1wcauxxxg7aaankoiewlzy698.jpg "src=" Http://s3.51cto.com/wyfs02/M02/6E/AA/wKioL1WCaUXxXg7aAANKoIEwlZY698.jpg "/>
G. System initialization: Turn on Remote Desktop
650) this.width=650; "width=" 650 "title=" 209b32fd-5414-47ba-b456-8195bc56eb1b.png "alt=" Wkiom1wcz7cwx0czaanayijjodk285.jpg "src=" Http://s3.51cto.com/wyfs02/M02/6E/AE/wKiom1WCZ7CwX0CzAANayiJJOdk285.jpg "/>
G. System initialization: Initialize this to complete, delete temporary files and download files, turn off the virtual machine.
H. Compressing disk files
1 |
virt-sparsify --compress /tmp/win2008-work .qcow2 /opt/win2k8r2 .qcow2 |
compression comparison
123456 |
#之前 [[email protected] tmp] # du -sh /tmp/win2008-work.qcow2 7.3G /tmp/win2008-work .qcow2 #之后 [[email protected] tmp] # du -sh /opt/win2k8r2.qcow2 3.3G /opt/win2k8r2 .qcow2 |
This article is from the "Down to earth" blog, make sure to keep this source http://343614597.blog.51cto.com/7056394/1945057
OpenStack makes Windows Server 2008 mirroring