I'm running Virtualbox 4.3.8 on Ubuntu 13.10, amd64. I'm attempting to get the autostart running for a virtual machine but I can't seem to get it working. I've created /etc/default/virtualbox file with the following in it:
VBOXAUTOSTART_DB=/etc/vbox
VBOXAUTOSTART_CONFIG=/etc/vbox/autostart.cfg
In my autostart file, I have the following:
default_policy = deny
<virtualbox user> = {
allow = true
}
I changed the permissions of my /etc/vbox directory so that the user starting the virtual machine has permissions to that directory and I can touch files in there to create and modify them. After running...
VBoxManage modifyvm OpenVPN --autostart-enabled on
no files get created in that /etc/vbox directory. When running the following, I get the error:
/etc/init.d/vboxautostart-service start
Starting VirtualBox VMs configured for autostartls: cannot access /etc/vbox/*.start: No such file or directory
$
I'm guessing that VBoxManage autostart should create some .start files in that directory, but it's not happening. Is there something I'm doing wrong? Does anybody have any tips on how I can get this working?
Thanks in advanced.
Autostart failing on Ubuntu
Re: Autostart failing on Ubuntu
I'm seeing the exact same problem: no *.start or *.stop files are being created in the /etc/vbox directory, AND no error occurs when executing:
Maybe this helps diagnose: There is an error when trying to turn off autostart for the VM:
Code: Select all
$ VBoxManage modifyvm myvm --autostart-enabled onCode: 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
Re: Autostart failing on Ubuntu
I had same problem after experimenting with some how to guides for vbox user.
My decision was back to root user.
after command
VBoxManage modifyvm NameOfVM --autostart-enabled on
I just create file in /etc/vbox/root.start with content one letter "1"
of course filename root for root user
Tested with reboot
My decision was back to root user.
after command
VBoxManage modifyvm NameOfVM --autostart-enabled on
I just create file in /etc/vbox/root.start with content one letter "1"
of course filename root for root user
Tested with reboot
Re: Autostart failing on Ubuntu
Hi I have the same problem. Does anyone found the solution? How to run it with 'vbox' user?
-
Smackey's dad
- Posts: 128
- Joined: 2. Apr 2014, 04:11
- Primary OS: Ubuntu 12.04
- VBox Version: OSE Debian
- Guest OSses: Ubuntu Trusty
- Location: Austin, TX
- Contact:
Re: Autostart failing on Ubuntu
There are a few nuances to getting autostop/autostart to work correctly:
Setting directory and permissions
User permissions
VirtualBox Global Config
VM autostart settings
Change run-levels
/etc/default/virtualbox config
Testing manually
Use this script: http://source.virtualbox.guru/scripts/810-cfg-autostart to put it all together
Setting directory and permissions
Code: Select all
chgrp vboxusers /etc/vbox
chmod 1775 /etc/vbox
Code: Select all
VB_USER=specifiedvbuser
usermod -aG vboxusers $VB_USER
Code: Select all
VBoxManage setproperty autostartdbpath /etc/vbox
Code: Select all
VBoxManage modifyvm "${VB_VM_NAME}" --autostart-enabled on --autostop-type savestate --autostart-delay 10
Code: Select all
update-rc.d -f vboxdrv remove
update-rc.d -f virtualbox remove
update-rc.d -f vboxautostart-service remove
update-rc.d -f vboxweb-service remove
update-rc.d -f vboxballoonctrl-service remove
update-rc.d -f vboxdrv defaults 21 79
update-rc.d -f virtualbox defaults 22 78
update-rc.d -f vboxautostart-service defaults 91 09
update-rc.d -f vboxweb-service defaults 23 77
update-rc.d -f vboxballoonctrl-service defaults 23 77
Code: Select all
VBOXAUTOSTART_DB=/etc/vbox
VBOXAUTOSTART_CONFIG=/etc/vbox/autostart.cfg
SHUTDOWN_USERS=<enter your VB user here>
SHUTDOWN=savestate
Code: Select all
service vboxautostart-service stop
service vboxautostart-service start
Re: Autostart failing on Ubuntu
I found a solution for: no [userid].start or [userid].stop files are being created in the /etc/vbox directory, AND no error occurs when executing.
In my case, I was trying to start a group of VMs that I imported VMWare Server. I found the solution, when I created a new VM and tried:
It worked! So I removed all my VMs (keeping the data) and created new VMs for each one. I copied the VMDKs from the old VM folder to the new ones and attached them one by one. Now everything is automatically starting
If any virtualbox developers read this, PLEASE improve the "VBoxManage modifyvm autostart/autostop" error reporting. Silently failing is incredibly frustrating. I ended up reinstalling my OS twice before stumbling upon a solution.
In my case, I was trying to start a group of VMs that I imported VMWare Server. I found the solution, when I created a new VM and tried:
Code: Select all
VBoxManage modifyvm "${VB_VM_NAME}" --autostart-enabled onIf any virtualbox developers read this, PLEASE improve the "VBoxManage modifyvm autostart/autostop" error reporting. Silently failing is incredibly frustrating. I ended up reinstalling my OS twice before stumbling upon a solution.