Page 1 of 1
Vbox applauncher script runs but leaves zombies on dock
Posted: 28. Oct 2013, 17:41
by jferguson
I'm running Mac OS X 10.8.5 on MacBook Air. Running latest VirtualBox as host, Windows XP SP3 as Guest, Quicken Deluxe 2013 as application.
Here is script I'm loading it with:
#!/bin/bash
if [ $( VBoxManage list runningvms | wc -l ) != "0" ]
then
VBoxManage guestcontrol "WindowsXP" exec --image c:\\"Program Files"\\Quicken\\qw.exe --username yaley --password boolaboola
VBoxManage controlvm "WindowsXP" savestate
else
VBoxManage startvm "WindowsXP" && VBoxManage guestcontrol "WindowsXP" exec --image c:\\"Program Files"\\Quicken\\qw.exe --username yaley --password boolaboola --wait-exit --wait-stdout
VBoxManage controlvm "WindowsXP" savestate
fi
This loads up, and runs the way it should. But when I shut it down by closing Quicken, VirtualBox closes but leaves an Icon on the Dock.
Here is what it shows as the two processes:
904 ?? 0:02.01 /Applications/VirtualBox.app/Contents/MacOS/VBoxXPCOMIPCD
908 ?? 0:26.60 /Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/MacOS/VirtualBoxVM --comment WindowsXP --startvm e8362d5c-34e1-491c-87b3-cfafac5a8562 --no-startvm-errormsgbox
If I Kill 904 and kill 908, the zombie goes away. I can rerun the script successfully without killing these processes, but the dock gets cluttered with them. Obviously adding a grep to identify the pids of these zombie processes and killing them could be added to the script and would work. But am I missing something?
Is this an artifact of some more basic problem? Is there a simpler solution?
comments on this or suggestions for a more succinct post will be welcome.
Re: Vbox applauncher script runs but leaves zombies on dock
Posted: 28. Oct 2013, 19:35
by mdaniel
I am experiencing a variant of this problem, but I am on 10.9 and VirtualBox 4.3.0. I am exclusively running Linux guests, so I can't speak to whether it is guest-os specific.
For me, even after issuing kill -9 against every VirtualBox process, the icons remain in the Dock. Only kextunload of the org.virtualbox.kext.VBoxDrv will cause the icon to finally vanish.
Interestingly enough, these items being in a stuck state also prevents OSX from rebooting, because that was the first thing that I tried to get out of the mess. It doesn't seem like the kexts are in an infinite loop, because the CPUs are idle. They're just locked up.
Re: Vbox applauncher script runs but leaves zombies on dock
Posted: 28. Oct 2013, 22:32
by jferguson
I added two more lines to my script - see below. running the script in AutoMator such that it looks like an application produced an error message on closing which likely was a notice that the kill process hadn't found the last pid. I added the goofy ps -A line to stop this and it worked. Yes, I know it's lousy, but I don't know what I'm doing and hope for forgiveness.
#!/bin/bash
if [ $( VBoxManage list runningvms | wc -l ) != "0" ]
then
VBoxManage guestcontrol "WindowsXP" exec --image c:\\"Program Files"\\Quicken\\qw.exe --username XX --password YY
VBoxManage controlvm "WindowsXP" savestate
else
VBoxManage startvm "WindowsXP" && VBoxManage guestcontrol "WindowsXP" exec --image c:\\"Program Files"\\Quicken\\qw.exe --username XX --password YY --wait-exit --wait-stdout
VBoxManage controlvm "WindowsXP" savestate
fi
ps -ef | grep "Virtual" | awk '{print $2}' | xargs kill
ps -A
I am using the same script without the last two lines on Ubuntu 12.04 and it works fine and flawlessly -- ie. it's reliable enough for spousal work.
The Mac OS application on the other hand doesn't work after a fresh system boot unless I've run VirtualBox and loaded Windows XP, then shut down in save state - and I have to repeat this every time I reboot the machine, but having done it once, all subsequent loads work fine from the AutomatorApplet.
It could be that it would work ok from the getgo (after a fresh system boot) if there was a pause in there somewhere to give the virtualbox time to boot.
ah well.......
Added afterthought: I'm running Vbox 4.2.18 on the Ubuntu system and 4.3 on the Mac. Could that be why one works and the other doesn't?
Re: Vbox applauncher script runs but leaves zombies on dock
Posted: 29. Oct 2013, 05:19
by jferguson
i decided to remove VB 4.3 from the mac and replace it with 4.2.18 - same as on the Ubuntu machine. Whoopee! I get to go through bringing Windows Xp up with the nightmare of the broken update interface. It's fixable but not automatically, if you want anything other than automatic updating. I can't imagine why Microsoft is so dodgy about making their own software OBVIOUSLY available instead of something you have to sniff out by googling the error codes. Advice to anyone planning to install xp as a guest. Have lots of time.
Re: Vbox applauncher script runs but leaves zombies on dock
Posted: 29. Oct 2013, 15:33
by jferguson
FIXED!! Yippee!!
I removed VirtualBox 4.3, installed 4.2.18, reinstalled Windows XP, then Quicken, and now it works fine. I need to check to see if this installation needs the "kill zombies" routine, but it runs from the Mac OS X 8.5.2 Automator-App script after a reboot and seems as stable as the version on my Ubuntu machine. It looks to me as if 4.3 needs some more work. I don't have any details to add to this and will not re-install 4.3 any time soon, not because the Oracle product is a challenge to install (it isn't) but because installing Windows XP from and sp2 image and getting windows updates to work is such a nightmare. I think I know how to do that now a little quicker, and if anyone wants to know how, let me know.
whew

