Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Excerpt

This page describes how to create a Windows base image.

These instructions should work regardless of the provisioning engine being used (KVM, VMware, etc.).


Requirements

...

You will need the following:

  • VMware Server RPM installation file
  • VMWare Server serial number
  • Windows XP installation ISO file
  • Windows XP product key or KMS server address

The following instructions assume the following locations on the management node:

 The following must be done before an image can be captured:

  • The web, database, and management node has been installed and the management node is checking into the database.
  • A computer for the machine being captured has already been added to the VCL database
  • A VM host computer on which the guest is running as been added to the VCL database
  • The guest VM has been assigned to the VM host via the Virtual Hosts link on the VCL website
  • VMWare Server RPM: /install/VMware-server-1.0.8-126538.i386.rpm
  • Windows XP ISO: /install/WinXP+SP3.iso

These instructions assume you have root access and are using a bash shell:

  • sudo bash

Make Sure The Host Computer Is Not Running A Xen Kernel

VMWare Server cannot be installed on a computer running a Xen kernel.  To determine if a Xen kernel is being used:

Panel

uname -a

The following output indicates a Xen kernel is being used:

Panel

Linux blade1g6-4 2.6.18-92.el5xen #1 SMP Tue Jun 10 19:20:18 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux

If "xen" appears in the output of the previous command, replace the Xen Kernel with the following commands:

Panel

yum update ecryptfs-utils -y
yum install kernel kernel-devel -y
yum remove xen kernel-xen -y

Check the grub.conf file to make sure it is not configured to boot using the Xen Kernel

Panel

less /boot/grub/grub.conf 

The grub.conf file should NOT look like this:

Panel

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/sda3
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-92.el5xen)
        root (hd0,0)
        kernel /xen.gz-2.6.18-92.el5
        module /vmlinuz-2.6.18-92.el5xen ro root=LABEL=/ pci=nommconf
        module /initrd-2.6.18-92.el5xen.img

The grub.conf file SHOULD look like this:

Panel

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/sda3
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-128.1.14.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-128.1.14.el5 ro root=LABEL=/1 pci=nommconf
        initrd /initrd-2.6.18-128.1.14.el5.img

After removing the Xen kernel, reboot the computer:

Panel

reboot

Install VMWare Server

  1. Download the latest VMware Server 1.x RPM from http://www.vmware.com&nbspImage Removed;
  2. You may need to install or update some libraries:
    Panel

    yum install glibc-devel -y
    yum install glibc -y 
    yum install libXtst-devel -y

    Install the VMWare Server RPM:
  3. Panel

    rpm -ivh /install/VMware-server-1.0.8-126538.i386.rpm

  4. Configure VMWare Server:
    Panel

    vmware-config.pl

    1. Press ENTER to view the license agreement
    2. Scroll to the bottom
    3. Type yes and press ENTER
    4. Wiki Markup
      In which directory do you want to install the mime type icons?
      \[/usr/share/icons\]
    5. Wiki Markup
      What directory contains your desktop menu entry files? These files have a
      .desktop file extension. \[/usr/share/applications\]
    6. Wiki Markup
      In which directory do you want to install the application's icon?
      \[/usr/share/pixmaps\]
    7. Wiki Markup
      None of the pre-built vmmon modules for VMware Server is suitable for your
      running kernel.  Do you want this program to try to build the vmmon module for
      your system (you need to have a C compiler installed on your system)? \[yes\]
    8. Wiki Markup
      What is the location of the directory of C header files that match your running
      kernel? \[/lib/modules/2.6.18-128.1.14.el5/build/include\]
    9. Wiki Markup
      Do you want networking for your virtual machines? (yes/no/help) \[yes\]
    10. Wiki Markup
      Your computer has multiple ethernet network interfaces available: eth0, eth1,
      virbr0. Which one do you want to bridge to vmnet0? \[eth0\]
    11. Wiki Markup
      Do you wish to configure another bridged network? (yes/no) \[no\] *yes*
    12. Wiki Markup
      Your computer has multiple ethernet network interfaces available: eth0, eth1,
      virbr0. Which one do you want to bridge to vmnet2? \[eth0\] *eth1*
    13. Wiki Markup
      Do you wish to configure another bridged network? (yes/no) \[no\]
      *no*## Do you want to be able to use host-only networking in your virtual machines?
      \[no\] *yes*
    14. Wiki Markup
      Do you want this program to probe for an unused private subnet? (yes/no/help)
      \[yes\] *no*
    15. What will be the IP address of your host on the private
      network? 192.168.0.1
    16. What will be the netmask of your private network? 255.255.0.
Panel

