Jump to content

Recommended Posts

Posted

There is direct command for virtualbox commandline to poweroff a machine

 

vboxmanage controlvm "machinename"  poweroff

 

But not there for logoff, so used below command like launching an exe on OS.

 

vboxmanage guestcontrol "machinename"  run --exe  "C:\windows\system32\Shutdown.exe" --username "user_name" --password "password_types" -- Shutdown.exe -l

 

Similarly, I tried to login back by launching explorer.exe but not working.

Is it possible to do from any autoit command to login the user if I launch it from vboxmanage or any other way like psexec.

Please suggest.

Posted (edited)
 controlvm                 <uuid|vmname>
                            pause|resume|reset|poweroff|savestate|

https://askubuntu.com/questions/805662/how-to-start-and-stop-virtualbox-guests-via-command-line/805794

in Ubuntu you can do poweroff, have you even tried it in windows? Make sure it's not going to just pull the plug, and that it will shutdown gracefully. at least I think that is what you are looking for

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Posted

Hi @Earthshine

Thanks for the reply.

I am able to poweroff.

But no direct command for logoff.

So, I am launching shutdown.exe -l for that.

But I didn't find any similar command for login back.

Can you suggest any.

If any autoit command is there, then I will copy that using vboxmanage copy argument and will run that.

Posted

Yeah, i used this already.. This is working when I started the machine from poweroff state and not asking for credentials.

But for a machine which is logged out and with login screen asking for password, this is not working,.

Posted (edited)

you could try UIAutomation. read FAQ 31

depending on what virutalbox is written in will depend on what you use

 

there are alternatives to AutoIt that should work, such as python--which is one of my darling favorites

https://stackoverflow.com/questions/19993381/creating-and-logging-into-a-linux-virtual-machine-in-automation-with-python

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...