VM autostart
-
- Posts: 12
- youtube meble na wymiar Warszawa
- Joined: Wed Apr 22, 2020 2:10 am
VM autostart
Hi!
I've got a AS5304T and i need to autostart all VM at booting the NAS.
Thanks!
I've got a AS5304T and i need to autostart all VM at booting the NAS.
Thanks!
-
- Posts: 13
- Joined: Sun Jul 26, 2015 10:32 pm
Re: VM autostart
I have used this ... it is in French. It is working on my AS5104T
https://www.forum-nas.fr/threads/resolu ... ost-110973
https://www.forum-nas.fr/threads/resolu ... ost-110973
-
- Posts: 30
- Joined: Thu Jan 18, 2024 6:53 pm
Re: VM autostart
Hello, I also followed this method and it works perfectly, now I am looking for a solution so that the VM can shut down properly when the NAS turns off.
I tested this command but it doesn't work.
Do you have an idea ?
THANKS
or this but doesn't work
I tested this command but it doesn't work.
Do you have an idea ?
THANKS
Code: Select all
#!/bin/sh
/opt/VirtualBox/VBoxManage start-stopvm homeassistant --type vrdp &
or this but doesn't work
Code: Select all
#!/bin/sh
/opt/VirtualBox/VBoxManage startstopvm homeassistant --type vrdp &
- Nazar78
- Posts: 2079
- Joined: Wed Jul 17, 2019 10:21 pm
- Location: Singapore
- Contact:
Re: VM autostart
Code: Select all
#!/bin/sh
/opt/VirtualBox/VBoxManage controlvm homeassistant acpipowerbutton --type vrdp
AS5304T - 16GB DDR4 - ADM-OS modded on 2GB RAM
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps
When posting, consider checking the box "Notify me when a reply is posted" to get faster response
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps
When posting, consider checking the box "Notify me when a reply is posted" to get faster response
-
- Posts: 30
- Joined: Thu Jan 18, 2024 6:53 pm
Re: VM autostart
thank you for your answer but I am a beginner and I need more detail (sorry)
currently I created a file so that my VM starts automatically
here is the file that I copied to /usr/local/etc/init.d
so the file that you offer me should I install it or?
THANKS
currently I created a file so that my VM starts automatically
here is the file that I copied to /usr/local/etc/init.d
Code: Select all
#!/bin/sh
/opt/VirtualBox/VBoxManage startvm homeassistant --type vrdp &
so the file that you offer me should I install it or?
THANKS
- Nazar78
- Posts: 2079
- Joined: Wed Jul 17, 2019 10:21 pm
- Location: Singapore
- Contact:
Re: VM autostart
Replace your entire file content with below:
Code: Select all
#!/bin/sh
case "$1" in
start)
/opt/VirtualBox/VBoxManage startvm homeassistant --type vrdp &
;;
stop)
/opt/VirtualBox/VBoxManage controlvm homeassistant acpipowerbutton --type vrdp
;;
*)
echo "Usage: $0 <start|stop>"
exit 1
;;
esac
exit $?
AS5304T - 16GB DDR4 - ADM-OS modded on 2GB RAM
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps
When posting, consider checking the box "Notify me when a reply is posted" to get faster response
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps
When posting, consider checking the box "Notify me when a reply is posted" to get faster response
-
- Posts: 30
- Joined: Thu Jan 18, 2024 6:53 pm
Re: VM autostart
thank you, I will test tomorrow and let you know. thank you
-
- Posts: 30
- Joined: Thu Jan 18, 2024 6:53 pm
Re: VM autostart
unfortunately it doesn't work,
As soon as I copied the file, virtualbox became unavailable, I restarted the NAS and the VM no longer started.
What is the danger if a VM shuts down instantly?
As soon as I copied the file, virtualbox became unavailable, I restarted the NAS and the VM no longer started.
What is the danger if a VM shuts down instantly?
- Nazar78
- Posts: 2079
- Joined: Wed Jul 17, 2019 10:21 pm
- Location: Singapore
- Contact:
Re: VM autostart
You can test it from the SSH console, to start it just run:
To stop:
Note for this to work automatically, you'll need two files with the same content but different prefix name (S & K). And it needs to run after VB has loaded or unloaded at level 81. E.g. for startup is S81virtualbox-helper, for shutdown K81virtualbox-helper. Usually we create this only one file place it elsewhere then symlink to S-LEVEL-YOUR-SCRIPT-NAME to the init.d directory.
Code: Select all
/usr/local/etc/init.d/YOUR-SCRIPT-NAME start
Code: Select all
/usr/local/etc/init.d/YOUR-SCRIPT-NAME stop
Same as you pull out a plug of a running PC, the disk can get corrupted. In this case the VM. But I strongly think VB could handle this without issue as I've done power off many times.What is the danger if a VM shuts down instantly?
AS5304T - 16GB DDR4 - ADM-OS modded on 2GB RAM
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps
When posting, consider checking the box "Notify me when a reply is posted" to get faster response
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps
When posting, consider checking the box "Notify me when a reply is posted" to get faster response
-
- Posts: 30
- Joined: Thu Jan 18, 2024 6:53 pm
Re: VM autostart
sorry to be a drag, for you it makes sense, for me it's Chinese
to test in the console I try with this
/usr/local/etc/init.d/S99autobootVM.sh stop
What could cause the file you suggested to me to not work?
As I write I'm laughing because I'm so bad
to test in the console I try with this
/usr/local/etc/init.d/S99autobootVM.sh stop
What could cause the file you suggested to me to not work?
As I write I'm laughing because I'm so bad