Antwise community forums

Full Version: VMs only start when I log in and got suspended when logging out
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a VMware Workstation v16.2.2 running on my Win Server 2019 and a bunch of VMs which should start (and keep running all the time) when the system starts.
So I bought VimaRun and added them to it, so they should start at system start and keep running even if nobody has logged in.

As far as I can see, they all got started - but only after I login (as Administrator) to the machine.
After that login, the VMware Workstation window pops up and all the VMs got started - but not if I don't log in...
...and when I log out the user, all running VMs will go to suspend state - which is totally unwanted!

Why? Huh
And how can I prevent this?

Do I need to automatically log in my Administrator after server start?
But even if I do this - how can I prevent it from suspending the machines?
Hi,



(2022-02-07, 08:20:44)Bodenseematze Wrote: [ -> ]I have a VMware Workstation v16.2.2 running on my Win Server 2019 and a bunch of VMs which should start (and keep running all the time) when the system starts.
So I bought VimaRun and added them to it, so they should start at system start and keep running even if nobody has logged in.
That's exactly how it is supposed to work.


(2022-02-07, 08:20:44)Bodenseematze Wrote: [ -> ]As far as I can see, they all got started - but only after I login (as Administrator) to the machine.
After that login, the VMware Workstation window pops up and all the VMs got started - but not if I don't log in...
I suspect the VM's are running, but they don't have a network connection. Without that.. you can't reach them.

For a customer of mine with a Windows 2019 server I have also seen this issue and the resolution there was to change the vimarun service from “Automatic” to “Automatic (delayed start)”.
The problem is that when it is set to “Automatic” it can actually start the VM before other dependencies like network are already running and by setting it to delayed start that is no longer a problem.
Next update of vimarun will take care of this and use “Automatic (delayed start)” instead.

Hopefully I get to release that update soon as this has bitten quite a few users.

(2022-02-07, 08:20:44)Bodenseematze Wrote: [ -> ]...and when I log out the user, all running VMs will go to suspend state - which is totally unwanted!

Why? Huh
And how can I prevent this?

Hmm.. that is weird.
Did you configure vimarun with the same Administrator user as that you use to login?

--
Wil
The Vimarun service is already at "Automatic (delayed start)" and it uses the same Domain-Administrator user as with which I'm logged in.

All my VMs have a bridged network configuration - if that matters..

BTW, there seems to be a bug in VMware related to network - when I combine two physical network cards to one with loadbalancing, the VMs are unable to reach the host on which they're running - but all other devices in the network are reachable.
When the physical network cards are not combined (e.g. one of the two is unused) everything works inside the VMs and the own physical host is reachable without problems...


The suspend "feature" is very annoying - normally I connect to that server via RemoteDesktop - and have always to be careful only to disconnect and not to log out...
Is there any possibility to remotely start a suspended VM?
Hi,

OK.

VMware network bugs I can't fix, but there is indeed a chance that it is related. We'll see.
However any bugs in vimarun I can address.
FWIW, I actually use that same scenario you are describing with a customer of mine and have no problems when I log out.
So I'm curious as to what the difference is between the two scenarios.
edit: After pondering about this for a bit I think my scenario is actually slightly different so I do have some ideas, but I still would love to see your support bundle to confirm my suspicions.

Can you please email me the support bundle?
You can create the support bundle from the help menu and then email it support@vimalin.com

--
Wil
Hi,

OK.. finally had some time down here to run tests.
For now I ran tests with VMware Workstation Player (as I have no logs I do not know what you use, I will run tests with Workstation Pro later on)

When I run a VM in the background then I do not see your issue at all.
The VM starts before login, after login and continues to run after I logout from the host instead of disconnect the remote desktop sesion.

When I run a VM in the foreground then the VM starts before login, continues to run after login, but it switches to the foreground as it should. Then on logout... it suspends, just like you are seeing.

Note that this is not vimarun that suspends your VM here. What you are seeing is normal VMware Player behavior as you can configure it to either suspend or shut down the VM on close of the application (File->Preferences-> check what to do when closing a virtual machine, suspend or shut down)
Since you close the desktop session on a logout, all applications that run within the desktop session are closed.

VMware Workstation Pro has a configuration option for this. (Edit->Preferences->Workspace -> Keep VM's running after Workstation closes) But I haven't run tests with that yet.

So for the moment, if you run VMware Player, then the suggestion is to run VM's in the background.
For Workstation Pro I suggest to make sure the "Keep VM's running after Workstation closes" checkbox is checked.

Hope this helps,
--
Wil
Of course you can't fix VMware (network) problems - I just wanted to tell in case it's related... ;-)

I use VM Workstation Pro v16 (newest version, currently 16.2.2) and the option to keep VMs running after Workstation closes is of course set.
The Workstation version does not have the mentioned Player option for what to do when closing a VM? (at least I didn't find it)

Could it be a problem that I sometimes manually restart / reboot the VMs and that with that action the "background" flag got lost?

As workaround: would it be possible that Vimarun checks at login if the configured VMs are running or suspended and resume them (maybe additional configuration option)?
Or to permanently check if the background option is still set for the configured VMs (if that's the problem)?

EDIT: BTW, when I start / resume a VM with Vimarun the VMware Workstation dialog always pops up and does the task - and if it has not been started / closed before, it'll start...
...is that normal behaviour? Even when all VMs were set to "background"?

EDIT2: I just had to restart my server - so I was able to do some more tests...
Before I rebooted the server I checked the state of my autostart VMs: some of them were suspended and others were running.
After the restart the autostart VMs begins to start - I waited until two of them were started and then remotely (rdp) logged in.
I did not open the VMware Workstation GUI - just waited a longer time...
The other autostart VMs also got started in the background (as configured) and no VMware Workstation GUI pops up (it took a longer while, but it worked).
After all were started, I still didn't open the Workstation GUI and logged off, waited a while an logged in again - all VMs kept running.
Then I configured another VM to be an autostart VM but started it via the VMware GUI and also rebooted an running autostart VM remotely (via RDP) and one via VMware Workstation GUI (restart guest). I also wanted to do this with ine VM via the Vimarun GUI but I recognized that all (old) autstart VMs are shown as not running - only the newly configured autostart VM which I started via the VMware Workstation GUI was shown as running...
Then I logged off and on again.
Results: all the old autostart VMs kept running (even the one which I rebooted remotely) - but the newly configured one which I started via the VMware GUI had been suspended.
The Vimarun GUI still shows all old VMs as stopped and the new one as suspended - so I started that one via Vimarun GUI. That opens the VMware GUI and resumed that VM - but it seems to be in foreground, even as it's configured to run in background...


Addition: can I change the starting order of the VMs in Vimarun? As it took a longer time until all VMs have been started, I'd like to start some earlier than others...
Hi,

I have also replied to you by email, thanks for sending me the logs as that helps in understanding what is happening.

The main reason you are having trouble is the name of the folder where your VM's are stored.
There's a character translation issue that I need to debug (for others reading along: an "ä" ends up as a "ä") to see where this originates.

This might also be why VMware Workstation isn't able to push your VM to the background when you start it from the GUI.
More research will tell.

It is at least good that it works if you start the VM's in the background that things work.

The VM's not being detected as running in Vimarun is the character translation issue.

I have send you a private built to test that can start VM's in the background from vimarun directly.

More details will follow once I get a chance to look at it.
--
Wil