Mirroring implementation:
- Password injection
- Change Password
- Root partition extension
1. Download windows ISO image:http://imsdn.com/MSDN-1.html Example:cn_windows_server_2012_r2_vl_with_update_x64_dvd_4051059.iso ISO Image name resolution:Service Pack: Literal translation is a services package, a larger and important upgrade patch, patching the system, security vulnerabilities in large software.
The VL build and retail build differences 1, mainly in the way of sales and licensing different
- VL BUILD: Volume licensed version, in the same VL version, typically released to the Enterprise group.
- Retail build: An individual retail market that is typically marketed as a retailer version.
2, Installation aspects: VL installation process without a password, retail version No key can not complete the installation. 3, activation aspect: The VL version can be activated with a retail version of the key, but in turn, it is not possible, so usually download the VL version, reduce some unnecessary trouble. After activation, the Retail build does not differentiate from the VL build without distinction.2. Get Virtio-win.iso (including some hardware drivers and qemu-ga services), Cloudbase-init
:
Virtio-win.iso: Https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso
Cloudbase-init Https://github.com/openstack/cloudbase-init
About Virtio:
Because of the use of hardware virtualization, KVM has a high efficiency in terms of CPU operation. However, the traditional way of KVM in I/O virtualization is to emulate I/O devices using Qemu's pure software.
In this way, each time the VM initiates an I/O request, the KVM kernel module captures the request, then processes it into the I/O shared page and notifies the user of the QEMU sequence running in space .
QEMU obtains I/O operations, which are referred to the hardware emulation code (EMULATION) to simulate the I/O operation, putting the results back into the I/O shared page, and notifying the KVM kernel module to read the results of the I/O shared page and return the results to the virtual machine.
Because of the complexity of the path that each I/O operation passes through in this way, it is inefficient. so it is proposed that virtio this scheme, Virtio is actually a run on the hypervisor above the API interface,
Let the client know that it is running in a virtualized environment, and I/O is communicating with hypervisor through Virtio, which is a better performance for the virtual machine.
3. Create Image
Create a virtual machine disk file in QCOW2 format
Qemu-img create-f qcow2 Windows2012.qcow2 20G
4. Installation image
Install the image using Virt-install
Virt-install--connect qemu:///system--name windows2012--ram 2048--vcpus 2 --network network=default,model= Virtio--disk path=windows2012.qcow2,format=qcow2,device=disk,bus=virtio--cdrom cn_windows_server_2012_r2 _vl_with_update_x64_dvd_4051059.iso--disk path=/home/windows-image/virtio-win-0.1.126.iso,device=cdrom--vnc --os-type Windows--os-variant win2k12r2
Note:use the Osinfo-query OS command on the physical machine to view the corresponding version of the- OS-variant value.
The virtual machine created by the image does not start, the disk boot sequence is problematic, the loading sequence is incorrect, and the loading is not possible. For example, a virtual machine may be in an. xml filecn_windows_server_2012_r2_vl_with_update_x64_dvd_4051059. ISO marked as HDB, and/home /windows -image /virtio -win -0.1 126.iso marked Hda, Modify the. xml file, or modify the boot order in Virt-manager
5. Load virtio Driver, install disk drive
By default, Windows does not detect the available installation disks, and we need to install disk drivers first.
When installing WIN2K12R2, select "Manually load disk drive"
Explore D:\viostor\2k8R2\amd64\viostor.inf
Add the selected file and click "Next" to install
Note: We can also install additional drivers in this step, but not recommended,
Because some of the drive system is not detected, will be hidden, need to remove the "hidden from the system hardware mismatch driver" tick,
To see the appropriate. inf file for installation
6, System installation, reboot several times (may need to restart manually)
Power on setup Password: windows2012
7, install other Virtio drive, start balloon service
Open PowerShell with administrator privileges and install each driver provided by Virtio-win on the command line:
PCI Simple Communication Controller-install vioserial driver
Memory controller-Install balloon driver
Network adapter-Install NETKVM driver
Storage Controller-Install VIOSCSI driver
#各个驱动安装操作一致,
#以netkvm为例: cd C:\Windows\System32pnputil-i-A D:\NetKVM\2k12r2\amd64\netkvm.inf
About PnPUtil:https://technet.microsoft.com/zh-cn/library/ff550419
after installing the backward Device Manager, view the following drivers:
After the driver is loaded, you need to start the balloon service (Ceilometer capture virtual machine Memory monitoring information), put the balloon folder in Virtio, C:\Program files (
same location as the Qemu-ga installation directory), run the program at the command line or graphical interface to ensure service startup and boot
8, installation Qemu-gaInstall Qemu-ga in PowerShell: or use a mouse to install in the GUI:to enter the driver D:\guest-agent\, double-click Install 64bit Qemu-ga. 2 Services to start Qemu-ga:
9, installation Cloudbase-init
For Cloudbase-init to run scripts at instance startup, set PowerShell execution policy to unrestricted
C:\powershellc:\set-executionpolicy Unrestricted
:https://cloudbase.it/downloads/CloudbaseInitSetup_0_9_9_x64.msi
C:\Invoke-WebRequest-UseBasicParsing https://Cloudbase.it/downloads/cloudbaseinitsetup_stable_ X64.msi-outfile Cloudbaseinit.msi
Installation reference: https://cloudbase.it/cloudbase-init/link under the installation plate
Several places to configure during the installation process:
Username: Administrator
Network adapter to configure: Red Hat VirtIO Ethernet Adapter
Serial port
for
logging: COM1
注意:安装完成后,在最后的安装设置窗口选
run
sysprep
and Shutdown check boxes Last click Finish, wait for shutdown 10, configuration Cloudbase-init
Some of the Cloud-init feature settings can be found in:
http://www.cloudbase.it/cloud-init-for-windows-instances/
Configuration file Reference:
[Default]username=Administratorgroups=Administratorsinject_user_password=true# # #network_adapter=red Hat VirtIO Ethernet Adapter # # # #此项0.9. version 9, temporarily no CONFIG_DRIVE_RAW_HHD=trueConfig_drive_cdrom=trueBsdtar_path=c:\program Files (x86) \cloudbase solutions\cloudbase-Init\bin\bsdtar.exeverbose=trueDebug=trueLogDir=c:\program Files (x86) \cloudbase solutions\cloudbase-Init\loglogfile=cloudbase-init.loglogging_serial_port_settings=COM1,115200N8Mtu_use_dhcp_config=falseNtp_use_dhcp_config=falseLocal_scripts_path=c:\program Files (x86) \cloudbase solutions\cloudbase-init\localscriptsmetadata_services=Cloudbaseinit.metadata.services.configdrive.ConfigDriveService # # #此项待验证allow_reboot=false# # #需要添加此项, disable restart Stop_service_on_exit=false# # #添加此项
11. Turn on remote Desktop, turn off firewall
Slightly
This article refers to the link: source:https://github.com/stackforge/cloudbase-init
documentation:http://cloudbase-init.readthedocs.org/en/latest/
OpenStack WINDOWS2012R2 glance image maker