Difference between revisions of "Vnx-rootfswinxp"

From VNX
Jump to: navigation, search
(Created page with "{{Title|How to create a Windows XP root-file-system for VNX}} == Create a basic Windows XP rootfs == <ul> <li>Create the filesystem disk image:</li> qemu-img create -f qcow2 ro...")
 
(Create a basic Windows XP rootfs)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Title|How to create a Windows XP root-file-system for VNX}}
+
{{Title|How to create a KVM Windows XP root filesystem for VNX}}
  
 
== Create a basic Windows XP rootfs ==
 
== Create a basic Windows XP rootfs ==
 
<ul>
 
<ul>
<li>Create the filesystem disk image:</li>
+
<li>Create the filesystem disk image:</li>  
  qemu-img create -f qcow2 root_fs_winxp-base.qcow2 5GB
+
  qemu-img create -f qcow2 vnx_rootfs_kvm_winxp.qcow2 5G
<li>Create a libvirt XML definition (root_fs_winxp.xml) containing the virtual machine description:</li>
+
<li>Create the virtual machine with:</li>
<pre>
+
vnx --create-rootfs vnx_rootfs_kvm_winxp.qcow2 --install-media /almacen/iso/winxp.iso
<domain type='kvm'>
 
  <name>WinXP</name>
 
  <memory>524288</memory>
 
  <vcpu>1</vcpu>
 
  <os>
 
    <type arch="i686">hvm</type>
 
    <boot dev='hd'/>
 
    <boot dev='cdrom'/>
 
  </os>
 
  <features>
 
    <pae/>
 
    <acpi/>
 
    <apic/>
 
  </features>
 
  <clock sync="localtime"/>
 
  <devices>
 
    <emulator>/usr/bin/kvm</emulator>
 
    <disk type='file' device='disk'>
 
      <source file='/usr/share/vnx/filesystems/root_fs_winxp-base.qcow2'/>
 
      <target dev='hda'/>
 
    </disk>
 
    <disk type='file' device='cdrom'>
 
      <source file='/almacen/iso/winxp.iso'/>
 
      <target dev='hdb'/>
 
    </disk>
 
    <interface type='network'>
 
      <source network='default'/>
 
    </interface>
 
    <interface type='network'>
 
      <source network='default'/>
 
    </interface>
 
    <interface type='network'>
 
      <source network='default'/>
 
    </interface>
 
    <interface type='network'>
 
      <source network='default'/>
 
    </interface>
 
    <serial type='pty'>
 
      <source path='/dev/pts/3'/>
 
      <target port='0'/>
 
    </serial>
 
    <graphics type='vnc' port='5005' />
 
  </devices>
 
</domain>
 
</pre>
 
Note: change "source file=" lines to whatever fits your case (use full paths).
 
 
 
<li>Start the virtual machine with:</li>
 
virsh create root_fs_winxp.xml
 
<li>Open virtual machine console with:</li>
 
virt-viewer WinXP
 
Note: you also can access the console through vncviewer:
 
vncviewer localhost::5005
 
 
<li>Make a standard windows installation, naming the machine "winxp" and creating a "vnx" user.</li>
 
<li>Make a standard windows installation, naming the machine "winxp" and creating a "vnx" user.</li>
 
<li>After Windows XP instalation is finished:</li>
 
<li>After Windows XP instalation is finished:</li>
Line 66: Line 13:
 
<li>Disable screensaver</li>
 
<li>Disable screensaver</li>
 
<li>Disable Firewall</li>
 
<li>Disable Firewall</li>
<li>Install autoconfiguration daemon by downloading and executing the following program:</li>
+
<li>Install VNX autoconfiguration daemon by:
  http://www.dit.upm.es/vnx/download/vnx-autoconf-daemon-windows-v01.exe
+
<ul>
 +
<li>Executing on the host:</li>
 +
  /usr/share/vnx/bin/vnx_update_aced WinXP /usr/share/vnx/aced/vnx-aced-win-0.1b.exe
 +
<li>Accessing virtual machine console and starting a windows file explorer, going to cdrom content (d: normally) and double clicking on ''vnx-aced-win-0.1b.exe'' file</li>
 +
</ul>
 
