Quantcast
Channel: Ubuntu Forums - Virtualisation
Viewing all articles
Browse latest Browse all 4211

Virtualbox automatic starting of VM only partially works

$
0
0
I am running Ubuntu 13.10 and Virtualbox 4.3.6. I have been struggling to get automatic starting of VM's working, this is what I have done. Created a user "tom" and a user "jerry". Before creating VM's on these user accounts, I have edit the default virtualbox configuration file and add the path to autostart database directory file and autostart configuration file to it.

nano /etc/default/virtualbox

And added the following entries:
Code:

VBOXAUTOSTART_DB=/etc/vbox
VBOXAUTOSTART_CONFIG=/etc/vbox/vboxauto.conf

After this I specified the virtualbox user that is allowed to start VM.

nano /etc/vbox/vboxauto.conf

Add an entry for each user allowed to run autostart:
Code:

default_policy = deny
tom = {
allow = true
}
jerry = {
allow = true
}

In order vboxusers to write to the vbox directory, the permissions (and sticky bit) have been set.

Code:

chgrp vboxusers /etc/vbox
chmod 1775 /etc/vbox

Set the path to the autostart database directory for the user allowed above, command below have been repeated after logging into both accounts seperatly:

Code:

VBoxManage setproperty autostartdbpath /etc/vbox
Set VirtualBox to automatically start the VM (my-VM) when system starts up and poweroff it when system halts.
VBoxManage modifyvm my-VM –autostart-enabled on –autostop-type poweroff

After execution I have the .start and .stop files generated for both users, so far everyting is looking good. During booting I noticed that the startup script was aborted, to fix this you have to change the order over loading of the Virtualbox kernel modules, you do this as following:

Code:

sudo update-rc.d -f vboxdrv remove
sudo update-rc.d -f vboxdrv defaults 19

After the reboot I noticed that for the user "jerry" the VM's actially started automatically, but for the user "tom" nothing happened.

Manual execution of the startup script, either under the user account you have logged in or as super user (sudo) the script does actually do it's work for the "jerry" user, but for the user "tom" it only works when you execute the init script non-priveliged. So, when logged in as Tom the following commands do work:

Code:

tom@system:$ /etc/init.d/vboxautostart-service start
tom@system:$ /etc/init.d/vboxautostart-service stop



but running them like this has no effect (and this behaviour is also preventing the VM to start during boot)
Code:

tom@system:$ sudo /etc/init.d/vboxautostart-service start
tom@system:$ sudo /etc/init.d/vboxautostart-service stop

I am overlooking something, any ideas to fix this issue?

Viewing all articles
Browse latest Browse all 4211

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>