From VNX
Revision as of 11:42, 29 June 2011 by Admin (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

How to create a Windows XP root-file-system for VNX

Create a basic Windows XP rootfs

  • Create the filesystem disk image:
  • qemu-img create -f qcow2 root_fs_winxp-base.qcow2 5GB
  • Create a libvirt XML definition (root_fs_winxp.xml) containing the virtual machine description:
  • <domain type='kvm'>
        <type arch="i686">hvm</type>
        <boot dev='hd'/>
        <boot dev='cdrom'/>
      <clock sync="localtime"/>
        <disk type='file' device='disk'>
          <source file='/usr/share/vnx/filesystems/root_fs_winxp-base.qcow2'/>
          <target dev='hda'/>
        <disk type='file' device='cdrom'>
          <source file='/almacen/iso/winxp.iso'/>
          <target dev='hdb'/>
        <interface type='network'>
          <source network='default'/>
        <interface type='network'>
          <source network='default'/>
        <interface type='network'>
          <source network='default'/>
        <interface type='network'>
          <source network='default'/>
        <serial type='pty'>
          <source path='/dev/pts/3'/>
          <target port='0'/>
        <graphics type='vnc' port='5005' />

    Note: change "source file=" lines to whatever fits your case (use full paths).

  • Start the virtual machine with:
  • virsh create root_fs_winxp.xml
  • Open virtual machine console with:
  • virt-viewer WinXP

    Note: you also can access the console through vncviewer:

    vncviewer localhost::5005
  • 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 autoconfiguration daemon by downloading and executing the following program:
    • Install TweakUI ( 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
      netsh interface ip set address name="eth1" static
      netsh interface ip set address name="eth2" static
      netsh interface ip set address name="eth3" static

      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=""
        <vm_mgmt type="none" />
      <vm name="winxp" type="libvirt" subtype="kvm" os="windows">
        <filesystem type="direct">/usr/share/vnx/filesystems/root_fs_winxp</filesystem>

    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