How to make Auto snapshot using script
Set Up Automatic Snapshots on VirtualBox
Snapshots capture the entire state of the virtual machine at the time you take the snapshot. You can take a snapshot when a virtual machine is powered on, powered off, or suspended. If you are suspending a virtual machine, wait until the suspend operation finishes before you take a snapshot, we can set this all thing as auto. see the steps we show you how to take auto snap, How to use VirtualBox snapshot technology to create a timeline of your virtual machine!
Check video Tutorial
use this code
cd /usr/bin
next scan VMs
VBoxManage list vms
find you want VMs name for make snap
we try make on this VM
then type this command for make snap
VBoxManage snapshot "YOUR VM NAME " take "WHAT YOUR LIKE SNAP NAME"
example for my VM
VBoxManage snapshot "win 10 cl15-7-2022" take "now"
then result will like this snap will make
so we try to set this process as auto in time schedule just like loop
we should make .sh file
How do I run .sh file shell script in Linux?
First you type below steps
sudo nano "file name"+ .sh (.sh is file type)
sudo nano win.sh
then will open like this windoes
type this code here
#!/bin/bash
while ( true ); do
before=`date +%s`
sleep `echo $(VBoxManage snapshot "win 10 cl15-7-2022" take "now")` # Place you command here
after=`date +%s`
DELAY=`echo "240-($after-$before)" | bc`
sleep $DELAY
done
insert your VM name and time as match with you above yellow color part
like this then save
How to set this Auto run when startup in PC
now Reboot
- Find the path of the application that you like to autostart.
- Add the path to the application to
~/.config/lxsession/Lubuntu/autostart
- Or use the tool under the menu Preferences->Default applications for LXSession
- select the Autostart tab
- enter the path in the text field next to the + Add button
- click the + Add button
- restart and Login to test
0 Comments