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:
- 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 websiteWindows XP ISO: /install/WinXP+SP3.iso
These instructions assume you have root access and are using a bash shell:
Add a New Image to the VCL Database
Add the image to the VCL database. A row needs to be added to the following tables:
- image
- imagerevision
- resource
These rows need to be added to the database manually either by using SQL commands or phpMyAdmin. The following SQL statements assume the following properties of the image:
- Image ID: 7
- Image name: vmwarewinxp-base7-v1
- Image prettyname: No Apps (WinXP vmware)
Code Block |
---|
INSERT INTO `vcl`.`image` (
`id` ,
`name` ,
`prettyname` ,
`ownerid` ,
`platformid` ,
`OSid` ,
`imagemetaid` ,
`minram` ,
`minprocnumber` ,
`minprocspeed` ,
`minnetwork` ,
`maxconcurrent` ,
`reloadtime` ,
`deleted` ,
`test` ,
`lastupdate` ,
`forcheckout` ,
`maxinitialtime` ,
`project` ,
`size` ,
`architecture` ,
`description` ,
`usage` ,
`basedoffrevisionid`
)
VALUES (
'7' , 'vmwarewinxp-base7-v1', 'No Apps (WinXP vmware)', '1', '1', '16', NULL , '512', '1', '1024', '100', NULL , '5', '0', '0', NOW(), '1', '0', 'vcl', '1500', 'x86', NULL , NULL , '0'
);
|
Code Block |
---|
INSERT INTO `vcl`.`imagerevision` (
`id` ,
`imageid` ,
`revision` ,
`userid` ,
`datecreated` ,
`deleted` ,
`datedeleted` ,
`production` ,
`comments` ,
`imagename`
)
VALUES (
NULL , '7', '0', '1', NOW(), '0', NULL , '1', NULL , 'vmwarewinxp-base7-v1'
)
|
Code Block |
---|
INSERT INTO `vcl`.`resource` (
`id` ,
`resourcetypeid` ,
`subid`
)
VALUES (
NULL , '13', '7'
)
|
Create a Virtual Machine
- Launch the VMWare Server console:
- Connect to Local Host
- Create a new VM
- Virtual Machine Configuration: Typical
- Guest Operating System: Microsoft Windows
Version: Windows XP Professional - Name: vmwarewinxp-base7-v1
- Network connection: Custom
/dev/vmnet1 - Disk size: 8.0 GB
- Allocate all disk space now: no
- Split disk into 2GB files: yes
- Edit virtual machine settings
- Configure the VM CD-ROM drive to use the Windows XP ISO image
- Connection: Use ISO image: browse to path of Windows XP ISO image
/install/WinXP+SP3.iso
- Add: Ethernet Adapter
- Network Connection: Custom
/dev/vmnet0
Install Windows XP on the Virtual Machine
Follow the steps: Install Windows XP for a Base Image
Install VMware Tools
- Power on the VM if it is not already powered on
- Install VMWare Tools (Note: you must have a CD-ROM drive configured for the VM in order to install VMware Tools)
- Click on the VM menu and select "Install VMWare Tools"
- Select Typical and proceed through the setup pages accepting the defaults
- Reboot the VM when installation is complete
Install Cygwin
- From within the Windows XP VM, download and run the Cygwin installer to the desktop: 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: Desktop
- 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
- Delete the Cygwin installation files from the desktop:
- Installer: setup.exe
- Local package directory: C:\ftp%...cygwin...
Configure Cygwin SSH service
- Launch the Cygwin shell
Panel |
---|
C:\Cygwin\Cygwin.bat |
- Download the cygwin-sshd-config.sh script to the following location on the Windows VM:
C:\Cygwin\home\root\cygwin-sshd-config.sh - Windows may have saved the file with a .txt extension, from within the Cygwin shell:
Panel |
---|
ls ~ cygwin-sshd-config.sh.txt |
If this is the case, rename the file: Panel |
---|
mv cygwin-sshd-config.sh.txt cygwin-sshd-config.sh |
- Make sure the script is set to executable:
No Format |
---|
chmod +x /home/root/cygwin-sshd-config.sh
|
- 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>'
|
You should see something similar to the following towards then end of the script output: Panel |
---|
The CYGWIN sshd service was started successfully. |
Create an SSH key pair on the Management Node and Copy the Public Key to the authorized_keys File on the Windows XP VM
- Download the gen-node-key.sh script to the following location on the management node:
- Set the script to be executable:
No Format |
---|
chmod +x /root/gen-node-key.sh
|
- Determine the IP address of the Windows XP VM by running ipconfig:
Panel |
---|
Windows IP Configuration Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . : Autoconfiguration IP Address. . . : 169.254.123.175 Subnet Mask . . . . . . . . . . . : 255.255.0.0 Default Gateway . . . . . . . . . : Ethernet adapter Local Area Connection 2: Connection-specific DNS Suffix . : dcs.mcnc.org IP Address. . . . . . . . . . . . : 152.46.18.179 Subnet Mask . . . . . . . . . . . : 255.255.248.0 Default Gateway . . . . . . . . . : 152.46.23.254 |
- 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 152.46.18.179
|
Note: You will need to enter the root account's password during script execution. - Attempt to connect from the management node to the Windows VM via SSH using the key:
No Format |
---|
ssh 152.46.18.179
|
Insert an Imaging Reservation into the VCL Database
An imaging request needs to be manually inserted into the VCL database to begin the automated imaging process. You will need to know the management node ID and computer ID of the VM guest you are using. The following SQL statements assume the following:
- Computer ID: 2
- Management node ID: 1
Code Block |
---|
INSERT INTO `vcl`.`request` (
`id` ,
`stateid` ,
`userid` ,
`laststateid` ,
`logid` ,
`forimaging` ,
`test` ,
`preload` ,
`start` ,
`end` ,
`daterequested` ,
`datemodified`
)
VALUES (
'1' , '16', '1', '16', '', '1', '0', '0', NOW( ) , TIMESTAMPADD(MINUTE, 120, NOW()), NOW( ) , NULL
);
|
Code Block |
---|
INSERT INTO `vcl`.`reservation` (
`id` ,
`requestid` ,
`computerid` ,
`imageid` ,
`imagerevisionid` ,
`managementnodeid` ,
`remoteIP` ,
`lastcheck` ,
`pw`
)
VALUES (
NULL , '1', '2', '7', '7', '1', NULL , NULL , NULL
);
|
Start vcld:
Monitor the vcld.log file:
Panel |
---|
tail -f /var/log/vcld.log |
Common Problems
.
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.
- Open the Control Panel
- Click System and Security > Change User Account Control settings (Under Security and Maintenance)
- Move the slider to the bottom: Never notify
- Click OK
- Reboot the computer
Addition Windows install notes (mostly outdated):
Install Windows for a Base Image
VMware Only: Install VMware Tools
- Power on the VM if it is not already powered on
- Install VMWare Tools (Note: you must have a CD-ROM drive configured for the VM in order to install VMware Tools)
- Click on the VM menu and select "Install VMWare Tools"
- Select Typical and proceed through the setup pages accepting the defaults
- Reboot the VM when installation is complete
Install Cygwin SSHD
Follow the steps: Install and Configure Cygwin SSHD
Capture the Base Image
Include Page |
---|
| Capture A Base Image |
---|
| Capture A Base Image |
---|
|
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