ur Posted October 30, 2019 Posted October 30, 2019 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.
Earthshine Posted October 30, 2019 Posted October 30, 2019 (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 October 30, 2019 by Earthshine My resources are limited. You must ask the right questions
ur Posted October 30, 2019 Author Posted October 30, 2019 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.
Earthshine Posted October 30, 2019 Posted October 30, 2019 nope, you are going to have to stick with running the OS command. My resources are limited. You must ask the right questions
Earthshine Posted October 30, 2019 Posted October 30, 2019 (edited) it's in the manual how to config the vm for auto login https://www.virtualbox.org/manual/ch09.html#autologon customize the vm to allow it. Edited October 30, 2019 by Earthshine My resources are limited. You must ask the right questions
ur Posted October 30, 2019 Author Posted October 30, 2019 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,.
Earthshine Posted October 30, 2019 Posted October 30, 2019 (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 October 30, 2019 by Earthshine My resources are limited. You must ask the right questions
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now