Automatic startup. How?

Discussions related to using VirtualBox on Windows hosts.
Post Reply
billwill
Posts: 8
Joined: 22. Apr 2009, 15:38
Primary OS: MS Windows 2003
VBox Version: OSE other
Guest OSses: ubuntu

Automatic startup. How?

Post by billwill »

How can I write a windows CMD file or script to be used with the task scheduler (unattended in the middle of the night) which will stop a guest system then stop Virtualbox so that it can do an NTbackup of the complete Virtual disk(S) and then restart Virtualbox and reboot the guest system. ?

Host is Windows SBS server R2, guest is Ubuntu server.

I have looked at vboxmanage, but there does not seem to be a sensible HELP file. the HELP does show the available parameters, but clearly it needs a sequence of these Vboxmanage commands. There is nothing to help you get the correct sequence of these commands. I keep getting messages that the name of the guest system is not registered, when clearly it IS, because I run it.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Automatic startup. How?

Post by Perryg »

You can use the vboxmanage startvm to start the guest. Stopping it will mean creating a second CMD file to run. I have this setup and it works well.
See section 8 of the vbox users manual for the proper calls. Create them and put them in the host Windows scheduler.
billwill
Posts: 8
Joined: 22. Apr 2009, 15:38
Primary OS: MS Windows 2003
VBox Version: OSE other
Guest OSses: ubuntu

Re: Automatic startup. How?

Post by billwill »

Perryg wrote:You can use the vboxmanage startvm to start the guest. Stopping it will mean creating a second CMD file to run. I have this setup and it works well.
See section 8 of the vbox users manual for the proper calls. Create them and put them in the host Windows scheduler.

I already tried that but it keeps saying that the guest is not registered. Can you post thye actual sequence of commands that you used.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Automatic startup. How?

Post by Perryg »

To set this up you need to first tell it where virtualbox is stored in c: <enter> then the folder, cd <path to your virtualbox directory>, then run the startvm command
Example:
C: (drive where virtualbox is installed)
cd .virtualbox (your directory will be different)
vboxmanage startvm "Ubuntu810" (your machine name will be different)

Then just make another CMD that uses Windows shutdown command to turn it off
billwill
Posts: 8
Joined: 22. Apr 2009, 15:38
Primary OS: MS Windows 2003
VBox Version: OSE other
Guest OSses: ubuntu

Re: Automatic startup. How?

Post by billwill »

Ah, I found what my problem was!!!

The virtual computer names are CASE SENSITIVE !!

Naughty! for a Windows version of a program... :D

So now I know how to do it. I'll try post the resulting CMD file here when I've got it all working as designed..
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Automatic startup. How?

Post by Perryg »

Sorry I forgot to mention for Windows users file case matters.
Post Reply