Vnx-rootfswin7

From VNX
Jump to: navigation, search

How to create a KVM Windows 7 root filesystem for VNX

  • Create the filesystem disk image:
  • qemu-img create -f qcow2 vnx_rootfs_win7-base.qcow2 10GB
    
  • Create a libvirt XML definition (rootfs_win7.xml) containing the virtual machine description:
  • <domain type='kvm'>
      <name>Win7</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/vnx_rootfs_win7-base.qcow2'/>
          <target dev='hda'/>
        </disk>
        <disk type='file' device='cdrom'>
          <source file='/almacen/iso/win7.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'/>
      </devices>
    </domain>
    

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

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

    Note: you also can access the console through vncviewer:

    vncviewer localhost::5005
    
  • After Windows 7 instalation is finished:
    • Optional: autologin

    Known problems

    • After the Windows 7 virtual machine is shutdown, a blue screen of death (BSOD) appears...and the machine is rebooted. To stop the virtual machine, just type the following command when the BSOD appears:
    • virsh destroy Win7