Pages

Showing posts with label Windows Image. Show all posts
Showing posts with label Windows Image. Show all posts

Monday, April 13, 2015

Creating Custom Windows Image for Openstack

Creating Custom Windows Images.

Setting up the KVM environment to create the custom images.

Installing Packages # We can do it on Compute 2

yum install kvm qemu-kvm python-virtinst libvirt libvirt-python virt-manager libguestfs-tools

Once the packages are installed we need to get the ISO’s.

Now we need the Virtio Driver’s so that windows can detect unsigned devices like linux from http://alt.fedoraproject.org/pub/alt/virtio-win/latest/

wget http://alt.fedoraproject.org/pub/alt/virtio-win/latest/virtio-win-0.1-81.iso

First Create the Disk on which the OS need to be installed

qemu-img create -f qcow2 -o preallocation=metadata windows.qcow2 20G

Start the KVM installation

qemu-system-x86_64 -enable-kvm -m 4096 -cdrom en_windows_7_professional_with_sp1_x64_dvd_u_676939.iso -drive file=windows.qcow2,if=virtio -drive file=virtio-win-0.1-100.iso,index=3,media=cdrom  -boot d -vga std -k en-us -vnc 10.1.52.42:1 -usbdevice tablet

Connect to Installation
Once the above step is done you will be able to connect to VNC using 10.1.52.42:1

You will be connected to VNC and you will be at the installations screen. Click Next to continue


Select Install option to continue with installation.


Selecting the Hard disk Driver

While setting the Installation driver we need to load the driver, Select the load driver option and load the driver from the Virto ISO we have mounted


Continue with the installation

  
Once you are done with the installation .The instance will be having Internet connection as you are using default NIC setting so download the Cloud init for windows from
https://github.com/cloudbase/cloudbase-init

To allow Cloudbase-Init to run scripts during an instance boot, set the PowerShell execution policy to be unrestricted:

C:\powershell
C:\Set-ExecutionPolicy Unrestricted
Download and install Cloudbase-Init:
C:\Invoke-WebRequest -UseBasicParsing http://www.cloudbase.it/downloads/CloudbaseInitSetup_Beta_x64.msi -OutFile cloudbaseinit.msi
Shutdown the instance.

Final Configuration

Once installation is completed load the computer with virto NIC with following Command

qemu-system-x86_64 -enable-kvm -m 4096 -drive file=windows.qcow2,if=virtio -drive file=virtio-win-0.1-100.iso,index=3,media=cdrom  -boot d -vga std -k en-us -vnc 10.1.52.42:1 -usbdevice tablet -net nic,model=virtio

Connect to VNC and add the Virto NIC Driver From Device manager

Enable RDP in the Server.


Installing Cloud init .

Complete the Cloud Init installation
Run the Cloud-init Service to start the installation and Configure it as below.

C:\.\cloudbaseinit.msi
In the configuration options window, change the following settings:
Username: Administrator
Network adapter to configure: Red Hat VirtIO Ethernet Adapter
Serial port for logging: COM1
When the installation is done, in the Complete the Cloudbase-Init Setup Wizard window, select the Run Sysprep and Shutdown check boxes and click Finish.


Now the Image is ready for Use.

You can get the windows password by

nova get-password <instance ID> <ssh-key>

Add the image through front end Images >> Create Images

Monday, September 1, 2014

Creating Custom Windows Images for Openstack

Setting up the KVM environment to create the custom images.

yum install kvm qemu-kvm python-virtinst libvirt libvirt-python virt-manager libguestfs-tools

Once the packages are installed we need to get the ISO’s.

For example are getting windows7 from the http://www.w7forums.com/threads/official-windows-7-sp1-iso-image-downloads.12325/
wget http://msft.digitalrivercontent.net/win/X17-24395.iso

Now we need the Virtio Driver’s so that windows can detect unsigned devices like linux from http://alt.fedoraproject.org/pub/alt/virtio-win/latest/

wget http://alt.fedoraproject.org/pub/alt/virtio-win/latest/virtio-win-0.1-81.iso

First Create the Disk on which the OS need to be installed

qemu-img create -f qcow2 -o preallocation=metadata windows.qcow2 20G

Start the KVM installation
/usr/libexec/qemu-kvm -m 2048 -smp 2 -cdrom X17-24395.iso -drive file=virtio-win-0.1-81.iso,index=3,media=cdrom -drive file= windows.qcow2,if=virtio,boot=off -boot d -vga std -k en-us -vnc 10.1.17.42:1 -usbdevice tablet

Connect to Installation

Once the above step is done you will be able to connect to VNC using 10.1.17.42:1
You will be connected to VNC and you will be at the installations screen. Click Next to continue

Windows-install00

Select Install option to continue with installation.

Windows-install01

While secting the Installation driver we need to load the driver, Select the load driveroption and load the driver from the Virto ISO we have mounted

Windows-install02

Continue with the installation

Windows-install04

Once you are done download the Cloud init for windows from

https://github.com/cloudbase/cloudbase-init
Once installation is completed load the computer with virto NIC with following Command

/usr/libexec/qemu-kvm -m 2048 -smp 2 -drive file=virtio-win-0.1-81.iso,index=3,media=cdrom -drive file=windows-7.qcow2,if=virtio -boot d -vga std -k en-us -vnc 10.1.17.42:1 -usbdevice tablet -net nic,model=virtio
Connect to VNC and add the Virto NIC Driver From Device manager

Windows-install06

Now install the Cloud-init and initialize the Image

Windows-install10

Enable RDP for the access.

Now the Image is ready for Use .

You can get the windows password by

nova get-password <instance ID> <ssh-key>

 

 

Nova Rule

nova secgroup-add-rule default tcp 3389 3389 0.0.0.0/0