This instruction specific to MAI VCI classroom
- Prepare Windows to hardware change
- Replace HDD Controller with Standard IDE (XP and Win7)
- Set 'Start' value to '4' (XP only) for:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Processor
Or
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Intelppm
2. Copy VHD file from windows to linux server.
Share VHD disk file on windows server
Go to Linux server and run
smbget smb://HVServer/shared/Ecology.vhd
3. Create volume for master disk
lvcreate --size 4196M --name /dev/vg_storage/ecology_master
4. Convert VHD disk to LVM Volume
qemu-img convert -p -f vpc -O raw Ecology.vhd /dev/vg_storage/ecology_master
5. Create Master VM
virt-install \
--name ecology_master \
--ram 512 \
--os-type=windows --os-variant=winxp \
--vcpus 1 \
--disk /dev/vg_storage/ecology_master,device=disk,bus=virtio,format=raw \
--network network=default,model=virtio \
--graphics vnc \
--noautoconsole \
--import \
--noreboot \
--debug
6. Create small temporary img disk
qemu-img create /mnt/storage/disk.img 1G
and download virtio drivers
wget http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/bin/virtio-win-0.1-30.iso
7. virsh edit ecology_master
Now we should connect master disk as IDE (so that windows able to boot without BSOD) and connect additional virtio disk to let windows install and load virtio drivers at the same time.
Also we connect cdrom with virtio drivers.
Replace existing disk tag with :
Add disks temporary:
<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/vg_storage/ecology_master'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/mnt/storage/disk.img'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='/mnt/storage/iso/virtio-win-0.1-30.iso'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' unit='0'/>
</disk>
8. virsh start ecology_master
9. Check VNC port with
virsh vncdisplay ecology_master
Make a tunnel via putty port 5900 (5900 + N)
Connect with VNC Viewer to localhost:N
Check Windows started and install drivers from CD-ROM
Shutdown windows
10. Now when virtio drivers has been installed we switch master disk to virtio and disconnect second disk from disk.img. CD-ROM will remain for future use.
virsh edit ecology_master
Remove
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/mnt/storage/disk.img'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</disk>
Replace
<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/vg_storage/ecology_master'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
with Initial disk
<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/vg_storage/ecology_master'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</disk>
11. Start windows and check it works
12. Copy existing template to new
cd /opt/VCI/etc/templates
cp ./oraclient-win7/ ./ecology -R
13. Fix ./ecology/env.sh
- change LVM_MASTER and VM_MEMORY if required
14. Fix ./ecology/ip.reg.template
- change Interface GUID. Take from target master VM ([HKEY_LOCAL_MACHINE\SYSTEM
\ControlSet001\services\Tcpip\Parameters\Interfaces\)
15. Fix ./ecology/template.xml
- change tags <name> and <description>
16. Execute /opt/VCI/etc/reload.sh
17. Go to VCI web site and test new VM template