Page 1 of 1
VBoxHeadless graceful shutdown renders other VMs "aborted"
Posted: 30. Aug 2009, 16:08
by kihjin
Hi everyone, hopefully you can help!
I start up 3 Headless/VRDP-enabled VMs (each Ubuntu Server) in the following order:
start A
start B
start C
I then check the state of each VM (VBoxManage showvminfo A | grep State), and they are all reported Running. RDP works, everything is fine.
So then, I gracefully shut them down (controlvm acpipowerbutton) starting with VM A
stop A
Then I check the state of each VM: A is reported as powered off, B is reported as powered off, and C is reported as aborted. All I did was stop VM A, why are the other VMs reporting this?
To make matters more complicated, B and C are still running just fine. Unfortunately, because they are reporting as powered off, VBoxManage controlvm wont work (so I can't remotely stop the others now).
Now, I believe this happens because I'm stopping VM A, which is the first VM I started. If I had stopped VM B instead, and then VM C, and VM A then it would have worked
I upgraded to 3.0 thinking this specific bug would be fixed, but its still a problem. Can anyone else confirm?
Re: VBoxHeadless graceful shutdown renders other VMs "aborted"
Posted: 30. Aug 2009, 16:59
by Perryg
I have found that the (acpipowerbutton) remotely or even locally does not always produce the results that I expect. Most of the time it works as intended but there are those rare occasions when it is just slightly better than hitting the reset button. I have also found that the order is important as well when it comes to an (acpipowerbutton) and instead of using this function I have taken to remotely connecting to the server I want to control and use the "sudo shutdown -h now" command in the unit itself. This always works as intended. I expect that this is something in the remote OS that is causing this as well, and not so much the calling of it from VBox, as this is supposed to be a standard alternative to actually powering the machine down the prescribed way.
Can you share with us how you start the remote VMs? Is it a script, or do you manually start each one of them from the command line?
Re: VBoxHeadless graceful shutdown renders other VMs "aborted"
Posted: 30. Aug 2009, 17:20
by kihjin
Thanks for the response Perry.
Here's how I'm starting the VMs
Code: Select all
launch-screen.sh:
screen -S $1 -d -m $HOME/scripts/launch.sh $1
launch.sh:
VRDP_AUTH_PAM_SERVICE=system-$1 VBoxHeadless -s $1
$ ./launch-screen.sh A
<wait a few seconds>
$ ./launch-screen.sh B
...
I do have another script that launches them sequentially, waiting a second or two before starting the next one.
Unfortunately, I have experienced this same occurrence with "sudo shutdown -h now" or "sudo halt". Though I have not tested this scenario thoroughly.
As far as I understand, (you need acpid installed), ubuntu server is just doing a halt when it receives the power button event. I can't understand how the guest would see any difference between the power button and doing a halt from within the system.
Even if "sudo shutdown -h now" did work more predictably, it isn't an ideal solution since it makes the task of shutting down all the systems difficult to automate.
The main problem is that the acpipowerbutton event to the one VM (the first one started) is causing problems with the other VMs. I suppose what is happening is the VBox process needs to verify that the system actually powered off. I'm guessing it somehow polls the guest repeatedly following a acpipowerbutton, or maybe its already doing that by default. Somehow once the first VM actually does go down because of this, the other VMs are marked as off or aborted.
Oh Yeah, I am using 3.0.4, if that wasn't obvious.
edit: Also, after the other VMs are messed up, if I don't already have a RDP connection established to them, I can't establish a new one...
Re: VBoxHeadless graceful shutdown renders other VMs "aborted"
Posted: 30. Aug 2009, 17:54
by Sasquatch
Maybe it's the fact that you're using Screen for this. What if you start the VMs manually, with an & at the end of the command so they are forked to the background and you get your terminal back. Does the same happen?
Re: VBoxHeadless graceful shutdown renders other VMs "aborted"
Posted: 30. Aug 2009, 18:02
by kihjin
@Sasquatch:
Suppose that what you suggest is correct. I'm not saying this is the case or not, I have not verified.
In the meantime the following questions arise:
1) Is this the fault of screen, or the fault of VBox?
2) If I can't run the VMs screen, how can I keep them running after I exit my terminal, or ssh?
Again, I'm not saying you aren't right, I just have a hard time accepting that screen could be the problem here.
I will nevertheless try this out.
Re: VBoxHeadless graceful shutdown renders other VMs "aborted"
Posted: 30. Aug 2009, 23:08
by kihjin
Alright, the gotcha here is that I'm unable to reproduce this problem with screen locally using four instances of ubuntu server 9.04.
However, I have a live setup with four systems: ubuntu server 9.04, ubuntu server 8.10, ubuntu server 8.10 and windows 2000 server
Just now, I brought down the windows 2000 server system with all the others running prior. Now VBox reports them all as powered off (except one, which is reported as aborted)
I did a quick look at the last Log for each of the still-running-but-powered-off systems, and there haven't been any new entries added.
What really makes this not good is that RDP to the systems fails. If I bring the windows 2000 server back up, RDP to only it works, but not the others.