Skip to content

Windows (trial) images

vholer edited this page Sep 10, 2014 · 7 revisions

Requirements

Get

Steps

Create empty image. Run installer, load all VirtIO drivers, let installer copy all data into image and during first machine reboot stop virtual machine and deploy this image with partially installed Windows into cloud.

Create image

Create empty QCOW2 image:

$ qemu-img create -o cluster_size=2M -f qcow2 hd.qcow2 64G

Install

Run installer:

$ qemu-system-x86_64 -machine accel=kvm -m 4096 \
    -no-reboot -vga std \
    -drive file=hd.qcow2,if=virtio \
    -drive file=windows.iso,if=ide,media=cdrom \
    -drive file=virtio-win-0.1-81.iso,if=ide,media=cdrom \
    -net nic,model=virtio -net user

Choose your locales, e.g.:

  • Language to install: English
  • Time and currency format: Czech (Czech Republic)
  • Keyboard or input method: US

In target disk/partition dialog choose to load (VirtIO) drivers from CD-ROM, UNHIDE uncompatible drivers and choose all to install.

When drivers are installed, choose the hard-disk and continue with first installation phase where all files are transfered from CD-ROM to target disk. Virtual machine is then shut down and Windows image is nearly ready.

Installation will be finished on each cloud image instantiation, takes just few minutes. This ensures a trial period begins when each virtual machine starts for the first time and not when image was created.

Compress image

$ qemu-img convert -c -O qcow2 hd.qcow2 chd.qcow2
Clone this wiki locally