MyTetra Share
Делитесь знаниями!
How to start Virtual box machines automatically when booting?
Время создания: 01.03.2017 10:11
Автор: http://askubuntu.com/users/1205/kdmurray
Текстовые метки: linux ubuntu virtaulmox autostart
Раздел: Linux
Запись: Velonski/mytetra-database/master/base/14883450915o39xqy1fi/text.html на raw.githubusercontent.com

You can use the VirtualBox Auto-start service. A good tutorial describing how to do this is posted on the "Life of a Geek Admin" blog .

The following steps are adapted from the linked blog post:

  1. First you need to create the file /etc/default/virtualbox and add a few variables.
  2. VBOXAUTOSTART_DB which contains an absolute path to the autostart database directory and
    VBOXAUTOSTART_CONFIG which contains the location of the autostart config settings. The file should look similar to this:

    # virtualbox defaults file
    VBOXAUTOSTART_DB=/etc/vbox
    VBOXAUTOSTART_CONFIG=/etc/vbox/vbox.cfg
  3. Now we need to create the /etc/vbox/vbox.cfg file and add
  4. # 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
    myuserid = {
    allow = true
    } 

    Note: If the filename vbox.cfg doesn't work above, try naming it autostart.cfg.

    If you are the only user you can just add the line default_policy = allow to the vbox.cfg file.

  5. Set permissions on directory to the vboxuser group and make sure users can write to the directory as well as sticky bit.
  6. sudo chgrp vboxusers /etc/vbox
    sudo chmod 1775 /etc/vbox
  7. Add each of the users to the vboxusers group.
  8. sudo usermod -a -G vboxusers USERNAME 

    (replace USERNAME with the username)

  9. Every user who wants to enable autostart for individual machines has to set the path to the autostart database directory with
  10. VBoxManage setproperty autostartdbpath /etc/vbox 

    and enable autostart for an individual VM with

    VBoxManage modifyvm <uuid|vmname> --autostart-enabled on 

    This will create a myuserid.start file in /etc/vbox directory

  11. Now restart the vboxautostart-service to read in the changes.
  12. sudo service vboxautostart-service restart
  13. Reboot your system and your VM should start
Так же в этом разделе:
 
MyTetra Share v.0.65
Яндекс индекс цитирования