[kwlug-disc] KVM hypervisor for Win7 with snapshots

Digimer lists at alteeve.ca
Thu Jun 2 01:50:03 EDT 2016


On 02/06/16 01:39 AM, Paul Nijjar via kwlug-disc wrote:
> 
> We are tired of our Windows-based "rollback" software that is supposed
> to restore Win7 machines to a pristine state upon reboot. This
> software is costing us hours of maintenance each week. It is time
> to find a replacement.
> 
> One idea is to run a very thin Linux installation, and then install
> Win7 into a virtual machine on that host. When the machine boots it
> should appear to be booting into Windows, and the end user should be
> interacting with the guest Win7 install. The next time the computer
> reboots the "hypervisor" starts the Win7 install again from a
> snapshot, which accomplishes the rollback.
> 
> As with every rollback solution, the hard part is updating the guest
> VM in an automated way.  (Yes, I really want to do updates, thanks.) 
> Somehow I want to install updates on the guest (I have scripts to do
> most of this) and then take a new snapshot of the VM to use as the
> rollback baseline. I think I might be able to do this via some clever
> scheduled tasks. 
> 
> From this link:
> http://serverfault.com/questions/631317/windows-7-as-kvm-guest-installation-with-virtio-drivers-detected-virtio-scsi-d
> 
> it looks like using KVM might be a solution. Outstanding questions at
> this point: 
> 
> - Has anybody set something like this up?

We host a lot of Win7 guests on KVM on our systems. However, we don't
try to have them look like windows on boot. Instead, we let gnome boot
and show the user how to open virt-manager, double-click on the VM and
full screen it. Even our no-idea-about-linux-at-all users get this
pretty quickly. There may be a way to do it though with auto-login and
setting gnome to auto-start virt-manager... not sure.

> - Are there existing configurations out there that already do this? I
>   am searching on the Internet, but obviously I am not looking for the
>   right terms.
> - How do I go about booting the host so that the guest VM comes up
>   automatically, and users don't need to know that they are running in
>   a virtualized environment?
> 
> Sorry for the vague questions, and the proprietary software focus. I
> am in the very early stages of researching this. 
> 
> If you are looking for an example of the software we are trying to
> mimic, look at "DeepFreeze" or "Drive Vaccine". 
> 
> There is a windows-only solution called "Steadier State", but it
> requires installing Windows into a VHD on a bare drive, which is going
> to be more difficult than installing Windows into a virtual machine.
> 
> - Paul 

The main concern I have is that very many people on the web think that
snapshots are golden and safe. This is NOT the case if the snapshot is
made when the guest is running because RAM isn't caught so any unflushed
buffers will be lost. It's a small risk, but it is a real risk. This is
why we won't support snapshots on our platform.

What I would recommend is this; Stop the windows machine, create the
snapshot, start windows back up. By snapshotting this way, you can be
100% certain that the image will be consistent and reliable. Given that
you can boot immediately after you create the snapshot and then 'dd'
out, the downtime should be minimal.

1. virsh shutdown <guest>
2. sleep until VM is off
3. create snapshot
4. virsh start <guest>
5. dd /dev/<snapshot>
6. remove snapshot

Done.

-- 
Digimer
Papers and Projects: https://alteeve.ca/w/
What if the cure for cancer is trapped in the mind of a person without
access to education?





More information about the kwlug-disc mailing list