Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
windows_vm_in_kvm_on_headless_ubuntu_server [23.01.2016 17:08] – Pascal Suter | windows_vm_in_kvm_on_headless_ubuntu_server [24.01.2016 10:59] – Pascal Suter | ||
---|---|---|---|
Line 48: | Line 48: | ||
now in your qemu command line you ened to add the parameters | now in your qemu command line you ened to add the parameters | ||
- | | + | < |
the default qemu-ifup script in /etc/ will do the rest for you. | the default qemu-ifup script in /etc/ will do the rest for you. | ||
+ | ===== example config ===== | ||
+ | here is an example configuration for a windows 7 machine using the above mentioned init script.. if you use another init script or run kvm manually you can simply use all the cli options listed below as an example of what you might want to pass on to qemu.. also take a look at the man page it is very informative and helpful! | ||
+ | < | ||
+ | # Should be unique among all VMs | ||
+ | MONITOR_PORT=5801 | ||
+ | # Not mandatory, but useful to keep it in a distinct variable | ||
+ | VNC_DISPLAY=1 | ||
+ | |||
+ | # KVM parameters | ||
+ | KVM_OPTS=" | ||
+ | -enable-kvm \ | ||
+ | -k de-ch \ | ||
+ | -name windows \ | ||
+ | -drive file=/ | ||
+ | -m 4096 \ | ||
+ | -net nic \ | ||
+ | -net tap \ | ||
+ | -vnc : | ||
+ | -monitor tcp: | ||
+ | -monitor vc \ | ||
+ | -daemonize \ | ||
+ | </ | ||
+ | |||
+ | ===== Windows 10 upgrade ===== | ||
+ | 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 < | ||
+ | |||
+ | this was easily fixed by adding a < | ||
+ | |||
+ | that brings me to another note regarding windows vm' | ||
+ | ===== 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 is, if 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 '' | ||
+ | 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 " | ||
+ | |||
+ | ==== 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 " | ||
+ | === 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 '' | ||
+ | * doubleclick '' | ||
+ | |||
+ | |||
+ |