<li>Install TweakUI (http://download.microsoft.com/download/f/c/a/fca6767b-9ed9-45a6-b352-839afb2a2679/TweakUiPowertoySetup.exe) and disable autorun in all drives:</li>
 
<li>Install TweakUI (http://download.microsoft.com/download/f/c/a/fca6767b-9ed9-45a6-b352-839afb2a2679/TweakUiPowertoySetup.exe) and disable autorun in all drives:</li>
 
<ul>
 
<ul>
Line 112: Line 63:
 
   </global>
 
   </global>
 
   <vm name="winxp" type="libvirt" subtype="kvm" os="windows">
 
   <vm name="winxp" type="libvirt" subtype="kvm" os="windows">
     <filesystem type="direct">/usr/share/vnx/filesystems/root_fs_winxp</filesystem>
+
     <filesystem type="direct">/usr/share/vnx/filesystems/vnx_rootfs_winxp</filesystem>
 
     <mem>512M</mem>
 
     <mem>512M</mem>
 
   </vm>
 
   </vm>

Latest revision as of 23:48, 14 April 2015

How to create a KVM Windows XP root filesystem for VNX

Create a basic Windows XP rootfs

  • Create the filesystem disk image:
  • qemu-img create -f qcow2 vnx_rootfs_kvm_winxp.qcow2 5G
    
  • Create the virtual machine with:
  • vnx --create-rootfs vnx_rootfs_kvm_winxp.qcow2 --install-media /almacen/iso/winxp.iso
    
  • Make a standard windows installation, naming the machine "winxp" and creating a "vnx" user.
  • After Windows XP instalation is finished:
    • Update it using "Windows update"
    • Disable screensaver
    • Disable Firewall
    • Install VNX autoconfiguration daemon by:
      • Executing on the host:
      • /usr/share/vnx/bin/vnx_update_aced WinXP /usr/share/vnx/aced/vnx-aced-win-0.1b.exe
        
      • Accessing virtual machine console and starting a windows file explorer, going to cdrom content (d: normally) and double clicking on vnx-aced-win-0.1b.exe file
    • Install TweakUI (http://download.microsoft.com/download/f/c/a/fca6767b-9ed9-45a6-b352-839afb2a2679/TweakUiPowertoySetup.exe) and disable autorun in all drives:
      • Expand the My Computer branch, then the AutoPlay branch, and then select Drives
      • Turn off the checkbox next to all drive letters
    • Activate windows by providing a license number
    • Optional: eliminate alert messages (at least firewall and antivirus ones) from "Control Panel-->Security Center-->Change alerts (left panel)"
    • Optional: install basic networking applications like an ssh client (i.e. putty), an scp client (i.e. winscp) or an X server (i.e Xming)
    • Configure static addresses in the four network interfaces and DISABLE all of them (necessary to speed up autoconfiguration). You can use, for example, the following script (setnetifs.bat):
    • netsh interface ip set address name="eth0" static 1.1.1.1 255.255.255.252
      netsh interface ip set address name="eth1" static 1.1.1.5 255.255.255.252
      netsh interface ip set address name="eth2" static 1.1.1.9 255.255.255.252
      netsh interface ip set address name="eth3" static 1.1.1.13 255.255.255.252
      

      Note: this script supposes that the name of network interfaces has been changed to something rational like eth0, eth1, etc, instead of the original names "Conexión de área local X" which are unusable from a bat script due to the accents...

Known problems

  • Each time a vm starts, Windows finds new hardware and installs a driver for a standard RAM PCI controller. This fact slows down the boot process. To avoid it, just start the rootfilesystem once in direct mode to have windows detect the hardware and let the driver installed. For that purpose, you can use the following VNX scenario (xp.xml):
  • <?xml version="1.0" encoding="UTF-8"?>
    <vnx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="/usr/share/xml/vnx/vnx-1.95.xsd">
      <global>
        <version>1.92</version>
        <scenario_name>xp</scenario_name>
        <vm_mgmt type="none" />
      </global>
      <vm name="winxp" type="libvirt" subtype="kvm" os="windows">
        <filesystem type="direct">/usr/share/vnx/filesystems/vnx_rootfs_winxp</filesystem>
        <mem>512M</mem>
      </vm>
    </vnx>
    

    Started with:

    vnx -f xp.xml -v --create
    

    and stopped with:

    vnx -f xp.xml -v --shutdown
    

    Note: never use not use "--destroy"option to stop a rootfilesystem use in direct mode: you will corrupt the filesystem.

Use sysprep to manage Windows XP activation

Install sysprep on the image

Generate the final image