Here's how to turn on guest OS in VirtualBox automatically when host PC is turned on. In this guide I use Ubuntu 16.04 LTS 64bit and VirtualBox 5.1.22
All we need to do is create a file with the extension * .service and put in the /lib/systemd/system folder. In this guide use the autostartvbox.service file name as an example.
The contents of the file are as follows
allows the service to run when the system boot with the following command
If successful then the feedback obtained is as follows
Restart the PC to see the results. To disable this service use the following command
All we need to do is create a file with the extension * .service and put in the /lib/systemd/system folder. In this guide use the autostartvbox.service file name as an example.
sudo nano /lib/systemd/system/autostartvbox.service
The contents of the file are as follows
#!/bin/sh [Unit] Description=Autostart VBOX Guest on Boot [Service] User=your_user ExecStart=/usr/bin/VBoxHeadless --startvm VirtualBox_Guest_Name [Install] WantedBy=multi-user.target
allows the service to run when the system boot with the following command
sudo systemctl enable autostartvbox.service
If successful then the feedback obtained is as follows
Created symlink from /etc/systemd/system/multi-user.target.wants/autostartvbox.service to /lib/systemd/system/autostartvbox.service
Restart the PC to see the results. To disable this service use the following command
sudo systemctl disable autostartvbox.service
Comments
Post a Comment