Page 1 of 2
headless-Server doesn't shutdown :-(
Posted: 21. Sep 2008, 01:36
by smartysmart34
Hi all,
I am running a linux host that has a headless-Server on it (Windows). I start the host by running a init-script basivally calling VBoxHeadless -s guestname.
All works fine and the VM comes up.
When I shut down the host by "shutdown -h now" (called via init-Script as well I can see the script running, but the vm stays up. The command issued within the script is
"VBoxManage controlvm guestname acpipowerbutton"
For Minutes over minutes nothing happens. When I connect to that machine via Remotedesktop I can see the screensaver running. As soon as i MOVE THE MOUSE WITHIN THE WINDOW i GET THE "Windows is shutting down"-Popup and the system goes down.
Is there any more reliable way to bring the guest down even if no one is connected?
Regards,
Martin
Posted: 21. Sep 2008, 23:56
by Sasquatch
You could use the Save State instead of ACPI PowerButton command. That will save the state of the VM and let you continue where you left it.
Posted: 22. Sep 2008, 08:01
by smartysmart34
It is my understanding that savestate does not reboot the guest. It is more like suspend / hibernate. Is this correct?
So the startup command would be different as well?
Posted: 22. Sep 2008, 11:01
by h1d
Save state just makes you resume exactly where you left off as if the OS never had any activity in between.
Posted: 22. Sep 2008, 16:02
by smartysmart34
Sounds good. Last issue:
Is the command to start a machine with saved state identical to the one for a boot from scratch?
If I start the machine locally with VBoxManage the manual states that it does not matter whether the machine was shut down or saved state.
But I am starting with VBoxHeadless and that chapter of teh manual does not specify this issue. Can I still use
"VBoxHEadless -s guestname"
if the guest is in saved state?
Kind regards,
Martin
Posted: 22. Sep 2008, 17:37
by TerryE
Yes
Posted: 23. Sep 2008, 12:30
by smartysmart34
Works great. Thank you!
Posted: 26. Sep 2008, 23:29
by smartysmart34
Well, actually, not THAT great :-(
I just started and stopped the server a couple of times and when logging into the VM I recognised some graphical defects.
I then wanted to reboot the VM from within (Start -> reboot) but it didn't completely finish shutting down. The VBoxHeadless-process was still there.
At the end I had to "kill <pid>" it.
Is this a known issue?
Kind regards,
Martin
Posted: 27. Sep 2008, 14:31
by TerryE
The VM will only exit if the guest OS issues a "Power Off". Reading through the entire topic again, it sounds to me as if the guest Windows OS is hanging before reaching this point. I think most have us have experienced this in the past with various generations of GatesWare. There can be various reasons, mostly driver problems and not nec. MS ones.
If this is the case, then it isn't a VBox issue, as VBox will hang just as real H/W hangs. You can either track down the reason for the stall in Windows shutdown or do as you do with real systems an reach for that power-off (or in this case do a VBoxManage controlvm yourVM poweroff).
The acpipowerbutton send a power-off request to the guest OS, and if this OS is stalling as I described then the power-off won't occur. The poweroff option ignores the guest OS and just pulls the plug. Note that even if the guest OS is stalling, its still worth requesting the power-off through the OS before pulling the plug as this at lest usually means that the file-systems are closed cleanly.
Posted: 27. Sep 2008, 19:03
by Sasquatch
In addition to the hanging explenation, it's possible that a service or other program doesn't respond when it's asked to shut down. What you can do, is look for a tweak to automatically kill those programs. With Google, you're bound to find it.
Posted: 28. Sep 2008, 14:52
by smartysmart34
Thanks for all the hints.
I just want to add that the Windows-instance in question behaves quite normal as long as it is started in a VBox locally. That means: As long as I start VBox on my local Workstation and then fire up the XP everything is OK and within some 4-6 Months of using it - it never failed shutting down.
That just started now as I use it as headless server :-(
Regards,
Martin
P.S.: And I like to add:
It is quite some pain in the butt to worry about how to shut that thing down.
- acpipowerbutton does not work unless I connect to the box via RDP
- savestate and restart causes some corruption that prevents the system from going down completely
- pulling the virtual plug is some kind of bad idea.
So do I honestly have to write a script that tries acpipowerbutton, log in to try from there and at the end pull the plug?
Am I the only one who has these problems?
Posted: 28. Sep 2008, 15:15
by TerryE
smartysmart34 wrote:acpipowerbutton does not work unless I connect to the box via RDP
Are you saying that if you have an open RDP session and issue a
controlvm acpipowerbutton then the machine shuts down properly but if you don't then the power-down sequence stalls?
What happens if you then RDP into the stalled machine?
Posted: 28. Sep 2008, 21:48
by smartysmart34
If I RDP into the stalled machine I get the "Windows is shutting down"-Popup and the machine goes down as it should be...
Posted: 29. Sep 2008, 12:50
by TerryE
Hmmn, this sounds interesting. I can't find a bug report open on this one, so I suggest that you raise one. You need to register for a
wiki user account (this is different to a forum account sorry) and then you can use the public
Bugtracker to raise a tickets for reporting problems in VirtualBox.
It may be that the shutdown sequence is polling the keyboard. You might be able to unblock this by using a
VBoxManage controlvm yourVM keyboardputscancode <hex> [<hex> ...].
Re: headless-Server doesn't shutdown :-(
Posted: 5. Aug 2009, 15:20
by virtualpier
Hi all,
i've a problem with the acpipowerbutton and a Windows XP workstation.
If the Windows VM is locked (eg. Screensaver which prompt for user/password), the shutdown command seems to be ignored.
I've tried with the savestate as previously suggested..but, when i restart the VM (and a new VRDP connection), i see that desktop has not been correctly displayed, there are some "black hole" (black areas) on the desktop, the desktop icons are surrounded by black :/
Any advice?
Thanks