Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using oneiric with unity. I want to find a solution to automatically save the state of my virtualbox virtual machine before I logout or shutdown because I always forget to do it manually. I know I can use Vboxmanage controlvm [vmname] savestate to save state in terminal. But how do I make ubuntu execute this command before logging out?

share|improve this question
This is not so much about VirtualBox, as it is about running scripts automatically in Ubuntu. – iglvzx Jan 1 '12 at 23:22
up vote 2 down vote accepted

You can add the Vboxmanage command to your ~/.bash_logout file and it will execute upon the logoff event.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.