Here are steps that will allow you to run VM on system boot.
Requirements:
[*] SSH connection to NAS
[*] VirtualBox VM that's up and running
Steps:
- Connect to your NAS via SSH.
- Now, you need to find your VM ID, simple ps command with grep will do:
Output will look something like this:
Code: Select all
ps -eo command | grep VBoxHeadless
I have only one VM running, named "shuttle-vm", if you have more than one VM, you should see all of them listed.Code: Select all
[bipe@TNAS ~]# ps -eo command | grep VBoxHeadless /usr/lib/virtualbox/VBoxHeadless --comment shuttle-vm --startvm 90c1bd38-5a6d-40d0-a0b8-a97e3da6b777 --vrde config grep VBoxHeadless [bipe@TNAS ~]#
- Connect to NAS via web GUI
- Open Control panel
- Open Scheduled Tasks under General settings
- Create new Triggered Scheduled Tasks
- Give it some name, eg. vm-autostart and click next (leave user as is, trigger should be Power on by default)
- In Custom command script field enter:
First line is adding path to required libs dir, second line is full command you have received in step 2
Code: Select all
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/Volume1/@apps/virtualbox/lib /usr/lib/virtualbox/VBoxHeadless --comment shuttle-vm --startvm 90c1bd38-5a6d-40d0-a0b8-a97e3da6b777 --vrde config
- Next, Create and that's it
Each scheduled job should contain only one VBoxHeadless command.