Starting virtual machines during system boot with ver 4.2
Starting virtual machines during system boot with ver 4.2
Hi, I recently installed the latest version of VirtualBox 4.2, but I have a problem, I dont see the configuration files to make my virtual machines start up when I start the server.
Could anyone tell me where are these files?
look in / etc / default / and nothing, also in / etc / vbox /
or someone write here a example file?
thanks
Could anyone tell me where are these files?
look in / etc / default / and nothing, also in / etc / vbox /
or someone write here a example file?
thanks
-
- Posts: 161
- Joined: 9. Aug 2010, 01:47
- Primary OS: Other
- VBox Version: OSE self-compiled
- Guest OSses: ?
- Location: H i m a l a y a s
- Contact:
Re: Starting virtual machines during system boot with ver 4.
you create the files yourself. see user manual advanced topics
Re: Starting virtual machines during system boot with ver 4.
Thanks, but the help in manual advanced topics is not very good, could give some examples of how you make those files??
-
- Posts: 2
- Joined: 2. Oct 2012, 20:56
- Primary OS: Fedora other
- VBox Version: OSE Fedora
- Guest OSses: Windows, Fedora, CentOS, FreeNAS
- Contact:
Re: Starting virtual machines during system boot with ver 4.
See if this helps, I just did this on my Fedora 17 system
Create the file /etc/default/virtualbox and add a few variables.
VBOXAUTOSTART_DB which contains an absolute path to the autostart database directory and VBOXAUTOSTART_CONFIG which contains the location of the autostart config settings. The file should look similar to this:
# vi /etc/default/virtualbox
# virtualbox defaults file
VBOXAUTOSTART_DB=/etc/vbox
VBOXAUTOSTART_CONFIG=/etc/vbox/vbox.cfg
Now we need to create /etc/vbox/vbox.cfg file and add
# Default policy is to deny starting a VM, the other option is "allow".
default_policy = deny
# Create an entry for each user allowed to run autostart
myuserid = {
allow = true
}
If you are the only user you can just add the line default_policy = allow to the vbox.cfg file.
Set permissions on directory to the vboxuser group and make sure users can write to the directory as well as sticky bit.
# chgrp vboxusers /etc/vbox
# chmod 1775 /etc/vbox
Add each of the users to the vboxusers group. Make sure to check their group memberships so they do not loose any groups they currently have assigned to their id.
# groups myuserid
myuserid
# usermod -G vboxusers myuserid
Every user who wants to enable autostart for individual machines has to set the path to the autostart database directory with
$ VBoxManage setproperty autostartdbpath /etc/vbox
Now we are ready to set the VM's we choose to start.
$ VBoxManage modifyvm --autostart-enabled on
This will create a myuserid.start file in /etc/vbox directory
Now restart the vboxautostart-service to read in the changes.
# service vboxautostart-service restart
Create the file /etc/default/virtualbox and add a few variables.
VBOXAUTOSTART_DB which contains an absolute path to the autostart database directory and VBOXAUTOSTART_CONFIG which contains the location of the autostart config settings. The file should look similar to this:
# vi /etc/default/virtualbox
# virtualbox defaults file
VBOXAUTOSTART_DB=/etc/vbox
VBOXAUTOSTART_CONFIG=/etc/vbox/vbox.cfg
Now we need to create /etc/vbox/vbox.cfg file and add
# Default policy is to deny starting a VM, the other option is "allow".
default_policy = deny
# Create an entry for each user allowed to run autostart
myuserid = {
allow = true
}
If you are the only user you can just add the line default_policy = allow to the vbox.cfg file.
Set permissions on directory to the vboxuser group and make sure users can write to the directory as well as sticky bit.
# chgrp vboxusers /etc/vbox
# chmod 1775 /etc/vbox
Add each of the users to the vboxusers group. Make sure to check their group memberships so they do not loose any groups they currently have assigned to their id.
# groups myuserid
myuserid
# usermod -G vboxusers myuserid
Every user who wants to enable autostart for individual machines has to set the path to the autostart database directory with
$ VBoxManage setproperty autostartdbpath /etc/vbox
Now we are ready to set the VM's we choose to start.
$ VBoxManage modifyvm --autostart-enabled on
This will create a myuserid.start file in /etc/vbox directory
Now restart the vboxautostart-service to read in the changes.
# service vboxautostart-service restart
-
- Posts: 1
- Joined: 8. Oct 2012, 11:02
Re: Starting virtual machines during system boot with ver 4.
Dear friends, I did all instructions stated above, but still not able to use autostart
My /etc/vbox/vbox.cfg
# Default policy is to deny starting a VM, the other option is "allow".
default_policy = deny
# Create an entry for each user allowed to run autostart
skywalker = {
allow = true
}
And I receive following error in command line:
skywalker@sky-top:~$ service vboxautostart-service start
/etc/init.d/vboxautostart-service: 2: /etc/vbox/vbox.cfg: default_policy: not found
/etc/init.d/vboxautostart-service: 4: /etc/vbox/vbox.cfg: skywalker: not found
/etc/init.d/vboxautostart-service: 5: /etc/vbox/vbox.cfg: allow: not found
/etc/init.d/vboxautostart-service: 6: /etc/vbox/vbox.cfg: Syntax error: "}" unexpected
Maybe somebody meets the same problem and have some workaround.
Thanks in advance.
My /etc/vbox/vbox.cfg
# Default policy is to deny starting a VM, the other option is "allow".
default_policy = deny
# Create an entry for each user allowed to run autostart
skywalker = {
allow = true
}
And I receive following error in command line:
skywalker@sky-top:~$ service vboxautostart-service start
/etc/init.d/vboxautostart-service: 2: /etc/vbox/vbox.cfg: default_policy: not found
/etc/init.d/vboxautostart-service: 4: /etc/vbox/vbox.cfg: skywalker: not found
/etc/init.d/vboxautostart-service: 5: /etc/vbox/vbox.cfg: allow: not found
/etc/init.d/vboxautostart-service: 6: /etc/vbox/vbox.cfg: Syntax error: "}" unexpected
Maybe somebody meets the same problem and have some workaround.
Thanks in advance.
Re: Starting virtual machines during system boot with ver 4.
There is an error in the tutorial. The file name vbox.cfg seems to be reserved. It appears in vboxdrv script as a file containing commands. So just rename vbox.cfg to anything else and it will work. But remember to make the change also in /etc/default/virtualbox, to have the correct reference.
Re: Starting virtual machines during system boot with ver 4.
Thanks a lot newlife007 for you exemple...
on MacOS X (10. i got this error after executing
any ideas ?
on MacOS X (10. i got this error after executing
Code: Select all
VBoxManage setproperty autostartdbpath /etc/vbox
Code: Select all
VBoxManage: error: Cannot set the autostart database path (VERR_NOT_SUPPORTED)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component SystemProperties, interface ISystemProperties, callee nsISupports
VBoxManage: error: Context: "COMSETTER(AutostartDatabasePath)(Bstr(a->argv[1]).raw())" at line 871 of file VBoxManageMisc.cpp
Re: Starting virtual machines during system boot with ver 4.
Jumping in here with an update that may be helpful to others:
I followed the tutorial (with corrections), and successfully got a machine to boot by running the command. However, when I boot the host, my guest machine does not boot. I added a log message to the 'start' section of the init.d script for vboxautostart-service and confirmed that it is running.
UPDATE: A more thorough insertion of logging identified that "vboxdrvrunning" was returning false in /etc/init.d/vboxautostart-service:
Commenting out the exit (effectively ignoring the error) fixed the issue.
System: Ubuntu 12.04
I followed the tutorial (with corrections), and successfully got a machine to boot by running the
Code: Select all
service vboxautostart-service start
UPDATE: A more thorough insertion of logging identified that "vboxdrvrunning" was returning false in /etc/init.d/vboxautostart-service:
Code: Select all
begin_msg "Starting VirtualBox VMs configured for autostart";
vboxdrvrunning || {
fail_msg "VirtualBox kernel module not loaded!"
exit 0
}
System: Ubuntu 12.04
Re: Starting virtual machines during system boot with ver 4.
Thank WTGPhoben. I am running Ubuntu 12.04 and having the same problem. I followed your suggestion (i.e. comment out that 'exit 0' line in /etc/init.d/vboxautostart-service) and now it works like a charm.
Re: Starting virtual machines during system boot with ver 4.
It seems that (setting the) autostartdbpath is not supported (VERR_NOT_SUPPORTED ) or required on OS X.Hète wrote:Thanks a lot newlife007 for you exemple...
on MacOS X (10. i got this error after executingCode: Select all
VBoxManage setproperty autostartdbpath /etc/vbox
any ideas ?Code: Select all
VBoxManage: error: Cannot set the autostart database path (VERR_NOT_SUPPORTED) VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component SystemProperties, interface ISystemProperties, callee nsISupports VBoxManage: error: Context: "COMSETTER(AutostartDatabasePath)(Bstr(a->argv[1]).raw())" at line 871 of file VBoxManageMisc.cpp
The VirtualBox manual only mentions it for Linux and /etc/vbox would not be a good candidate:
Stefan9.23.1. Linux: starting the autostart service via init wrote: The first one is VBOXAUTOSTART_DB which contains an absolute path to the autostart database directory. The directory should have write access for every user who should be able to start virtual machines automatically. Furthermore the directory should have the sticky bit set.
Re: Starting virtual machines during system boot with ver 4.
With VirtualBox 4.8.3, I'm seeing a problem where the *.start and *.stop files are not being created (and no error occurs) after executing the command:
Anybody else seeing this? (Host is Ubuntu Server 12.04-4 amd64). In case it helps, I do see and error when trying to disable autostart for this VM:
Any ideas?
Code: Select all
VBoxManage modifyvm myvm --autostart-enabled on
Code: Select all
VBoxManage modifyvm myvm --autostart-enabled off
VBoxManage: error: Removing machine 'myvm' to the autostart database failed with VERR_FILE_NOT_FOUND
VBoxManage: error: Details: code NS_ERROR_UNEXPECTED (0x8000ffff), component SessionMachine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "COMSETTER(AutostartEnabled)(ValueUnion.f)" at line 2616 of file VBoxManageModifyVM.cpp
-
- Posts: 1
- Joined: 7. Nov 2015, 00:02
Re: Starting virtual machines during system boot with ver 4.
In the file vbox.cfg, remove the white spaces:
The error "default_policy: not found" error disapeared
Code: Select all
# Default policy is to deny starting a VM, the other option is "allow".
#Changed "default_policy = allow" to "default_policy=allow"
default_policy=allow