Autostart VirtualBox VM problem

OpenSuse 11.3 x64 + VirtualBox non-oss

I have 2 servers running on VMs and I have the computer’s bios set to power on in case of power failure (its also on a battery backup) and this works as expected and my main OS (suse 11.3 x64 KDE4) reboots.

The problem is with auto starting my VMs, I placed 2 app launchers in /home/user/.kde4/autostart folder, command = (VBoxManage startvm vserver) but when I reboot and the VMs try to start I get an error dialog from VirtualBox that states I need to run command to install the kernal mode driver for VBOX (/etc/init.d/vboxdrv setup).

I have another setup just like this one using Suse 11.0 for main OS and VMs and restarting with this method works well.

I suspect the auto start of the VMs is occurring before the kernal mode driver is ready.

Is their a way to delay the auto start till its ready or a better way to do this all together.

Use that service:
automatically recompile kernel modules after kernel update
It will recompile the vboxdrv module automatically if needed (after a kernel update) and before virtualbox get started.

That doesnt’ seem normal, but you could for example use a script like that one:

#! /bin/bash

VBOX=0
while  $VBOX -lt 1 ] ; do
	service vboxdrv status | grep -q vboxdrv && VBOX=1
	sleep 1
done
exec VBoxManage startvm vserver

Thankyou for the bit of code please_try_again I will give it a try.

I know about this and the kernel module has already been compiled and it works it just throws the error trying to autostart from a reboot.