Linux – win2k8 guest on KVM periodically gets corrupted

fedorakvm-virtualizationlinuxvirtualizationwindows-server-2008

I have a Win2k8 guest running on a Fedora 11 system with KVM. For unknown reasons, sometimes when I start the VM, it fails to start in various ways. Sometimes it will bluescreen on boot, sometimes it will allow me to get to the logon prompt and then fail with a message about "mpnotify.exe failed to initialize properly", followed by "the user profile can't be loaded" (that one isn't the exact wording, which I can't get because it's decided it wants to blue screen right now) followed by "logonui.exe failed to initialize properly", and then a black screen that is unresponsive. Interestingly, when it gets into either of these failure modes, safe mode works fine.

The stop error on the blue screen is F4, which I think has something to do with drivers. I've tried removing the HD, IDE, and NIC drivers in safe mode after this happens, but that hasn't fixed it.

The only solution I know of is to restore from backup. Oddly, not all backups fix the error… in fact, the only one that works all the time is the one I took during the installation of the latest service pack, so when it starts up it completes installing the service pack. Also, I used to think that this error only happened when I performed an update on the host system and it updated KVM, but this most recent time happened without a KVM update, AFAIK.

Obviously, this problem is extremely annoying and causes data loss, so I'd appreciate any help!

Update:

My KVM command line:
sudo qemu-kvm -drive file=c.img,if=ide,index=0,media=disk,cache=writeback -drive file=d.img,if=ide,index=1,media=disk,cache=writeback -m 2200M -smp 4 -vga std -net tap -net nic -localtime

c.img is RAW, d.img is qcow2. As the file names suggest, c.img is my C drive which has Windows on it. When I restore from backup, I only restore the C drive. All my important data is on the D drive, which I have never had trouble with.

Best Answer

What virtual disk type are you using? qcow2 has some known issues with windows and disk corruption, and the only way to avoid it is to shutdown the caching functions of qemu

please post the kvm command line you are using

I suggest changing the c.img to RAW as well.

qemu-img convert -f qcow2 -O raw c.img c.raw