How to create auto snap in VirtualBox in Linux

 How to make Auto snapshot using script 

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




Open terminal and scan all VMs

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 


next 
Set execute permission on your script using chmod command :
using 
sudo chmod +x win.sh




after type 
./win.sh

then you can see result 




every 240 second will run as loop making snap as auto 







How to set this Auto run when startup in PC 





Linux Auto start





Lubuntu



now Reboot


How can I add new autostart programs in Lubuntu?



recap 

  1. Find the path of the application that you like to autostart.
  2. Add the path to the application to ~/.config/lxsession/Lubuntu/autostart
  3. 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
  4. restart and Login to test




Post a Comment

0 Comments