Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
windows_vm_in_kvm_on_headless_ubuntu_server [23.01.2016 23:07]
Pascal Suter
windows_vm_in_kvm_on_headless_ubuntu_server [24.01.2016 10:59] (current)
Pascal Suter
Line 79: Line 79:
 I had a windows 7 license laying around so i used that but wanted to upgrade to win 10. unfortunately the update crashed with error <​code>​0xC1900101 - 0x20017 The installation failed in the SAFE_OS phase with an error during BOOT operation</​code>​ I had a windows 7 license laying around so i used that but wanted to upgrade to win 10. unfortunately the update crashed with error <​code>​0xC1900101 - 0x20017 The installation failed in the SAFE_OS phase with an error during BOOT operation</​code>​
  
-this was easily fixed by temporarily ​adding a <​code>​-cpu core2duo</​code>​ to my options in the above config file. keep in mind you need to stop your VM and start it again for this change to be activated.. after the update the setting can be removed ​and the cpu can be reverted ​to kvm, the default+this was easily fixed by adding a <​code>​-cpu core2duo</​code>​ to my options in the above config file. keep in mind you need to stop your VM and start it again for this change to be activated.. ​I first removed this setting again after the update ​and windows 10 ran fine, but when it installed an automatic update and i accidently killed ​the vm during the installation it wouldn'​t boot anymore ​and it repeatedly showed a BSOD saying there was a ''​SYSTEM_THREAD_EXCEPTION_NOT_HANDLED''​. at first i tried fixing my windows installation using a wind10 dvd but that was not successfull as i couldn'​t even boot from the dvd.. when i ran out of options i re-enabled the core2duo ​cpu and voilà, it bootet straight away, finished its updates and we're all good :)  
 + 
 +that brings me to another note regarding windows vm's:  
 +===== Disable Windows Updates on VM ===== 
 +when the host system is shut down, akk kvm vm's will be sent a acpi power down message to gracefully shut down. the problem isif the vm does not support this feature or crashes during shutdown, the host system will in turn hang on its shutdown and you might loose control over it when you connect from remotely.. so Thomas set a timout for the shutdown command to complete and after this timeout, his init script will simply switch the vm off. this is very good in order to keep the host system under control but it can badly harm especially Windows VM's as windows likes to install updates during the shutdown of a machine and therefore can take literally hours to shut down.  
 + 
 +there are two solutions to this problem.. an easy one and a more complex one:  
 +  - Easy: disable automatic updates and do your updates manually so you can reboot your VM and give it all the time it wants to complete the updates 
 +  - Complex: use the qemu monitor command ''​screendump <​filename>''​ then run some command line ocr across the screen dump and see what it is actually doing.. using this output, prolong the timeout in the init script..  
 +for once i decided to go the easy way.. the problem about the complex solution is, that this only works once you know what to look for in the screenshot.. and who knows what microsofts "i am updating, don't you turn me off" message might look like in the future.. in times of error messages like "​something went wrong" my expectations aren't too high regarding a consisten message in that stage.. further more, my host system is improtant to me, it does lots of thing sand my windows vm is only used to do one single nice-to-have job (OCR on PDF Files) which i can easily live without for a moment.. so the host system has absolute priority over the windows VM and therefore i don't want to wait hours for the windows machine to complete its updates and not have any of my other other services (files, mails etc.) available at that time..  
 + 
 +==== windows 10 - disable updates ==== 
 +windows 10 gives you a hard time when it comes to disabling updates.. it really insists on doing some of its updates automatically.. 
 +in windows 10 pro you can set some goup policies and disable automatic updates but in windows 10 home you need to work around this issue by setting your network connection to be a "​metered connection"​ so windows won't download updates over it.  
 +=== Pro - set group policies === 
 +since i am using a windows 7 pro on my vm (i upgraded from a 7 ultimate i had laying around which turned into 10 pro upon the upgrade) i will disable auto updates using the official way:  
 +  * start -> search for "edit group policy"​ 
 +  * navigate to ''​Computer Configuration\Administrative Templates\Windows Components\Windows Update''​ 
 +  * doubleclick ''​configure automatic updates''​ and switch it to "​disabled"​ 
 + 
 + 
 +