Added possibility to start VMs during system boot

Discussions related to using VirtualBox on Mac OS X hosts.
Andrew Brehm
Posts: 42
Joined: 28. Mar 2012, 17:19

Added possibility to start VMs during system boot

Post by Andrew Brehm »

Has anyone got this to work on Mac OS X (Mountain Lion)?

I added org.virtualbox.vboxautostart.plist to launchctl and made sure it runs. I also created the configuration and pointed the plist to it.

I then configured a VM with vboxanage modifyvm "myvm" --autostart-enabled on and --autostop-type savestate.

But the VM neither saves its state when the host shuts down nor does it start automatically at boot.

What am I doing wrong?

(I don't mean details, like typos above, I mean am I missing an entire step?)
ChipMcK
Volunteer
Posts: 1095
Joined: 20. May 2009, 02:17
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Windows, OSX
Location: U S of A

Re: Added possibility to start VMs during system boot

Post by ChipMcK »

Andrew Brehm wrote: and made sure it runs
You got past

Code: Select all

launchctl: Dubious ownership on file (skipping): /Library/LaunchDaemons/org.virtualbox.vboxautostart.plist
nothing found to load
with

Code: Select all

sudo chown root:wheel

And same for the configuration file?


Edited: correct chmod to chown
Andrew Brehm
Posts: 42
Joined: 28. Mar 2012, 17:19

Re: Added possibility to start VMs during system boot

Post by Andrew Brehm »

ChipMcK wrote:
Andrew Brehm wrote: and made sure it runs
You got past

Code: Select all

launchctl: Dubious ownership on file (skipping): /Library/LaunchDaemons/org.virtualbox.vboxautostart.plist
nothing found to load
with

Code: Select all

sudo chown root:wheel

And same for the configuration file?


Edited: correct chmod to chown
Not so much got past. I never saw that error. I think file permissions for the plist are correct. (I added several other plists for launchctl myself.)
Andrew Brehm
Posts: 42
Joined: 28. Mar 2012, 17:19

Re: Added possibility to start VMs during system boot

Post by Andrew Brehm »

Andrew Brehm wrote:
ChipMcK wrote:
Andrew Brehm wrote: and made sure it runs
You got past

Code: Select all

launchctl: Dubious ownership on file (skipping): /Library/LaunchDaemons/org.virtualbox.vboxautostart.plist
nothing found to load
with

Code: Select all

sudo chown root:wheel

And same for the configuration file?


Edited: correct chmod to chown
Not so much got past. I never saw that error. I think file permissions for the plist are correct. (I added several other plists for launchctl myself.)
Still doesn't work.

The autostart service is loaded.

Code: Select all

$ sudo launchctl list |grep org.virtualbox.vboxautostart
-	13	org.virtualbox.vboxautostart
And the VM is set to autostart.
$ vboxmanage showvminfo "Windows Server 2008"|grep Auto
Autostart Enabled: on
Autostart Delay: 1
However, the VM simply doesn't start.
Andrew Brehm
Posts: 42
Joined: 28. Mar 2012, 17:19

Re: Added possibility to start VMs during system boot

Post by Andrew Brehm »

Did anyone get this to work at all?
ChipMcK
Volunteer
Posts: 1095
Joined: 20. May 2009, 02:17
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Windows, OSX
Location: U S of A

Re: Added possibility to start VMs during system boot

Post by ChipMcK »

Andrew Brehm wrote:

Code: Select all

-	13	org.virtualbox.vboxautostart
The 13 says an error occurred; if the process sccessfully started, the return would have been Zero

from the man page
With no arguments, list all of the jobs loaded into launchd in three columns. The first column displays the PID of the job if it is running. The second column displays the last exit status of the job. If the number in this column is negative, it represents the negative of the signal which killed the job. Thus, "-15" would indicate that the job was terminated with SIGTERM. The third col- umn is the job’s label.
Edited to add the quote from man launchctl
Andrew Brehm
Posts: 42
Joined: 28. Mar 2012, 17:19

Re: Added possibility to start VMs during system boot

Post by Andrew Brehm »

ChipMcK wrote:
Andrew Brehm wrote:

Code: Select all

-	13	org.virtualbox.vboxautostart
The 13 says an error occurred; if the process sccessfully started, the return would have been Zero

from the man page
With no arguments, list all of the jobs loaded into launchd in three columns. The first column displays the PID of the job if it is running. The second column displays the last exit status of the job. If the number in this column is negative, it represents the negative of the signal which killed the job. Thus, "-15" would indicate that the job was terminated with SIGTERM. The third col- umn is the job’s label.
Edited to add the quote from man launchctl
So the service didn't start because of a broken pipe (signal 13)?

SIGPIPE 13 Term Broken pipe: write to pipe with no readers

How could that be? How did you get it to start (if you did)?
ChipMcK
Volunteer
Posts: 1095
Joined: 20. May 2009, 02:17
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Windows, OSX
Location: U S of A

Re: Added possibility to start VMs during system boot

Post by ChipMcK »

Andrew Brehm wrote:How did you get it to start (if you did)?
I have not tried. Just pointing out what you ignored.

Update: Tried the plist on my system

Code: Select all

 - 0        org.virtualbox.vboxautostart
Andrew Brehm
Posts: 42
Joined: 28. Mar 2012, 17:19

Re: Added possibility to start VMs during system boot

Post by Andrew Brehm »

ChipMcK wrote:
Andrew Brehm wrote:How did you get it to start (if you did)?
I have not tried. Just pointing out what you ignored.

Update: Tried the plist on my system

Code: Select all

 - 0        org.virtualbox.vboxautostart
Interesting.

Will have to find out what pipe the thing is talking about.
ChipMcK
Volunteer
Posts: 1095
Joined: 20. May 2009, 02:17
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Windows, OSX
Location: U S of A

Re: Added possibility to start VMs during system boot

Post by ChipMcK »

To the basic trouble shooting steps you bypassed? ? ?
Andrew Brehm
Posts: 42
Joined: 28. Mar 2012, 17:19

Re: Added possibility to start VMs during system boot

Post by Andrew Brehm »

ChipMcK wrote:To the basic trouble shooting steps you bypassed? ? ?
What do you mean "bypassed"? I have done all the steps listed in this thread.

The problem is, as it turns out, that starting the service does an error 13. All the file permissions and settings are correct as per the things listed in this thread. That's why I wanted to know if anyone got this to work. I followed all the instructions.
Andrew Brehm
Posts: 42
Joined: 28. Mar 2012, 17:19

Re: Added possibility to start VMs during system boot

Post by Andrew Brehm »

I don't know why it showed a 13.

It now (and I haven't changed anything) reports this:


$ sudo launchctl list |grep org.virtualbox.vboxautostart
- 0 org.virtualbox.vboxautostart

However, when this machine last booted, none of the VMs started up automatically.
ChipMcK
Volunteer
Posts: 1095
Joined: 20. May 2009, 02:17
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Windows, OSX
Location: U S of A

Re: Added possibility to start VMs during system boot

Post by ChipMcK »

Try a google search:
virtual machines automatic startup site:forums.virtualbox.org

Also suggest checking out VirtualBox on Linux Hosts viewforum.php?f=7
Andrew Brehm
Posts: 42
Joined: 28. Mar 2012, 17:19

Re: Added possibility to start VMs during system boot

Post by Andrew Brehm »

ChipMcK wrote:Try a google search:
virtual machines automatic startup site:forums.virtualbox.org

Also suggest checking out VirtualBox on Linux Hosts viewforum.php?f=7
I tried Google searches. And I also searched this forum.

Could you please just for a short moment pretend that this is not solely about my inability to use Google, follow instructions or read this forum and give me a hint what might be wrong, if you know?
ChipMcK
Volunteer
Posts: 1095
Joined: 20. May 2009, 02:17
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Windows, OSX
Location: U S of A

Re: Added possibility to start VMs during system boot

Post by ChipMcK »

Andrew Brehm wrote:I also searched this forum.
This forum is for OS X Hosts. The feature was developed for Linux Hosts viewforum.php?f=7 .
There are a number of posts on that forum for the feature.
Post Reply