VBoxAutostartSvc

Discussions related to using VirtualBox on Windows hosts.
Post Reply
abcdefgh
Posts: 77
Joined: 22. Jul 2018, 03:29
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Linux Mint 20.3 Mate

VBoxAutostartSvc

Post by abcdefgh »

VBox version 6.1.22 r144080 (Qt5.6.2)
Host: Win10-1803
Guest: Linux Mint 18.3

What I am trying to do: Get the VM to automatically load on Windows startup.
What I have tried: 'Startup.cmd' is located here:
C:\Users\Administrator\Favorites\Links\Programs\Startup\Startup.cmd
I've pasted it into the code section below.
It starts Total Commander, waits 2 seconds, TextPad, waits 2 seconds, then it was intended to start the Mint18 VM but I added an exit to ':EOF' at that point and turned the entire script into documentation.
Kindly read it for more info. I think it has everything that's needed.
The part that's relevant to VBoxAutostartSvc is part 4.

Thanks for helping this poor, babbling idiot. Regards,
Mark.

Code: Select all

START C:\totalcmd\TOTALCMD64.EXE

TIMEOUT /T 2 >NUL

START "C:\Program Files\TextPad 7\TextPad.exe" "c:\textpad\workspaces\Mark's Presets Cookbooks.tws"

TIMEOUT /T 2 >NUL

GOTO :EOF

Note: I have tried all of the following (with Windows restarts between each and every step).
(May I reiterate that I restarted Windows at each and every step?)

Except for step 3 (which succeeded but still complained), every attempt to automatically launch my VM on startup has failed.
Note: Failures 1 & 2 may be attibutable to the quirks of the Windows shell, but I've never been able to figure out how to pass to it successfully. Certainly, if the commands above succeeded (and they did), then the commands below should have also succeeded (and they did not).

1. When run by this script, this command:
      START "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" startvm Mint18 -E VBOX_RELEASE_LOG_FLAGS="time timeprog"
   fails and provokes this:
      "Windows cannot find 'startvm'."
   but when run via a command prompt, it succeeds.

2. When run by this script, this command:
      START "C:\Program Files\Oracle\VirtualBox\VirtualBoxVM.exe" --startvm Mint18 -E VBOX_RELEASE_LOG_FLAGS="time timeprog"
   fails and provokes this:
      "Windows cannot find '--startvm'."
   but when run via a command prompt, it succeeds.

3. When run by this script, this command:
      START C:\VMs\Mint18\Mint18.vbox
   succeeds but also provokes this:
      "Failed to open a session for the virtual machine Mint18.
      "
      "The machine 'Mint18' is already locked by a session (or being locked or unlocked).
      "
      "Result Code: VBOX_E_INVALID_OBJECT_STATE (0x80BB0007)
      "Component: MachineWrap
      "Interface: IMachine {85632c68-b5bb-4316-a900-5eb28d3413df}"

Note: I am an administrator. My username is "administrator".

4.1. I created c:\VMs\Mint18\Mint18.vbox.autostart.config.txt as follows:
        default_policy = allow
        administrator = {
        allow = true
        startup_delay = 10
        }
4.2. I confirmed that c:\VMs\Mint18\Mint18.vbox.autostart.config.txt exists and is correct.
4.3.1. I created administrator environmental:
          VBOXAUTOSTART_CONFIG
       and set it to:
          c:\VMs\Mint18\Mint18.vbox.autostart.config.txt
4.3.2. I created System environmental:
          VBOXAUTOSTART_CONFIG
       and set it to:
          c:\VMs\Mint18\Mint18.vbox.autostart.config.txt
4.4. I ran the following command:
        VBoxAutostartSvc install --user=administrator
4.5. I noticed that VBoxAutostartSvc was not running and had been marked as "Startup Type" "Manual".
4.6. I changed VBoxAutostartSvc, "Log on as"
     from:
        .administrator
     to:
        Local System
4.7. I confirmed that VBoxAutostartSvc is running and is marked as "Startup Type" "Automatic".
After reading this:
viewtopic.php?f=6&t=102243&p=496573&hil ... vc#p496573
I made a hex dump of 'Mint18.vbox.autostart.config.txt.
Here it is:
Mint18.vbox.autostart.config.txt.jpg
Mint18.vbox.autostart.config.txt.jpg (48.17 KiB) Viewed 1604 times
I'm actually markfilipak (which somehow became 'markfilipak2', then 'abcdefgh'). I've been here since 15 Jul 2012 but lost my name during the great shift to SSO (single sign-on) during 2017, and have not been able to recover it.
Post Reply