Virtual Box Settings to automatically run VMs on boot












0















I followed this carefully: How to start Virtual box machines automatically when booting?



It "broke" VirtualBox. I had to remove the autostart stuff and run a reconfigure command that VirtualBox recommended in the error message to get VirtualBox working again.



Created the file /etc/default/virtualbox



# virtualbox defaults file
VBOXAUTOSTART_DB=/etc/vbox
VBOXAUTOSTART_CONFIG=/etc/vbox/vbox.cfg


This is /etc/vbox/vbox.cfg:



# Default policy is to deny starting a VM, the other option is "allow".
default_policy = deny
# Create an entry for each user allowed to run autostart
USERNAME = {
allow = true
}


Then:



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

sudo usermod -a -G vboxusers USERNAME


It seems it is having a problem reading /etc/vbox/vbox.cfg



:~$ ls -l /etc/vbox
total 8
-rw------- 1 USERNAME USERNAME 1 Dec 14 01:37 USERNAME.start
-rw-r--r-- 1 root root 179 Dec 14 01:31 vbox.cfg


Next:



VBoxManage setproperty autostartdbpath /etc/vbox
VBoxManage modifyvm <uuid|vmname> --autostart-enabled on


This created USERNAME.start file in /etc/vbox directory - Although the file appears to be empty.



Then the Error:



