Command Line shutdown with other people logged on

Discussions related to using VirtualBox on Linux hosts.
ToddAndMargo
Posts: 306
Joined: 6. Aug 2007, 02:24

Command Line shutdown with other people logged on

Post by ToddAndMargo »

Hi,

Host: CentOS 5.2
Guest: XP-SP3

From a Crontab command, I am trying to turn off an XP virtual machine. I use this command:

kdesu -u todd -c "/usr/bin/VBoxManage controlvm VirtualXP acpipowerbutton"

It works, except, I get a prompt on the xp virtual machine stating "other people are
logged onto this computer. Shutting down Windows might cause them to loose data.
Do you want to continue shutting down Windows? Yes, No" And there are
other uses and I don't care. I just want it to shutdown. But, I can not because
I am not there at 23:30 at night to click on "Yes".

Is there a way to over ride this behavior and just shut down?

Many thanks,
-T
illa
Posts: 46
Joined: 2. Jul 2008, 15:02

Post by illa »

Maybe try this key on the guest:

HKEY_CURRENT_USER\Control Panel\Desktop\AutoEndTasks=1

Its suppose to end all tasks and log off all users on XP shutdown... never tried it myself
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

You could use the savestate option.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Tod, As S says you can hibernate (using XP terminology) the VM using savestate. But to answer your Q directly, this is really an XP Q around how to suppress warning Qs on ACPI power down and needs to be asked on an XP forum not a VirtualBox one.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
ToddAndMargo
Posts: 306
Joined: 6. Aug 2007, 02:24

Post by ToddAndMargo »

Sasquatch wrote:You could use the savestate option.
I like it. Presuming "savestate" is the same as a freeze. Am I
correct?

1) do a save state
2) run my "dump" backup
3) do a resume.

The only draw back I see is that restore the VM will make Windows
think I did an power off (didn't go through shutdown).

But, I occurres to me that it I had to restore the thing, I could
always do a resume on the restored VM and not a startvm.
Will this trick Windows into thinking it was never shutdown?

Many thanks,
-T
ToddAndMargo
Posts: 306
Joined: 6. Aug 2007, 02:24

Post by ToddAndMargo »

illa wrote:Maybe try this key on the guest:

HKEY_CURRENT_USER\Control Panel\Desktop\AutoEndTasks=1

Its suppose to end all tasks and log off all users on XP shutdown... never tried it myself
Thank you!

I was unaware that this key log everyone off. Can anyone verify this?

-T
ToddAndMargo
Posts: 306
Joined: 6. Aug 2007, 02:24

Post by ToddAndMargo »

TerryE wrote:...this is really an XP Q around how to suppress warning Qs on ACPI power down and needs to be asked on an XP forum not a VirtualBox one.
I asked. They don't know. Which is why I asked here. I am presuming
I am not the only one who has thought of the ramifications of backing
up a running VM.
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

No but you don't shutdown the VM, you just savestate it, and resume when you are finished. Also a sensible use of snapshots makes a big difference to the backup times.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
ToddAndMargo
Posts: 306
Joined: 6. Aug 2007, 02:24

Post by ToddAndMargo »

TerryE wrote:Tod, As S says you can hibernate (using XP terminology) the VM using savestate.
Hi Terry,

I have my power set to "always on". I do this as I have never found
a working Windows machine with "sleep" set that actually recovers
consistently on a regular basis (you get what you pay for). So I set
the VM to always on. And, in this app, it really does need to be
always on. (It will survive being off for an hour during backup.)

Will this interfere with the "savestate" option?

I guess what I do no understand how "savestate" works. Does it

1) send a signal to the Windows VM to "Hybernate",

OR

2) does it tell the VM's hypervisor (or whatever VB calls it) to
freeze the machine?

Many thanks,
-T
ToddAndMargo
Posts: 306
Joined: 6. Aug 2007, 02:24

Post by ToddAndMargo »

TerryE wrote:No but you don't shutdown the VM, you just savestate it, and resume when you are finished. Also a sensible use of snapshots makes a big difference to the backup times.
If I have to restore one of these save stated files (dump/restore),
Do I restart the machine with a "resume" or do I have to do
a "startvm" and get the proverbial Windows finger wagged at me
for an unsafe shutdown?

-T
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

The VMM savestate is not the same as sleeping or hibernation in XP. It "freezes" the machine instantaneously. The Windows OS is not involved. The only way it is aware is that the VBox time sync will resync the clock when it is awake.

And a Q for you: why an hour for the backup. I was expecting you to say 5 mins? If your VMs are appliances, that it stable OS configurations running a single app-suite each, then the main volatility should be business data only. If you get your system stable then clean it up as I suggest in my tutorial All about VDIs, move each VDI to a dynamic form and rebaseline it, your backups should only be a few Gb. gzispping these to disk-to-disk should only take a minute or so. You can then restore your VM and spool the backups to your NAS or whatever in slow time.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
ToddAndMargo
Posts: 306
Joined: 6. Aug 2007, 02:24

Post by ToddAndMargo »

TerryE wrote:And a Q for you: why an hour for the backup. I was expecting you to say 5 mins?
I am doing a full dump. This includes all the Linux file system as
well (samba data, etc.). My dumps are running at 22MB/s raw and
12 MB/s compressed, which is pretty good. If I have the time,
I do a full backup (nothing is going on at 23:00 to 01:00 in the
morning).

I do not do incremental backups if I can avoid it. They are a pain in
the neck to restore. And I have to do a lot of restoring lately as stinkin'
Cent OS 5.2 corrupts my file system when I try to cut a data DVD.
(See http://bugs.centos.org/view.php?id=3002).

The idea is to make the restore as easy as possible, not the backup.
And, I am getting way, way too good at restoring a completely
corrupted server. :'( It is a great skill to have, but ...

-T
Last edited by ToddAndMargo on 21. Aug 2008, 20:31, edited 1 time in total.
ToddAndMargo
Posts: 306
Joined: 6. Aug 2007, 02:24

Post by ToddAndMargo »

TerryE wrote:The VMM savestate is not the same as sleeping or hibernation in XP. It "freezes" the machine instantaneously. The Windows OS is not involved. The only way it is aware is that the VBox time sync will resync the clock when it is awake
1) What happens when I restore a previous day's VDI file from backup?

2) Does it just start where it left off and adjust the clock?

3) Do I do a "startvm" or a "resume"?

-T
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

Todd, please, if you have something to add, edit your previous post and do not make a new one until someone responded. The number of replies will grow and with every new post I, and others, might think that someone else is talking here (I hardly look at usernames). It also bumps the topic unneeded.

Now for your questions.
1) All it does it pause the machine, save the state it's in and when you start it again (there is no 'resume' command option) it will be as if it never went off. The Guest OS will only sync the time as if there is a change from daylight saving time. Except it can be a few more hours or a few minutes.

2) See above.
3) Same. There is no 'resume' command option. You would see this in the manual.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
ToddAndMargo
Posts: 306
Joined: 6. Aug 2007, 02:24

Post by ToddAndMargo »

Sasquatch wrote:3) Same. There is no 'resume' command option. You would see this in the manual.
Page 107: 8.6 VBoxManage startvm
This command starts a virtual machine that is currently in the
“Powered off” or “Saved” states. This is provided for backwards
compatibility only.

1) I presume that startvm is the correct command to resume a saved
state VM. Am I correct?

2) I presume startvm automatically can tell the difference between the
two (“Powered off” or “Saved”)? Am I correct?

3) What does the manual mean by "This is provided for backwards
compatibility only"? Is there some other more modern command
I should be using?

Many thanks,
-T
Post Reply