- Configuring VirtualBox autostart on Linux
- 1. Configuration files
- /etc/default/virtualbox
- /etc/vbox/autostart.cfg
- 2. Choose VMs to automatically start and stop
- 3. Restart VirtualBox autostart service
- Автозапуск virtualbox linux debian
- 2.22. Starting Virtual Machines During System Boot
- 2.22.1. Linux: Starting the Autostart Service With init
- 2.22.2. Oracle Solaris: Starting the Autostart Service With SMF
- 2.22.3. Mac OS X: Starting the Autostart Service With launchd
- 2.22.4. Windows: Starting the Autostart Service With a Windows service
Configuring VirtualBox autostart on Linux
It is often useful to configure VirtualBox virtual machines to automatically start and stop on startup and shutdown. The official documentation was a bit unclear, so I’ve made a short tutorial about it.
1. Configuration files
/etc/default/virtualbox
VBOXAUTOSTART_DB=/etc/vbox VBOXAUTOSTART_CONFIG=/etc/vbox/autostart.cfg
/etc/vbox/autostart.cfg
default_policy = deny # Create an entry for each user allowed to use autostart myusername = allow = true >
- sudo chgrp vboxusers /etc/vbox
- sudo chmod 1775 /etc/vbox
- Then, for each allowed username: sudo usermod -aG vboxusers USERNAME , then log out and in for it to apply.
2. Choose VMs to automatically start and stop
- The first time a user configures autostart, the command: VBoxManage setproperty autostartdbpath /etc/vbox needs to be run.
- Note: The autostart options are stored in the /etc/vbox file, and the VM itself. If moving the vm, the options may need to be set again.
- VBoxManage modifyvm
—autostart-enabled - You can also: VBoxManage modifyvm
—autostop-type
3. Restart VirtualBox autostart service
Автозапуск virtualbox linux debian
Administrator’s Guide for Release 6.0
- Preface
- Remote Virtual Machines
- Remote Display (VRDP Support)
- Common Third-Party RDP Viewers
- VBoxHeadless, the Remote Desktop Server
- Step by Step: Creating a Virtual Machine on a Headless Server
- Remote USB
- RDP Authentication
- RDP Encryption
- Multiple Connections to the VRDP Server
- Multiple Remote Monitors
- VRDP Video Redirection
- VRDP Customization
- Automated Guest Logins
- Automated Windows Guest Logins
- Automated Linux and UNIX Guest Logins
- Oracle VM VirtualBox Greeter for Ubuntu/LightDM
- Automated Windows System Preparation
- Manual Setup of Selected Guest Services on Linux
- Guest Graphics and Mouse Driver Setup in Depth
- Using a Host Webcam in the Guest
- Windows Hosts
- Mac OS X Hosts
- Linux and Oracle Solaris Hosts
- Custom VESA Resolutions
- Configuring the Maximum Resolution of Guests When Using the Graphical Frontend
- Using a Raw Host Hard Disk From a Guest
- Access to Entire Physical Hard Disk
- Access to Individual Physical Hard Disk Partitions
- Configuring the Address of a NAT Network Interface
- Configuring the Boot Server (Next Server) of a NAT Network Interface
- Tuning TCP/IP Buffers for NAT
- Binding NAT Sockets to a Specific Interface
- Enabling DNS Proxy in NAT Mode
- Using the Host’s Resolver as a DNS Proxy in NAT Mode
- User-Defined Host Name Resolving
- Configuring the Guest Time Stamp Counter (TSC) to Reflect Guest Execution
- Accelerate or Slow Down the Guest Clock
- Tuning the Guest Additions Time Synchronization Parameters
- Disabling the Guest Additions Time Synchronization
- Customizing the VirtualBox Manager
- VM Selector Customization
- Configure VM Selector Menu Entries
- Configure VM Window Menu Entries
- Configure VM Window Status Bar Entries
- Configure VM Window Visual Modes
- Host Key Customization
- Action when Terminating the VM
- Default Action when Terminating the VM
- Action for Handling a Guru Meditation
- Configuring Automatic Mouse Capturing
- Requesting Legacy Full-Screen Mode
- Removing Certain Modes of Networking From the GUI
- Linux: Starting the Web Service With init
- Oracle Solaris: Starting the Web Service With SMF
- Mac OS X: Starting the Web Service With launchd
- Memory Ballooning Control
- Host Isolation Detection
- More Information
- Linux: Starting the Watchdog Service With init
- Oracle Solaris: Starting the Watchdog Service With SMF
- Linux: Starting the Autostart Service With init
- Oracle Solaris: Starting the Autostart Service With SMF
- Mac OS X: Starting the Autostart Service With launchd
- Windows: Starting the Autostart Service With a Windows service
- Limitations of Disk Encryption
- Encrypting Disk Images
- Starting a VM with Encrypted Images
- Decrypting Encrypted Images
- Hyper-V Debug Options
- Setting up Windows Guests for Debugging with the Hyper-V Paravirtualization Provider
- Setting up USB/IP Support on a Linux System
- Security Considerations
- Synopsis
- Description
- VISO file format
- File specifications and —name-setup
- General
- Namespaces
- File Attributes
- Booting
- String properties (applied to active namespaces only)
- Compatibility:
- VISO Specific:
- Testing (not applicable to VISO):
- Where Oracle VM VirtualBox Stores its Files
- The Machine Folder
- Global Settings
- Summary of Configuration Data Locations
- Oracle VM VirtualBox XML Files
- Procedures and Tools
- Categorizing and Isolating Problems
- Collecting Debugging Information
- Using the VBoxBugReport Command to Collect Debug Information Automatically
- The Built-In VM Debugger
- VM Core Format
- Guest Shows IDE/SATA Errors for File-Based Images on Slow Host File System
- Responding to Guest IDE/SATA Flush Requests
- Performance Variation with Frequency Boosting
- Frequency Scaling Effect on CPU Usage
- Inaccurate Windows CPU Usage Reporting
- Poor Performance Caused by Host Power Management
- GUI: 2D Video Acceleration Option is Grayed Out
- No USB 3.0 Support in Windows 7 Guests
- Windows Bluescreens After Changing VM Configuration
- Windows 0x101 Bluescreens with SMP Enabled (IPI Timeout)
- Windows 2000 Installation Failures
- How to Record Bluescreen Information from Windows Guests
- No Networking in Windows Vista Guests
- Windows Guests may Cause a High CPU Load
- Long Delays When Accessing Shared Folders
- USB Tablet Coordinates Wrong in Windows 98 Guests
- Windows Guests are Removed From an Active Directory Domain After Restoring a Snapshot
- Windows 3.x Limited to 64 MB RAM
- Linux Guests May Cause a High CPU load
- Buggy Linux 2.6 Kernel Versions
- Shared Clipboard, Auto-Resizing, and Seamless Desktop in X11 Guests
- Certain Oracle Solaris 10 Releases May Take a Long Time to Boot with SMP
- VBoxSVC Out-of-Process COM Server Issues
- CD and DVD Changes Not Recognized
- Sluggish Response When Using Microsoft RDP Client
- Running an iSCSI Initiator and Target on a Single System
- Bridged Networking Adapters Missing
- Host-Only Networking Adapters Cannot be Created
- Linux Kernel Module Refuses to Load
- Linux Host CD or DVD Drive Not Found
- Linux Host CD or DVD Drive Not Found (Older Distributions)
- Linux Host Floppy Not Found
- Strange Guest IDE Error Messages When Writing to CD or DVD
- VBoxSVC IPC Issues
- USB Not Working
- PAX/grsec Kernels
- Linux Kernel vmalloc Pool Exhausted
- Cannot Start VM, Not Enough Contiguous Memory
- General Security Principles
- Secure Installation and Configuration
- Installation Overview
- Post Installation Configuration
- The Security Model
- Secure Configuration of Virtual Machines
- Networking
- VRDP Remote Desktop Authentication
- Clipboard
- Shared Folders
- 3D Graphics Acceleration
- CD/DVD Passthrough
- USB Passthrough
- CVE-2018-3646
- Disable Nested Paging
- Flushing the Level 1 Data Cache
- Buffer Overwriting and Disabling Hyper-Threading
- Experimental Features
- Known Issues
- Third-Party Materials
- Third-Party Licenses
- GNU General Public License (GPL)
- GNU Lesser General Public License (LGPL)
- Mozilla Public License (MPL)
- MIT License
- X Consortium License (X11)
- zlib License
- OpenSSL License
- Slirp License
- liblzf License
- libpng License
- lwIP License
- libxml License
- libxslt Licenses
- gSOAP Public License Version 1.3a
- Chromium Licenses
- Main License
- COPYRIGHT.LLNL File
- COPYRIGHT.REDHAT File
- Introduction
- Legal Terms
2.22. Starting Virtual Machines During System Boot
You can start VMs automatically during system boot on Linux, Oracle Solaris, and Mac OS X platforms for all users.
2.22.1. Linux: Starting the Autostart Service With init
On Linux, the autostart service is activated by setting two variables in /etc/default/virtualbox . The first one is VBOXAUTOSTART_DB which contains an absolute path to the autostart database directory. The directory should have write access for every user who should be able to start virtual machines automatically. Furthermore the directory should have the sticky bit set. The second variable is VBOXAUTOSTART_CONFIG which points the service to the autostart configuration file which is used during boot to determine whether to allow individual users to start a VM automatically and configure startup delays. The configuration file can be placed in /etc/vbox and contains several options. One is default_policy which controls whether the autostart service allows or denies to start a VM for users which are not in the exception list. The exception list starts with exception_list and contains a comma separated list with usernames. Furthermore a separate startup delay can be configured for every user to avoid overloading the host. A sample configuration is given below:
# Default policy is to deny starting a VM, the other option is «allow». default_policy = deny # Bob is allowed to start virtual machines but starting them # will be delayed for 10 seconds bob = < allow = true startup_delay = 10 ># Alice is not allowed to start virtual machines, useful to exclude certain users # if the default policy is set to allow. alice =
Any user who wants to enable autostart for individual machines must set the path to the autostart database directory with the following command:
VBoxManage setproperty autostartdbpath
autostart-directory
2.22.2. Oracle Solaris: Starting the Autostart Service With SMF
On Oracle Solaris hosts, the Oracle VM VirtualBox autostart daemon is integrated into the SMF framework. To enable it you must point the service to an existing configuration file which has the same format as on Linux, see Section 2.22.1, “Linux: Starting the Autostart Service With init”. For example:
# svccfg -s svc:/application/virtualbox/autostart:default setprop \ config/config=/etc/vbox/autostart.cfg
When everything is configured correctly you can start the Oracle VM VirtualBox autostart service with the following command:
# svcadm enable svc:/application/virtualbox/autostart:default
For more information about SMF, see the Oracle Solaris documentation.
2.22.3. Mac OS X: Starting the Autostart Service With launchd
On Mac OS X, launchd is used to start the Oracle VM VirtualBox autostart service. An example configuration file can be found in /Applications/VirtualBox.app/Contents/MacOS/org.virtualbox.vboxautostart.plist . To enable the service copy the file to /Library/LaunchDaemons and change the Disabled key from true to false . Furthermore replace the second parameter to an existing configuration file which has the same format as on Linux, see Section 2.22.1, “Linux: Starting the Autostart Service With init”.
To manually start the service use the following command:
# launchctl load /Library/LaunchDaemons/org.virtualbox.vboxautostart.plist
For additional information on how launchd services can be configured see:
2.22.4. Windows: Starting the Autostart Service With a Windows service
On Windows, autostarting is implemented as a Windows service. The service is installed for every user with their own credentials. Before installing any autostart services on a system you first have to define the VBOXAUTOSTART_CONFIG environment variable in the system variables with the path to the autostart configuration file. The configuration file has the same format as on Linux, see Section 2.22.1, “Linux: Starting the Autostart Service With init”, except the user name can be specified using the following formats: «user», «domain\user», «.\user» and «user@domain».
To enable autostarting for a particular user, a member of the administrators group must run the following command:
VBoxAutostartSvc install --user= [--password-file=]
The password file should contain the password followed by a line break. The rest of the file is ignored. The user will be asked for a password if the password file is not specified.
To disable autostarting for particular user, a member of the administrators group must run the following command:
VBoxAutostartSvc delete —user=
If a user has changed their password then a member of the administrators group must either reinstall the service or change the service credentials using Windows Service Manager. Due to Windows security policies, the autostart service cannot be installed for users with empty passwords.
Copyright © 2004, 2020 Oracle and/or its affiliates. All rights reserved. Legal Notices
- Remote Display (VRDP Support)