At the top of rc.local notice that you aren't using bash, you're using sh
(and you may not have certain env vars set yet in that environment)
#!/bin/sh -e
from the sh manpage:
-e errexit       If not interactive, exit immediately if any untested
command fails.  The exit status of a command is considered to be explic‐
                            itly tested if the command is used to control an
if, elif, while, or until; or if the command is the left hand operand of an
                            “&&” or “||” operator.

Furthermore, I don't think you need to run modprobe if you installed vbox
from the repo. Just issuing your headless command should work fine.

AJ ONeal


On Tue, Jul 28, 2009 at 9:05 AM, Ken D'Ambrosio <[email protected]> wrote:

> Hey, all.  Running Ubuntu 9.10 (alpha) at work, and I want VirtualBox to
> start up automagically on boot.  So I threw
>
> modprobe vboxdrv
> modprobe vboxnetflt
> /usr/bin/VBoxHeadless --startvm XP
>
> into my /etc/rc.local file.  I rebooted.  Virtualbox didn't start up.  I
> did an "lsmod", and lo, neither of the modules had loaded.  So, as root, I
> executed /etc/rc.local, and got:
>
> r...@bree:/etc# ./rc.local
> FATAL: Error inserting vboxdrv
> (/lib/modules/2.6.31-3-generic/updates/dkms/vboxdrv.ko): Invalid argument
>
>
> So then I cut-and-pasted the contents of the file into the *same root
> session*, and they modprobe'd like a champ.
>
> Any insights that might prevent my further decline into senility will be
> graciously accepted.
>
> -Ken
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>

Reply via email to