Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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 Ubuntu in VMware 8 in a public lab and sometimes the computer may be restarted or shut down accidentally. Is there any way to prevent ubuntu from shutting down in order to continue running the program from where it has been stopped?

share|improve this question
What do you mean by, prevent Ubuntu from shutting down? When the lab pc restarted or shuts down, everything shuts down??? I've got a feeling that you are taking about saving a session? – zeref Oct 2 '12 at 18:06
up vote 2 down vote accepted

If the host operating system shuts down uncontrolled (you say accidentally) be it by an unwanted manual shut down, after an application crash, or worst a power failure, there is no way any guest operating system (not even Ubuntu) can detect and react on such an incident. All data from the guest OS will be lost.

To prevent this we need to at least save the guest session prior to shut down of the host. Depending on the host OS it may be done automatically by including this into the shutdown routine (which of course needs time to finish before the host machine was powered off).

share|improve this answer
thanks, yes I mean how to save the session. dear Takkat can you please guide me how to include that into shutdown routine? thank you – mery f Oct 3 '12 at 5:11
You need VMWare's Suspend and Resume feature. This is run from the host OS. Sorry, but we have no experience on how to do that from commnand line or script. – Takkat Oct 3 '12 at 7:54
Thanks a lot for your help – mery f Oct 3 '12 at 8:43
On Windows 7 applications can prevent shutdown. If his host is Win7, he could write a service, that prevents shutdown. – Barafu Albino Jul 15 '13 at 14:02

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.