I have a test Fedora 9 (64-bit) host system with a bridged network on which I have installed a Windows 2003 Server guest.
However, using either the GUI Virtual Machine Manager(VMM) or virsh command line tool, it is impossible to gracefully shutdown the guest OS. All attempts to do so are ignored.
The only way of shutting it down via VMM or virsh is to issue a destroy command .. akin to pulling out the power plug. Naturally this is not the best for long-term stability of the guest OS!
The default in the XML file is also to destroy when the host is powered down or reboots. I also tried manually editing the libvirt XML file and changing destroy to shutdown that is also ignored.
In the Windows 2003 Server logs I have noted that there is an Event ID No 4 as follows:
Event Type: Error
Event Source: ACPI
Event Category: None
Event ID: 4
Date: 27/05/2008
Time: 5:54:01 PM
User: N/A
Computer: xxxxx
Description:
AMLI: ACPI BIOS is attempting to read from an illegal IO port address (0x71), which lies in the 0x70 - 0x71 protected address range. This could lead to system instability. Please contact your system vendor for technical assistance.
On this libvirt page: http://libvir.org/formatdomain.html it states "ACPI is useful for power management, for example, with KVM guests it is required for graceful shutdown to work" and therefore suspect that the fact that WIN2K3 is refusing to allow KVM to read the ACPI is the cause of the problem.
Wondering if this is a known issue, and ideally a workaround or solution so that guest WIN2K3 systems can be gracefully powered-down when the host system powers off?
> However, using either the GUI Virtual Machine Manager(VMM) or virsh command line tool,
> it is impossible to gracefully shutdown the guest OS. All attempts to do so are ignored.
The same problem exists on Fedora 8 (64-bit). I'm running a guest of CentOS5.
I recently upgraded to Fedora 9 on the host and also had same issue.. unable to shutdown windows xp guest. I had to resort to killing the process. Virt-manager seems to be a bit unstable. Another user reported not being able to bring up the monitor console. He was also running it on Fedora 9. His complaint can be found here.
http://www.linux-kvm.com/forum/where-monitor-console
The list of open bugs for virt-manager can be found here.
https://admin.fedoraproject.org/pkgdb/packages/bugs/virt-manager
Good link Haydn.
If I have correctly understood the interaction, both virt-manager and virsh use libvirt to actually control the VMs.
I checked the bug list for libvirt and found an entry with two comments by Daniel Berrange @ Red Hat with an explanation for why graceful shutdown is not supported:
https://bugzilla.redhat.com/show_bug.cgi?id=444273
Reference comments Nos 2 and 4.
Who would have thought? I really thought this was a bug. I have also had strange behaviour though..like not being able to bring up the video console. Virt-manager just crashes when I try to so I'm not even able to check out the problem that "greno" was talking about regarding not being to find the monitor console. Virt-manager is a young project though plus Fedora 9 is brand spanking new so I expect these kinda issues.
And yeah, both virt-manager and virsh depend on libvirt.
I have been trying few options, for example, suspend the WIN2K3 machine using virsh and then reboot the host.
However, I haven't yet found a reliable solution.
In the case of suspending the WIN2K3 VM, upon reboot of the host, both VMM and virsh say it is running, however it is not accessible.
I tried to use virsh to resume it, but the console showed it was hung on boot up. After trying various options I had to destroy the VM. Next start of WIN2K3 saw it lock up during initial boot. Destroyed it again and started it again ... this time it booted.
Such is certainly no where near a reliable solution.
If anyone comes up with a reliable solution to gracefully shutdown and restart WINXP & WIN2K3 VMs from the command line, would love to hear it!
I observe that a win2k3 machine will shutdown when issued a system_powerdown only when a user is logged in.
I realise there are other issues surrounding the clean shutdown of a host but it would be useful if there was a function that did the same as pressing the power button.
I can confirm that virsh shutdown will in fact shut down a win2k3 VM if and only if a user is logged on at its console. I suspect that this behaviour will turn out to be "by design" as are so many other irritating Windows quirks.
To work around it, I've put the statically linked winexe binary available from http://eol.ovh.org in my /usr/local/bin, and my VM shutdown script uses
/usr/local/bin/winexe -A /etc/samba/authfiles/$servername //$servername 'shutdown -s -f -t 0'
to issue a Windows RPC shutdown to the VM. This works, logged on or not.
Host is Ubuntu Jaunty Server (amd64).
Winexe used to be available as part of the wmi-client package for Ubuntu and Debian, but this package has been removed; apparently the plan is to incorporate winexe into an upcoming version of Samba. For the time being, the statically linked one appears to work OK.
There is a way to shutdown a windows guest without having to be logged in. This works with 2003 Server x64 running in kvm on Centos 5.4, and probably works with other versions of windows.
When you send cntrl-alt-del to these guests, there is a Windows option that is disabled by default on Server, and might be enabled in Pro:
Shutdown: Allow system to be shut down without having to log on
This has to be enabled through the local group policy editor while logged in as Administrator:
Start>Run: gpedit.msc
Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options\Shutdown: Allow system to be shut down without having to log on
After you enable it and reboot the guest, an option button for 'shut down' will appear in the logon dialog box when you send cntrl-alt-del.
When that's enabled, you can click the big 'Shut Down' button in virtual machine manager and have Windows obey.
Reboot still doesn't work and generates this error:
libvirtError: this function is not supported by the hypervisor: virDomainReboot
Shutdown: Allow system to be shut down without having to log on
This option does not fix the problem completely — there is still at least one case when Windows ignores the power button: when there is a locked logon session on the console (directly accessed through libvirt, or "rdesktop -0" disconnected without logging out).
One workaround which might be possible is to enable hibernation and assign it to the power button press instead of shutdown — then the system will hibernate even with a user present at the console. Unfortunately, hibernation is not supported on 64-bit Windows Server 2003 versions, and on 32-bit versions with more than about 3 GB RAM (using PAE).
Saving the VM state (if it works — on CentOS 5.4 out of the box it fails due to selinux restrictions) is problematic, because there does not seem to be a way to resync the guest time after restoring the VM.
Post new comment