Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

joemolomo

macrumors member
Original poster
May 20, 2008
75
25
Hi, i'm currently setting up a new mac image for the school i work at. Wanting to get rid of Bootcamp as we have a lot of problems with the windows side bluescreening. So i've setup a Windows Login account that launches Virtual Box on login and loads the vbox image. I'm currently looking into running it using VBoxManage from command line so i can restrict the users interaction with the GUI basically trying to keep them out of the mac side completely so it's quite transparent to the user. Just need some help with once the VM is shutdown have a logout command run to log the user out of the mac windows account automatically, anyone know how to do this? I've read this maybe possible in linux so i'm guessing i can run the logout command on mac too, but i'm just not sure how to do it, automator? thanks in advance.

Edit:
Hi just to let others know I found this code somewhere online can't remember where, this allowed me to do the above.

on run
do shell script "vboxmanage startvm 'Windows XP'"
end run

on idle
tell application "System Events" to set foo to (exists process "VirtualBox VM")
if foo then -- VirtualBox VM is running
return 2 -- seconds
else -- goodbye
ignoring application responses
tell application "loginwindow" to «event aevtrlgo»
end ignoring
end if
end idle
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.