<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://tech.uvoo.io/index.php?action=history&amp;feed=atom&amp;title=Virtualbox_for_Users</id>
	<title>Virtualbox for Users - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://tech.uvoo.io/index.php?action=history&amp;feed=atom&amp;title=Virtualbox_for_Users"/>
	<link rel="alternate" type="text/html" href="https://tech.uvoo.io/index.php?title=Virtualbox_for_Users&amp;action=history"/>
	<updated>2026-04-20T00:57:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://tech.uvoo.io/index.php?title=Virtualbox_for_Users&amp;diff=129&amp;oldid=prev</id>
		<title>imported&gt;Jeremy-busk at 00:31, 8 February 2019</title>
		<link rel="alternate" type="text/html" href="https://tech.uvoo.io/index.php?title=Virtualbox_for_Users&amp;diff=129&amp;oldid=prev"/>
		<updated>2019-02-08T00:31:42Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Start VMs Automatically on boot&lt;br /&gt;
&lt;br /&gt;
Probably create a service via systemd that looks for uuids in users vbox-autostart.cfg file and run them in the system it's own way.&lt;br /&gt;
&lt;br /&gt;
nano /etc/systemd/system/virtualbox-guest-run-vmname.service&lt;br /&gt;
```&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Unifi VM service&lt;br /&gt;
After=network.target vboxdrv.service&lt;br /&gt;
[Service]&lt;br /&gt;
ExecStart=/usr/bin/vboxheadless -s unifi&lt;br /&gt;
ExecStop=/usr/bin/vboxmanage controlvm unifi acpipowerbutton&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can always do it manually and use crontab -e  @reboot but virtualbox service might not be available so you would need to test until it was available.&lt;br /&gt;
```&lt;br /&gt;
@reboot &amp;lt;username&amp;gt; /home/busk/myscript.sh&lt;br /&gt;
@reboot &amp;lt;username&amp;gt; vboxmanage startvm &amp;lt;vmname&amp;gt; --type headless&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
Or the doc way https://askubuntu.com/questions/404665/how-to-start-virtual-box-machines-automatically-when-booting&lt;br /&gt;
```&lt;br /&gt;
The following steps are adapted from the linked blog post:&lt;br /&gt;
&lt;br /&gt;
First you need to create the file /etc/default/virtualbox and add a few variables.&lt;br /&gt;
&lt;br /&gt;
VBOXAUTOSTART_DB which contains an absolute path to the autostart database directory and&lt;br /&gt;
VBOXAUTOSTART_CONFIG which contains the location of the autostart config settings. The file should look similar to this:&lt;br /&gt;
&lt;br /&gt;
# virtualbox defaults file&lt;br /&gt;
VBOXAUTOSTART_DB=/etc/vbox&lt;br /&gt;
VBOXAUTOSTART_CONFIG=/etc/vbox/vbox.cfg&lt;br /&gt;
Now we need to create the /etc/vbox/vbox.cfg file and add&lt;br /&gt;
&lt;br /&gt;
# Default policy is to deny starting a VM, the other option is &amp;quot;allow&amp;quot;.&lt;br /&gt;
default_policy = deny&lt;br /&gt;
# Create an entry for each user allowed to run autostart&lt;br /&gt;
myuserid = {&lt;br /&gt;
allow = true&lt;br /&gt;
}&lt;br /&gt;
Note: If the filename vbox.cfg doesn't work above, try naming it autostart.cfg.&lt;br /&gt;
&lt;br /&gt;
If you are the only user you can just add the line default_policy = allow to the vbox.cfg file.&lt;br /&gt;
&lt;br /&gt;
Set permissions on directory to the vboxuser group and make sure users can write to the directory as well as sticky bit.&lt;br /&gt;
&lt;br /&gt;
sudo chgrp vboxusers /etc/vbox&lt;br /&gt;
sudo chmod 1775 /etc/vbox&lt;br /&gt;
Add each of the users to the vboxusers group.&lt;br /&gt;
&lt;br /&gt;
sudo usermod -a -G vboxusers USERNAME&lt;br /&gt;
(replace USERNAME with the username)&lt;br /&gt;
&lt;br /&gt;
NOTE: If you have changed group permissions for the current user, log out and back in again to refresh the permissions. (credit @kR105)&lt;br /&gt;
&lt;br /&gt;
Every user who wants to enable autostart for individual machines has to set the path to the autostart database directory with&lt;br /&gt;
&lt;br /&gt;
VBoxManage setproperty autostartdbpath /etc/vbox&lt;br /&gt;
and enable autostart for an individual VM with&lt;br /&gt;
&lt;br /&gt;
VBoxManage modifyvm &amp;lt;uuid|vmname&amp;gt; --autostart-enabled on&lt;br /&gt;
This will create a myuserid.start file in /etc/vbox directory&lt;br /&gt;
&lt;br /&gt;
Now restart the vboxautostart-service to read in the changes.&lt;br /&gt;
&lt;br /&gt;
sudo service vboxautostart-service restart&lt;br /&gt;
Reboot your system and your VM should start&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
# References&lt;br /&gt;
* https://pgaskin.net/linux-tips/configuring-virtualbox-autostart/&lt;br /&gt;
* https://www.virtualbox.org/manual/ch08.html#vboxmanage-autostart&lt;br /&gt;
* https://askubuntu.com/questions/689172/reboot-works-with-command-but-not-script-cron&lt;br /&gt;
* https://medium.com/@bharatman/how-to-autostart-and-autostop-your-headless-virtualbox-guest-vm-on-a-debian-host-3ca7ede2380b&lt;/div&gt;</summary>
		<author><name>imported&gt;Jeremy-busk</name></author>
	</entry>
</feed>