Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Start Virtualbox VM automatically

  1. #11
    Join Date
    Nov 2009
    Location
    Co Down, N Ireland
    Beans
    125
    Distro
    Ubuntu 14.10 Utopic Unicorn

    Re: Start Virtualbox VM automatically

    OK moved to Plan B. Teamviewer and remotely logging into the host GUI to start it through the VirtualBox Manager GUI. Would still like to resolve this however at least I have something workable.

  2. #12
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: Start Virtualbox VM automatically

    Just recently, at evey kernel update I get that missing vboxdrv error and have to run the
    Code:
    sudo /etc/init.d/vboxdrv setup
    command, even though I have dkms installed on the host machine. This has only started with the past couple of versions of VBox, so I assume it has something to do with these recent versions.

    I haven't bothered to look for any solution to this as it is frankly quicker just to run the setup command as shown rather than spend time searching, but I run VBox only on a local machine, and not as a server, so it is not important to me; I'm just looking a development versions of *ubuntu OSs for the sake of interest only.

  3. #13
    Join Date
    Nov 2009
    Location
    Co Down, N Ireland
    Beans
    125
    Distro
    Ubuntu 14.10 Utopic Unicorn

    Re: Start Virtualbox VM automatically

    I've seen that message too and in the past I was able to run the suggested command however when I run it now I'm getting:

    Code:
    sudo: /etc/init.d/vboxdrv: command not found
    So not sure what's going on now.

  4. #14
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Start Virtualbox VM automatically

    It needs to run under your userid, with YOUR environment. Using any other userid will not work. That is what the su -l userid is supposed to handle. Perhaps I didn't RTFM correctly and missed the needed option for su? Please check my work.
    It needs to run under your userid, with YOUR environment. https://help.ubuntu.com/community/EnvironmentVariables rc.local doesn't have much environment - for vboxmanage to do what you want with the correct userid AND with the correct environment - that needs to be set BEFORE calling the program.

    To see the differences in environments:

    a) env > ~/normal.env
    b) put env > /home/the-userid-home/rc-local.env into the /etc/rc.local file and reboot.

    Compare the to files - I'd use meld for this ---- meld ~/normal.env ~/rc-local.env, but diff and sdiff work too.
    See all those differences? Anything jump out at missing that would impact virtualbox? Is HOME set? That's a big one.
    Last edited by TheFu; April 22nd, 2016 at 05:20 PM.

  5. #15
    Join Date
    Mar 2015
    Beans
    22

    Re: Start Virtualbox VM automatically

    What I add in my user's crontab is the following:
    Code:
    @reboot /usr/bin/VBoxManage startvm "NameOfTheVM" --type headless &

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •