Jimbo, I worked out some procedures to allow VMware VMs to be run without having to logon and to continue to run when the user logs off.
Currently, VMware has functionality built-in called "Shared VMs" that allows for this. However, VMware has announced that after version 16.x this feature will no longer be available. So the steps below are a workaround to allow standard VMware VMs to start without a user having to logon and to remain running after a user logs out.
I hope this helps someone! I worked this out because
1) I'm not a fan of Hyper-V (won't get into reasons now)
2) I wanted to have a Plex Server start automatically within a VM without ever having to logon to my system.
Okay, enough said. Here is the procedure:
I would have to verify this, but it is possible that the ability to suspend the VM upon shutdown / reboot may require Win 10 Pro, not Home because it will require a Group Policy and I think that Home has no Group Policy editor. I may be wrong on that point. However, you can still start the VM(s) without having to logon.
VMware workstation had a feature called "Shared VMs" that allowed a VM to run without a user needing to logon to Windows. VMware has announced that this feature is deprecated and will no longer be available after VMware Workstation 16.x. However, I have a procedure that will still allow you to run VMs without the need to logon.
NOTE: Be aware that this procedure will start the VM with no GUI. As a result, you will want to make sure that the VM is configured to allow access via remote desktop so that you can connect that way. In addition, you may want to set your VM to autologon so that any programs you want to run within the VM can launch at startup. For example, this is the procedure you would want to follow for a Plex Server VM. Note that this applies only to the VM. You do NOT need to logon to the host system to allow the VM to run.
Verify the location of VMware Workstation. By default, it is located here:
C:\Program Files (x86)\VMware\VMware Workstation
Within that folder you should find the vmrun.exe file.
Now, locate the path to the .vmx file for the VM that you want to automatically run.
Example: "D:\VMware Virtual Machines\Windows 10 21H1 Clean Install Test Platform\Windows 10 21H1 Clean Install Test Platform.vmx"
Create a batch file that looks like this (modify the paths as necessary):
"C:\Program Files (x86)\VMware\VMware Workstation\vmrun.exe" start "D:\VMware Virtual Machines\Windows 10 21H1 Clean Install Test Platform\Windows 10 21H1 Clean Install Test Platform.vmx" nogui
Option 1: This will run the VM upon logon.
Open Run and type "Shell:Common Startup"
Drag and drop the batch file that you created into this location. Click Continue to allow the batch file to be run as Administrator.
Option 2: This will run the VM without the need to logon.
Run the task scheduler, right-click Task Scheduler Library, select Create Task.
Give a name to the task, choose Run whether user is logged in or not, configure for Windows 10.
On the Triggers tab, select New... begin the task at startup. Make sure that the Enabled checkbox is checked.
On the Actions tab, select New... > Start a Program should be selected for the action. For Program/Script specify the full path and file name of the batch file.
Example: "C:\Scripts\Autostart VM.bat"
Click on OK, then OK again and enter your credentials.
--------------------
To suspend the VM when the host is shutdown
Setup another batch file on the host with a command in it like the one below. Modify the paths as necessary:
"C:\Program Files (x86)\VMware\VMware Workstation\vmrun.exe" suspend "D:\VMware Virtual Machines\Windows 10 21H1 Clean Install Test Platform\Windows 10 21H1 Clean Install Test Platform.vmx"
Then set it run when the host shuts down by placing the batch file in "C:\WINDOWS\system32\GroupPolicy\Machine\Scripts\Shutdown". Open the Group Policy editor "gpedit.msc" and then in "Computer Configuration - Windows Settings - Scripts" add your batch file to the shut down script option.
--------------------
Additional Information
If you don't want to access your VM via Remote Desktop, you can gain access to it via the VMware GUI by doing this:
1) From the VMware GUI, select the VM in question (you won't see a GUI, so just click within the space where it would normally appear) and press CTRL-J to suspend it.
2) Once suspended, press CTRL-B to resume the VM.
Result: The VM is now visible.
IMPORTANT: Once making the GUI for the VM visible, if you logout the VM will be suspended so you will need to lock the system rather than logging out if you want it to remain running. If you do not make the VM visible, it will continue to run even when you logoff.
3) When done, make sure to close the VM GUI. A warning will be displayed indicating that some VMs are still powered on. Choose "Run in Background". If you don't do this, the VM will not be suspended cleanly when you physically shutdown or reboot the system.
NOTE: If you do not want to have to deal with this every time, within the VMware GUI, choose Edit > Preferences... Workspace > Keep VMs running after Workstation closes. By doing this, you won't be prompted after closing the VMware GUI whether you want to keep the VM(s) running.
Reminder: To keep the VM running, make sure to LOCK your system rather than signing out. If you do not bring the GUI to the foreground, you can sign out and the VM will continue to run.