Re: Vbox applauncher script runs but leaves zombies on dock
Posted: 29. Oct 2013, 15:47
by z3rodivide
I've tried saving state from command line on two different iMacs, I have the same issue only on one of those !
( both are running 10.9 and Vbox 4.3.0 )
I don't have any details to add to this and will not re-install 4.3 any time soon, not because the Oracle product is a challenge to install (it isn't) but because installing Windows XP from and sp2 image and getting windows updates to work is such a nightmare.
If you want to try different VirtualBox versions you don't have to recreates the machine all the time : just uninstall / install VirtualBox, ad use the same virtual machine you already created
(uninstalling doesn't remove your machines files).
You just have to remember to install the proper
Guest Additions inside you guest OS

Re: Vbox applauncher script runs but leaves zombies on dock
Posted: 29. Oct 2013, 21:25
by jferguson
z3rodivide wrote:I
If you want to try different VirtualBox versions you don't have to recreates the machine all the time : just uninstall / install VirtualBox, ad use the same virtual machine you already created
(uninstalling doesn't remove your machines files).
You just have to remember to install the proper
Guest Additions inside you guest OS

Thanks much for the thought. If I'd realized that I wouldn't now know so much about installing WinXP in today's inscrutable MS environment - it used to be sooooo easy.
I'm still using the launch script above with the grep and kill code. don't know if i need to but since it's quite stable i can't see any reason to change. I cannot believe I spent 3 days rigging this up so SWMBO can run a reasonable (not Essentials) Quicken on her new Air. Thank God, Apple runs the thing on Unix. If I'd had to dice with some other OS, I don't know if I'd have ever prevailed. I feel like the little girl in Jurrasic Park. "OOOOO, Unix, I know this."
Re: Vbox applauncher script runs but leaves zombies on dock
Posted: 30. Oct 2013, 00:02
by z3rodivide
If you downgraded to 4.2.18 you shouldn't have the problem with zombies processes (at least I hadn't, since I downgraded too). However, you can just keep the "grep and kill code", it will make ho harm (no process, no kill).
Can I ask you a favour ?
Could you please try to close & save state from GUI (choosing "Quit VirtualBox VM" from VirtualBox VM menu and then choosing "Save the machine state" option ),
and please confirm if you can then correctly restore the machine ? (as if it was saved from command line)
(your machine will have no damage even in case of error, it will just reboot the next time you start it, automatically discharging the corrupted saved state).
I opened a topic but none has answered me, and I can' t understand if I am the only one with this issue.
Thank you very much

Re: Vbox applauncher script runs but leaves zombies on dock
Posted: 30. Oct 2013, 02:15
by jferguson
z3rodivide wrote:
Can I ask you a favour ?
Could you please try to close & save state from GUI (choosing "Quit VirtualBox VM" from VirtualBox VM menu and then choosing "Save the machine state" option ),
and please confirm if you can then correctly restore the machine ? (as if it was saved from command line)
(your machine will have no damage even in case of error, it will just reboot the next time you start it, automatically discharging the corrupted saved state).
I opened a topic but none has answered me, and I can' t understand if I am the only one with this issue.
Thank you very much

I do this automatically: "save machine state" I found with my script that if I didn't do this the guest wouldn't load next time. you can see it in the script I posted. I do not get a corrupted save state. If something on windows locks up and I shut system down, the windows won't boot next time, so then I do "power down" and then it will reboot. So I think if a locked up windows is shut down in saved to machine state, it takes two boots to fix. Is that helpful?
I made this whole thing so my wife can run Quicken on her new Mac Air. We bought the Air after someone told me that there was a good Quicken (financial management software) that ran on Macs. He was wrong. the one for Macs, Quicken Essentials is like a comic book, not serious. Then I found there was a better Quicken but it could not handle the data from the current version completely, so then it was do the VirtualBox thing. I'd already used VirtualBox to run Windows98 for a paerticular application on my ubuntu Linux machine and it worked very well, so I did the same thing on the new mac air and after discovering that VirtualBox 4.3 has problems, I went back to 4.2.18 which works well.
maybe this doesn't answer your question?
Re: Vbox applauncher script runs but leaves zombies on dock
Posted: 30. Oct 2013, 10:41
by z3rodivide
I do this automatically: "save machine state" I found with my script that if I didn't do this the guest wouldn't load next time.
thanks!

you answered my question, so you have the same issue : saving and restoring works only from command line.
If you just try to "quit" the VM (from the menu item, or by shortcut CMD + Q) and choose to save the state, the next time the guest won't load.
Unfortunately, this bug prevents the possibility to shutdown the VM automatically when you just shutdown OSX ( because, in that case, the system will call the "quit" command, which doesn't work).
I really can't figure out why nobody solicited this, since it's stopped working since version 4.1.18
Thanks for your feedback