● vboxautostart-service.service
Loaded: loaded (/usr/lib/virtualbox/vboxautostart-service.sh; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2018-12-14 01:41:57 CST; 27s ago
Process: 4002 ExecStart=/usr/lib/virtualbox/vboxautostart-service.sh start (code=exited, status=2)

Dec 14 01:41:57 HOST systemd[1]: Starting vboxautostart-service.service...
Dec 14 01:41:57 HOST vboxautostart-service.sh[4002]: /usr/lib/virtualbox/vboxautostart-service.sh: 2:/etc/vbox/vbox.cfg: default_policy: not found
Dec 14 01:41:57 HOST vboxautostart-service.sh[4002]: /usr/lib/virtualbox/vboxautostart-service.sh: 4: /etc/vbox/vbox.cfg: USERNAME: not found
Dec 14 01:41:57 HOST vboxautostart-service.sh[4002]: /usr/lib/virtualbox/vboxautostart-service.sh: 5: /etc/vbox/vbox.cfg: allow: not found
Dec 14 01:41:57 HOST vboxautostart-service.sh[4002]: /usr/lib/virtualbox/vboxautostart-service.sh: 6: /etc/vbox/vbox.cfg: Syntax error: "}" unexpected
Dec 14 01:41:57 HOST systemd[1]: vboxautostart-service.service: Control process exited, code=exited status=2
Dec 14 01:41:57 HOST systemd[1]: vboxautostart-service.service: Failed with result 'exit-code'.
Dec 14 01:41:57 HOST systemd[1]: Failed to start vboxautostart-service.service.









share|improve this question



























    0















    I followed this carefully: How to start Virtual box machines automatically when booting?



    It "broke" VirtualBox. I had to remove the autostart stuff and run a reconfigure command that VirtualBox recommended in the error message to get VirtualBox working again.



    Created the file /etc/default/virtualbox



    # virtualbox defaults file
    VBOXAUTOSTART_DB=/etc/vbox
    VBOXAUTOSTART_CONFIG=/etc/vbox/vbox.cfg


    This is /etc/vbox/vbox.cfg:



    # Default policy is to deny starting a VM, the other option is "allow".
    default_policy = deny
    # Create an entry for each user allowed to run autostart
    USERNAME = {
    allow = true
    }


    Then:



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

    sudo usermod -a -G vboxusers USERNAME


    It seems it is having a problem reading /etc/vbox/vbox.cfg



    :~$ ls -l /etc/vbox
    total 8
    -rw------- 1 USERNAME USERNAME 1 Dec 14 01:37 USERNAME.start
    -rw-r--r-- 1 root root 179 Dec 14 01:31 vbox.cfg


    Next:



    VBoxManage setproperty autostartdbpath /etc/vbox
    VBoxManage modifyvm <uuid|vmname> --autostart-enabled on


    This created USERNAME.start file in /etc/vbox directory - Although the file appears to be empty.



    Then the Error:



    ● vboxautostart-service.service
    Loaded: loaded (/usr/lib/virtualbox/vboxautostart-service.sh; enabled; vendor preset: enabled)
    Active: failed (Result: exit-code) since Fri 2018-12-14 01:41:57 CST; 27s ago
    Process: 4002 ExecStart=/usr/lib/virtualbox/vboxautostart-service.sh start (code=exited, status=2)

    Dec 14 01:41:57 HOST systemd[1]: Starting vboxautostart-service.service...
    Dec 14 01:41:57 HOST vboxautostart-service.sh[4002]: /usr/lib/virtualbox/vboxautostart-service.sh: 2:/etc/vbox/vbox.cfg: default_policy: not found
    Dec 14 01:41:57 HOST vboxautostart-service.sh[4002]: /usr/lib/virtualbox/vboxautostart-service.sh: 4: /etc/vbox/vbox.cfg: USERNAME: not found
    Dec 14 01:41:57 HOST vboxautostart-service.sh[4002]: /usr/lib/virtualbox/vboxautostart-service.sh: 5: /etc/vbox/vbox.cfg: allow: not found
    Dec 14 01:41:57 HOST vboxautostart-service.sh[4002]: /usr/lib/virtualbox/vboxautostart-service.sh: 6: /etc/vbox/vbox.cfg: Syntax error: "}" unexpected
    Dec 14 01:41:57 HOST systemd[1]: vboxautostart-service.service: Control process exited, code=exited status=2
    Dec 14 01:41:57 HOST systemd[1]: vboxautostart-service.service: Failed with result 'exit-code'.
    Dec 14 01:41:57 HOST systemd[1]: Failed to start vboxautostart-service.service.









    share|improve this question

























      0












      0








      0








      I followed this carefully: How to start Virtual box machines automatically when booting?



      It "broke" VirtualBox. I had to remove the autostart stuff and run a reconfigure command that VirtualBox recommended in the error message to get VirtualBox working again.



      Created the file /etc/default/virtualbox



      # virtualbox defaults file
      VBOXAUTOSTART_DB=/etc/vbox
      VBOXAUTOSTART_CONFIG=/etc/vbox/vbox.cfg


      This is /etc/vbox/vbox.cfg:



      # Default policy is to deny starting a VM, the other option is "allow".
      default_policy = deny
      # Create an entry for each user allowed to run autostart
      USERNAME = {
      allow = true
      }


      Then:



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

      sudo usermod -a -G vboxusers USERNAME


      It seems it is having a problem reading /etc/vbox/vbox.cfg



      :~$ ls -l /etc/vbox
      total 8
      -rw------- 1 USERNAME USERNAME 1 Dec 14 01:37 USERNAME.start
      -rw-r--r-- 1 root root 179 Dec 14 01:31 vbox.cfg


      Next:



      VBoxManage setproperty autostartdbpath /etc/vbox
      VBoxManage modifyvm <uuid|vmname> --autostart-enabled on


      This created USERNAME.start file in /etc/vbox directory - Although the file appears to be empty.



      Then the Error:



      ● vboxautostart-service.service
      Loaded: loaded (/usr/lib/virtualbox/vboxautostart-service.sh; enabled; vendor preset: enabled)
      Active: failed (Result: exit-code) since Fri 2018-12-14 01:41:57 CST; 27s ago
      Process: 4002 ExecStart=/usr/lib/virtualbox/vboxautostart-service.sh start (code=exited, status=2)

      Dec 14 01:41:57 HOST systemd[1]: Starting vboxautostart-service.service...
      Dec 14 01:41:57 HOST vboxautostart-service.sh[4002]: /usr/lib/virtualbox/vboxautostart-service.sh: 2:/etc/vbox/vbox.cfg: default_policy: not found
      Dec 14 01:41:57 HOST vboxautostart-service.sh[4002]: /usr/lib/virtualbox/vboxautostart-service.sh: 4: /etc/vbox/vbox.cfg: USERNAME: not found
      Dec 14 01:41:57 HOST vboxautostart-service.sh[4002]: /usr/lib/virtualbox/vboxautostart-service.sh: 5: /etc/vbox/vbox.cfg: allow: not found
      Dec 14 01:41:57 HOST vboxautostart-service.sh[4002]: /usr/lib/virtualbox/vboxautostart-service.sh: 6: /etc/vbox/vbox.cfg: Syntax error: "}" unexpected
      Dec 14 01:41:57 HOST systemd[1]: vboxautostart-service.service: Control process exited, code=exited status=2
      Dec 14 01:41:57 HOST systemd[1]: vboxautostart-service.service: Failed with result 'exit-code'.
      Dec 14 01:41:57 HOST systemd[1]: Failed to start vboxautostart-service.service.









      share|improve this question














      I followed this carefully: How to start Virtual box machines automatically when booting?



      It "broke" VirtualBox. I had to remove the autostart stuff and run a reconfigure command that VirtualBox recommended in the error message to get VirtualBox working again.



      Created the file /etc/default/virtualbox



      # virtualbox defaults file
      VBOXAUTOSTART_DB=/etc/vbox
      VBOXAUTOSTART_CONFIG=/etc/vbox/vbox.cfg


      This is /etc/vbox/vbox.cfg:



      # Default policy is to deny starting a VM, the other option is "allow".
      default_policy = deny
      # Create an entry for each user allowed to run autostart
      USERNAME = {
      allow = true
      }


      Then:



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

      sudo usermod -a -G vboxusers USERNAME


      It seems it is having a problem reading /etc/vbox/vbox.cfg



      :~$ ls -l /etc/vbox
      total 8
      -rw------- 1 USERNAME USERNAME 1 Dec 14 01:37 USERNAME.start
      -rw-r--r-- 1 root root 179 Dec 14 01:31 vbox.cfg


      Next:



      VBoxManage setproperty autostartdbpath /etc/vbox
      VBoxManage modifyvm <uuid|vmname> --autostart-enabled on


      This created USERNAME.start file in /etc/vbox directory - Although the file appears to be empty.



      Then the Error:



      ● vboxautostart-service.service
      Loaded: loaded (/usr/lib/virtualbox/vboxautostart-service.sh; enabled; vendor preset: enabled)
      Active: failed (Result: exit-code) since Fri 2018-12-14 01:41:57 CST; 27s ago
      Process: 4002 ExecStart=/usr/lib/virtualbox/vboxautostart-service.sh start (code=exited, status=2)

      Dec 14 01:41:57 HOST systemd[1]: Starting vboxautostart-service.service...
      Dec 14 01:41:57 HOST vboxautostart-service.sh[4002]: /usr/lib/virtualbox/vboxautostart-service.sh: 2:/etc/vbox/vbox.cfg: default_policy: not found
      Dec 14 01:41:57 HOST vboxautostart-service.sh[4002]: /usr/lib/virtualbox/vboxautostart-service.sh: 4: /etc/vbox/vbox.cfg: USERNAME: not found
      Dec 14 01:41:57 HOST vboxautostart-service.sh[4002]: /usr/lib/virtualbox/vboxautostart-service.sh: 5: /etc/vbox/vbox.cfg: allow: not found
      Dec 14 01:41:57 HOST vboxautostart-service.sh[4002]: /usr/lib/virtualbox/vboxautostart-service.sh: 6: /etc/vbox/vbox.cfg: Syntax error: "}" unexpected
      Dec 14 01:41:57 HOST systemd[1]: vboxautostart-service.service: Control process exited, code=exited status=2
      Dec 14 01:41:57 HOST systemd[1]: vboxautostart-service.service: Failed with result 'exit-code'.
      Dec 14 01:41:57 HOST systemd[1]: Failed to start vboxautostart-service.service.






      boot 18.04 virtualbox autostart






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 15 '18 at 7:14









      Little MitchLittle Mitch

      64




      64






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1101021%2fvirtual-box-settings-to-automatically-run-vms-on-boot%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1101021%2fvirtual-box-settings-to-automatically-run-vms-on-boot%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to change which sound is reproduced for terminal bell?

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

          Can I use Tabulator js library in my java Spring + Thymeleaf project?