This system appears to have a DHCP server configured for normal use.  Beware
that you should teach it how not to interfere with VMware Server's DHCP server.
There are two ways to do this
1) Modify the file /etc/dhcpd.conf to add something like
subnet 192.168.0.0 netmask 255.255.0.0 {
# Note: No range is given, vmnet-dhcpd will deal with this subnet.

2) Start your DHCP server with an explicit list of network interfaces to deal
with (leaving out vmnet1). e.g.
dhcpd eth0

    1. Wiki Markup
      Do you wish to configure another host-only network? (yes/no) \[no\]
    2. Wiki Markup
      The default port : 902 is not free. We have selected a suitable alternative
      port for VMware Server use. You may override this value now.
      Remember to use this port when connecting to this server.
      Please specify a port for remote console connections to use \[904\]
    3. Wiki Markup
      In which directory do you want to keep your virtual machine files?
      \[/var/lib/vmware/Virtual Machines\]
    4. Wiki Markup
      The path "/var/lib/vmware/Virtual Machines" does not exist currently. This
      program is going to create it, including needed parent directories. Is this
      what you want? \[yes\]
    5. Please enter your 20-character serial number
      Type XXXXX-XXXXX-XXXXX-XXXXX or 'Enter' to cancel:
    6.  
  1. Create a Virtual Machine

  2. Launch the VMWare Server console:
    No Format
    
    vmware &
    
  3. Connect to Local Host
  4. Copy a Windows XP ISO image to the VMWare Server machine 
  5. Create a new VM
    1. Type: Typical
    2.  Guest OS: Microsoft Windows, Version: Windows XP Professional
    3. Name: Windows XP Base
    4. Network connection: Use bridged networking
    5. Disk size: 8.0 GB
      1. Allocate all disk space now: no
      2. Split disk into 2GB files: yes
  6. Configure the VM CD-ROM drive to use the Windows XP ISO image
    1. Connection: Use ISO image: browse to path of Windows XP ISO image:
      /install/WinXP+SP3.iso

Install Windows XP on the Virtual Machine 

  1. Power on the the VM
  2. Press ESC as soon as VM begins to start to display the boot menu
    • Boot from the CD-ROM drive
  3. Press a key to boot from the CD (if displayed at bottom of screen as soon as VM begins to boot)
  4. Proceed through Windows XP installation
    1. Press Enter to setup up Windows XP now 
    2. Press F8 to agree to the license agreement 
    3. Configure the Windows partition 
      1. Press Enter to set up Windows XP on the selected item (should be called "Unpartitioned space")
      2.  Format the partition using the NTFS file system (Quick)
    4. Enter a name and organization 
    5. Enter the Windows XP product key 
    6. Enter a computer name and password
    7. Select a timezone
    8. Networking settings: Typical
    9. Member of a domain: No, leave default workgroup settings
    10. Do not turn on automatic updates
    11. Enter "root" as the user name

Delete ISO Image From Management Node & Reconfigure VM CD-ROM Drive

  1. If your management node is actually a VCL image, delete the Windows XP ISO image from the management node's hard drive to reduce the image size
  2. Reconfigure the VM CD-ROM
    1. Use physical drive
    2. Location: Host

Configure the Windows XP Virtual Machine 

.

Create a Virtual Machine

KVM, VMware ESXi, vCenter

The instructions assume that the VM host has been configured with the following bridged networks:

  • Private: bridged to private interface: eth0
  • Public: bridged to public interface: eth1

Use an interactive client for your hypervisor to create a VM with

  • 2 NICs (use MAC addresses from a VM you've already assigned to the VM host under Virtual Hosts in the VCL web interface)
    • use e1000 as the adapter type
  • disk image large enough for the OS install, updates, and any desired software (typically 50-100 GB)
  • 1 to 2 cores (typically)
  • 4 to 8 GB RAM (typically)
  • ensure all devices are configured to be attached at power on

Example instructions specifically for VMware vSphere:

  • Click File New Virtual Machine
  • Configuration: Custom
  • Name: win10
  • Datastore: datastore
  • Virtual Machine Version: 7
  • Guest Operating System: Windows
    • Version: Microsoft Windows 10 (64-bit)
  • Number of virutal sockets: 2
  • Number of cores per virtual socket: 1
  • Memory Size: 4 GB
  • How many Nics: 2
    • NIC 1: Private, Adapter: E1000, Connect at Power On: Yes
    • NIC 2: Public, Adapter: E1000, Connect at Power On: Yes
  • SCSI controller: LSI Logic SAS
  • Disk: Create a new virtual disk
    • Capacity: 50 GB
    • Disk Provisioning: Thin Provision
    • Location: Specify a datastore or datastore cluster
      • Click Browse
      • Select the local datastore
      • Click OK
  • Virtual Device Node: SCSI (0:0)
    • Mode: Not Independent (unchecked)
  • Edit the virtual machine settings before completion: Yes
  • In the Hardware pane, select Add...
    • Device Type: CD/DVD Drive
    • Select CD/DVD Media: Use ISO image
    • Select ISO Image:
      • Click Browse
      • Select the location datastore (were the ISO is located) 
      • Click Open
      • Select Windows10.iso
      • Click Open
    • Connect at power on: Yes (checked)

Select the New NIC (adding) entry with Private listed next to it** Under MAC Address, select Manual

    • Enter the private MAC address you retrieved earlier
    • Click Finish
  • Click Finish

Start the VM and Install Windows

  • Start the VM
  • Follow the installation process for Windows
  • When asked for an initial user
    • use root as the username
      • ensure root is an admin user
    • use a password you will remember (VCL will change it later to what is configured in /etc/vcl/vcld.conf on the management node
  • Complete the installation process
  • Log in as the root user

Enable RDP

  • Right click on the Windows start icon
  • Open Control Panel > System and Security > System
  • Click Remote settings
  • Select Allow remote connections to this computer
  • Click OK

Connect via RDP

  • Find the IP address assigned to your VM on the Public port:
    • Start->Search
    • Enter cmd
    • Run cmd
    • type ipconfig and look your public IPv4 address x.x.x.x address
  • Connect to the computer using Remote Desktop
  • Login to the RDP session as root

Disable User Account Control

 

User Account Control (UAC) is the mechanism that causes may of the pop-up windows to appear when you attempt to run programs on Windows. VCL will disable it when the image is captured but you can disable it while configuring the base image to make things a little easier.

  1. Open the Control Panel
  2. Click System and Security > Change User Account Control settings (Under Security and Maintenance)
  3. Move the slider to the bottom: Never notify
  4. Click OK
  5. Reboot the computer

Addition Windows install notes (mostly outdated):

Install Windows for a Base Image

VMware Only: Install VMware Tools

  1. Power on the VM if it is not already powered on
  2. Run Microsoft Update 
  3. Configure the root user account
  4. Set root's password: either the user management GUI or execute the following command:
    No Format
    
    net user root <PASSWORD>
    
  5. Make sure root is a member of the Administrators group using the user management GUI or execute the following command: No Format net localgroup Administrators root /ADD
  6. Install VMWare Tools  (Note: you must have a CD-ROM drive configured for the VM in order to install VMware Tools)
    1. Click on the VM menu and select "Install VMWare Tools"
    2. Select Typical and proceed through the setup pages accepting the defaults
    3. Reboot the VM when installation is complete

Install

...

Cygwin SSHD

  1. Download and run the Cygwin installer: http://cygwin.com/setup.exe
    • Install from Internet
    • Root Directory: C:\Cygwin
    • Install For: Just Me
    • Default Test File Type: DOS/text
    • Local Package Directory: *C:*
    • Internet Connection: Direct Connection
    • Download Site: choose one (.edu FTP sites seem the fastest)
    • Select Packages: Net: openssh
    • Create icon on Desktop: No
    • Add icon to Start Menu: No
  2. Delete the local package directory: C:\ftp%...cygwin...

Configure Cygwin SSH service

  1. Launch C:\Cygwin\Cygwin.bat
  2. Download the cygwin-sshd-config.sh script to the following location on the Windows VM:
    C:\Cygwin\home\root\cygwin-sshd-config.sh
  3. Make sure the script is set to executable:
    No Format
    
    chmod \+x /home/root/cygwin-sshd-config.sh
    
  4. Launch C:\Cygwin\Cygwin.bat
  5. Run the script and specify the root account password as an argument, enclose the password in ticks in case special characters are used in the password:
    No Format
    
    /home/root/cygwin-sshd-config.sh '<PASSWORD>'
    
    Note: the sshd service probably will not start until the next step is completed
  6. Open Start -> Run -> services.msc
  7. Double-click the Cygwin sshd service
  8. Open the Log On tab
  9. Enter the root account password twice and click OK, you should see a message stating root has been granted the Log On As A Service Right
  10. Click the General tab
  11. Click Start

Create an SSH key pair on the Management Node and Copy the Public Key to the authorized_keys File on the Windows XP VM

  1. Download the gen-node-key.sh script to the following location on the management node:
    /root/gen-node-key.sh
  2. Set the script to be executable:
    No Format
    
    chmod \+x /root/gen-node-key.sh
    
  3. Run the script and specify the node as an argument (either the node's DNS name or IP address can be used):
    No Format
    
    /root/gen-node-key.sh 192.168.22.55
    
  4. Attempt to connect from the management node to the Windows VM via SSH using the key:
    No Format
    
    ssh \-i /etc/vcl/vcl.key 192.168.22.55
    

...

Follow the steps: Install and Configure Cygwin SSHD

Capture the Base Image

Include Page
Capture A Base Image
Capture A Base Image

Common Problems

 You may see the following dialog box when powering on a VM which has been saved in a VCL image. Click on Always Keep:
Image Removed