Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Making Windows server 2008 Image by openstack

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1. Install softwar

# install qemu libvirtd and Windows virt drivers on the image production server

[root@bogon ~] # yum install qemu-kvm libvirt libvirt-python libguestfs-tools virt-install

[root@bogon] # systemctl enable libvirtd & & systemctl start libvirtd

[root@bogon ~] # yum-y install virt*

# Windows does not support virtio driver by default, so you need to download it manually

[root@bogon ~] # yum-y install https://fedorapeople.org/groups/virt/virtio-win/repo/stable/virtio-win-0.1.96-1.noarch.rpm

two。 Download the CD image

Cn_windows_server_2008_r2_standard_enterprise.iso

CloudbaseInitSetup_x64.msi

3. Create an empty disk file

[root@bogon] # qemu-img create-f qcow2 / tmp/win2008-work.qcow2 10G

4. Start the virtual machine

[root@bogon] # virt-install-name win2k8-work-ram 4096-vcpus 4-network network=default,model=virtio-disk=/tmp/win2008-work.qcow2,format=qcow2,device=disk,bus=virtio-cdrom=/soft/cn_windows_server_2008_r2_standard_enterprise.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

Check the storage path of virt-win-0.1.96_amd64.vfd and virtio-win-0.1.96.iso

5. Initialize the installation

When you install the operating system, you will be prompted "cannot install Windows to this disk" or "No drives found"

Click "load driver" to change the driver

Install "Red Hat VirtIO SCSI controller (A:\ amd64\ win2008E2\ viostor.inf)"

After waiting for the disk driver to be installed, the 20g disk file just created appears. Select the disk and click "next".

Wait for the system installation to complete

System initialization: select a network card

System initialization: install the network card driver

System initialization: set the network to DHCP

System initialization: configure the system to integrate with openstack, install cloudbaseinitsetup_x64.msi, and remove cloud initialization service (self-starting service is enabled by default) authentication in service.nsc

System initialization: open remote Desktop

System initialization: delete downloaded files and shut down the virtual machine

6. Compress disk files

[root@bogon soft] # virt-sparsify-- compress / tmp/win2008-work.qcow2 / opt/win2008R2.qcow2

[root@bogon tmp] # du-sh win2008-work.qcow2

7.3G win2008-work.qcow2

[root@bogon tmp] # du-sh / opt/win2008R2.qcow2

3.2G / opt/win2008R2.qcow2

The compressed file is 3.2g.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report