[Resolved] The Best Way To Auto Run VMs on Host Start Up

Discussions related to using VirtualBox on Windows hosts.
Post Reply
jrtibayan
Posts: 7
Joined: 5. Dec 2018, 04:59

[Resolved] The Best Way To Auto Run VMs on Host Start Up

Post by jrtibayan »

Hi all. I've just joined the forum and kinda need a little help.
I have these VMs and would like to run them every time the computer reboots.
What would be the best way to do this on Windows Server 2016?
Below are other conditions that needs to be met.
1. must run vms on startup
2. must run even when not logged on
3. when I do log on and open virtualbox the VM that are running should show that they are running.

Right now I have met condition 1 and 2 by using the method below
create a .cmd file that starts the vms
use task manager to run that file on startup even if not logged on

The problem with the solution I'm using above is it does not meet condition number 3.
When I log in and open Virtualbox. The VMs are not running but I know that they are since I can access them using Remote Desktop.

It would be great if you guys can help me with this. Maybe there's a preferred method to do this kind of thing.
Thanks a lot in advance.
Last edited by socratis on 6. Dec 2018, 03:30, edited 1 time in total.
Reason: Marked as [Resolved].
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: The Best Way To Auto Run VMs on Host Start Up

Post by socratis »

There's a single, simple rule to remember: each VM runs in the context of the user that registered/launched it, it's not shareable.

So, when you use the Task Scheduler to start the VM, that VM runs in the context of the System user, not your specific user.

The best way to communicate/control the VM would be to enable VRDP on the VM and use your favorite RDP client to connect to it.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Rootman
Posts: 251
Joined: 1. Oct 2012, 18:29

Re: The Best Way To Auto Run VMs on Host Start Up

Post by Rootman »

Years ago I messed around doing this. I took far too long in trying to do it 'right' and found the simplest solution was to enable autologon for the user I used, put shortcuts for the VMs into the the users Startup folder and then also put a shortcut to lock the server in the startup folder too.

So it boots, begins to start the VMs and locks immediately. I suppose there is a few seconds it's logged in and open, although you'd be hard pressed to try and catch it to do anything.

I created a shortcut to the following and placed it into the startup folder to lock the station.
C:\Windows\System32\rundll32.exe
Args:
user32.dll,LockWorkStation
jrtibayan
Posts: 7
Joined: 5. Dec 2018, 04:59

Re: The Best Way To Auto Run VMs on Host Start Up

Post by jrtibayan »

Haha! I feel silly forgetting something so simple.
I already considered having it login automatically but was hesitant because other people may use it.
I forgot I can just lock it again after running the VMs.
PROBLEM SOLVED! :)

Thank you so much Rootman
Last edited by socratis on 6. Dec 2018, 02:53, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
Post Reply