<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.chriesibaum.dev/index.php?action=history&amp;feed=atom&amp;title=Virtualbox_Autostart_a_VM</id>
	<title>Virtualbox Autostart a VM - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.chriesibaum.dev/index.php?action=history&amp;feed=atom&amp;title=Virtualbox_Autostart_a_VM"/>
	<link rel="alternate" type="text/html" href="https://wiki.chriesibaum.dev/index.php?title=Virtualbox_Autostart_a_VM&amp;action=history"/>
	<updated>2026-11-24T23:21:05Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://wiki.chriesibaum.dev/index.php?title=Virtualbox_Autostart_a_VM&amp;diff=137&amp;oldid=prev</id>
		<title>PTH: Created page with &quot;Follow the steps described as follows. A more detailed description can be found here: * https://blogging.dragon.org.uk/start-stop-virtualbox-with-systemd/   First disable the...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.chriesibaum.dev/index.php?title=Virtualbox_Autostart_a_VM&amp;diff=137&amp;oldid=prev"/>
		<updated>2021-12-13T08:09:15Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Follow the steps described as follows. A more detailed description can be found here: * https://blogging.dragon.org.uk/start-stop-virtualbox-with-systemd/   First disable the...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Follow the steps described as follows. A more detailed description can be found here:&lt;br /&gt;
* https://blogging.dragon.org.uk/start-stop-virtualbox-with-systemd/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
First disable the Oracle vboxautostart-service and remove its config folder:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo systemctl disable vboxautostart-service&lt;br /&gt;
sudo rm -rf /etc/vbox&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Append vboxusers group to your list of existing groups:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
groups&lt;br /&gt;
sudo usermod -a -G vboxusers &amp;lt;user&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Create a new service:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo nano /etc/systemd/system/&amp;lt;vm_autostart_name.service&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And add the following content for the new service to start a virtualbox machine:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=&amp;lt;vm name&amp;gt;&lt;br /&gt;
After=network.target vboxdrv.service&lt;br /&gt;
Before=runlevel2.target shutdown.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
User=&amp;lt;user to run the vm&amp;gt;&lt;br /&gt;
Group=vboxusers&lt;br /&gt;
Type=forking&lt;br /&gt;
Restart=no&lt;br /&gt;
TimeoutSec=5min&lt;br /&gt;
IgnoreSIGPIPE=no&lt;br /&gt;
KillMode=process&lt;br /&gt;
GuessMainPID=no&lt;br /&gt;
RemainAfterExit=yes&lt;br /&gt;
&lt;br /&gt;
ExecStart=/usr/bin/VBoxManage startvm &amp;lt;vm_name&amp;gt; --type headless&lt;br /&gt;
ExecStop=/usr/bin/VBoxManage controlvm &amp;gt;vm_name&amp;gt; acpipowerbutton&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reload systemd daemon:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo systemctl daemon-reload&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Enable the new service:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo systemctl enable &amp;lt;vm_autostart_name&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, test the service:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo systemctl start &amp;lt;vm_autostart_name&amp;gt;&lt;br /&gt;
sudo systemctl stop &amp;lt;vm_autostart_name&amp;gt;&lt;br /&gt;
sudo systemctl status &amp;lt;vm_autostart_name&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>PTH</name></author>
	</entry>
</feed>