Page 1 of 1

Start a Powered-Off VM Remotely!

Posted: 2. Aug 2012, 20:55
by NamViet
Hi all,

Is there anyway to Start a Powered-Off virtual machine Remotely ?
I have learned in "Chapter 7. Remote virtual machines" the way to connect Remote Desktop to a VM when it's in Running stage. However if my VM is Powered-off, how can I start it remotely ? (not come to the host computer and press Start button on VirtualBox?).

:idea: I ask this question because I am facing with flowing situation: when the host machine is shared by many people, each of them connect remote to a virtual machine in the host. When a person finished his job, he should be able to Shutdown his virtual machine to save the resource on the host. When he come back to work, he need to connect and boot his virtual machine from the PC on his table. How can he do so?!

This situation can be solved if I use vmware server 2.0, with that product we can boot a Powered-off virtual machine remotely.

Cheers,
NamViet

Re: Start a Powered-Off VM Remotely!

Posted: 2. Aug 2012, 22:14
by mpack
? Surely that's a question about the host? I.e. if you can operate the host remotely then you can start applications remotely.

Re: Start a Powered-Off VM Remotely!

Posted: 2. Aug 2012, 23:22
by Zium
Psexec lets you execute command-line remotely (VBoxmanage in your case)

Re: Start a Powered-Off VM Remotely!

Posted: 3. Aug 2012, 03:13
by NamViet
mpack wrote:? Surely that's a question about the host? I.e. if you can operate the host remotely then you can start applications remotely.
In that case, I need to share the host access to all people!
I just want to assign each person 1 virtual machine only, not share the total host access, how can I do ?

Re: Start a Powered-Off VM Remotely!

Posted: 3. Aug 2012, 03:20
by NamViet
Zium wrote:Psexec lets you execute command-line remotely (VBoxmanage in your case)
Could you please explain more detail ? If user don't have root access to the host computer, how can thay excute VBoxmanage command-line remotely ?
Thanks!

Re: Start a Powered-Off VM Remotely!

Posted: 3. Aug 2012, 07:24
by Zium
You should expose your security needs.
Psexec will require rights, not sure which one yet except it'll of course do the trick with Administrator.

Re: Start a Powered-Off VM Remotely!

Posted: 3. Aug 2012, 15:21
by scottgus1
You could also "roll your own" remote-start utility. Here's how I would do it:

A constantly-running VBscript on the host monitors a shared folder on the host for a file of a certain format (certain name and/or extension). The file being looked for would be a text file, containing the name of the VM that needs to be launched and any desired password data. When the host VBscript finds the correct file in the shared folder, it opens the file, authenticates the password, reads the VM name, and launches the VM using Vboxmanage. Then it deletes the text file in the shared folder.

On each guest is another VBscript, run by the user when the VM is needed, that makes the correct text file containing the desired VM name and the password, and puts the text file in the host shared folder for the host VBscript to read.

Some fancy stuff could be done with this, such as having the host script check the status of the VM before starting it, to see if if is already started, and feeding back to the remote user's script another text file which the remote script waits for, telling the remote script when the VM is running. The remote script could then launch the Remote Desktop session automatically. With such feedback, users would only need one shortcut, no need for one program to start the VM and another to start the RDP session.

Of course VBscript is all Windows host/guest related, but Mac/Linux should have something similar.

Re: Start a Powered-Off VM Remotely!

Posted: 4. Aug 2012, 06:00
by NamViet
scottgus1 wrote:You could also "roll your own" remote-start utility. Here's how I would do it:

A constantly-running VBscript on the host monitors a shared folder on the host for a file of a certain format (certain name and/or extension). The file being looked for would be a text file, containing the name of the VM that needs to be launched and any desired password data. When the host VBscript finds the correct file in the shared folder, it opens the file, authenticates the password, reads the VM name, and launches the VM using Vboxmanage. Then it deletes the text file in the shared folder.

On each guest is another VBscript, run by the user when the VM is needed, that makes the correct text file containing the desired VM name and the password, and puts the text file in the host shared folder for the host VBscript to read.

Some fancy stuff could be done with this, such as having the host script check the status of the VM before starting it, to see if if is already started, and feeding back to the remote user's script another text file which the remote script waits for, telling the remote script when the VM is running. The remote script could then launch the Remote Desktop session automatically. With such feedback, users would only need one shortcut, no need for one program to start the VM and another to start the RDP session.

Of course VBscript is all Windows host/guest related, but Mac/Linux should have something similar.
This is very innovative solution, thank you very much!
is there any exiting script like this?

Re: Start a Powered-Off VM Remotely!

Posted: 6. Aug 2012, 13:57
by scottgus1
I have a similar, non-VB-related, mind-a-shared-folder running for our in-house instant messaging software we use at work. It's really just checking for text files, opening and reading them, writing text files, running commands.

There's lots you can do if you learn scripting. Take a look at the Scriptong Guys site (http://technet.microsoft.com/en-us/scriptcenter/default), and here: http://gallery.technet.microsoft.com/sc ... xt%20Files.