JohnOne

Virtualbox and snapshot

11 posts in this topic

Is anyone familiar with virtualbox?

I can't seem to find answer I'm looking for/

I'm trying to find out if when I take a snapshot, the actual guest OS is saved as it is, and subsequent changes can be reverted, particularly the registry. If I change some values, add or remove keys after a snapshot, will it be restored to before I did?


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites



Yes!


Regards,
 

Share this post


Link to post
Share on other sites

@JohnOne Snapshot restores all the data on the disk + RAM... Its like a picture taken with a camera :P

Or a Time Machine :blink:

1 person likes this

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

Okay, I think I still don't get it.

I created a snapshot, and all it did was rename my "Win_10_Pro" to "Win_10_Pro (snapshot Win_10_Pro_virgin_Install)"

And all I can do is start it again.

I don't get it, I thought I would be able to start "Win_10_Pro" and "Win_10_Pro (snapshot Win_10_Pro_virgin_Install)" would be saved somewhere.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

J1, how many total snapshots do you have? VBox is a little squirrely when it comes to reverting to snapshots. Perhaps a screenshot of your tree?

VBox.thumb.png.8236deaa1fa52baf7a48f3f95

1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Yes, the first snapshot should be your "base image". Then when you have everything configured as you see fit, take another snapshot from the current state so you have something to revert to once you want to roll back changes.

1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Major bummer.

I made another snapshot, so now I have two, started the 2nd, made some changes, shut guest down, pressed button to delete second.

And it merged it with the first, now I have to start again :(

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

Yes, sorry should have mentioned vbox is a bit of a butt when it comes to snapshots. If you are deleting snapshots without wanting to merge you have to start with the latest snapshot and work your way backward or they will merge, whereas VMware Workstation does just what you would intuitively expect, deletes just that snapshot. So if you have 5 snapshots and want to save number 2, you have to delete #5, then #4, then #3. You can also do something like this:

Example, you start with 4 snapshots, want to revert to snapshot 2 and delete 3 and 4.

  • Choose Snapshot 2 and select "Restore Snapshot".
  • This will produce a "Current State" item beneath Snapshot 2.
  • You can then safely delete snapshots 3 and 4 without merging.
1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • DrAhmed
      By DrAhmed
      Hey everyone,
      I am looking for a simple function to take a single snapshot from webcam and save  it as a picture
      I've searched in google and most of UDF's I foud were outdated and not working, others are very complicated to use .
      It would be cool if it can control the quality of saved picture like in screenshots
      _ScreenCapture_SetJPGQuality($Quality) I would appreciate it If someone can help
      thanks in advance
    • VIP
    • rodent1
      By rodent1
      I have many VMs from past projects that I know I'll have to revisit. VirtualBox can sort them alphabetically, but I have failed to keep a consistent naming system that keeps track of the OS, the language name and the project name. So when I need to look for the VM I used 6 months ago for French and a certain project under Windows 8 using the Oracle VirtualBox Manager, my eyes tend to start glazing... I came up with a solution, and created this simple script to get the list of VMs, display them in a listview, then have a filter where I can type the project name, or the language, or the OS. Only the VMs with a name that contain the filter string are displayed, and I can just select the VM I need from my script UI, and launch it.
      It could have added a lot of bells and whistles, and I may add a few in the future. If someone uses this script and adds features, please share.
      The code:
      ;Manage VirtualBox VMs #include <ListViewConstants.au3> #include <WindowsConstants.au3> #Include <GuiListView.au3> #include <guiconstantsex.au3> #include <AutoItConstants.au3> Local $ListID Local $arLVItems Main() Func Main() Local $sVBFolder = GetVBFolder() ; read the VirtualBox installation folder from the registry if $sVBFolder = -1 then MsgBox(0,"","Failed to retrieve the VirtualBox folder from the registry, exiting...") Return EndIf Local $arVMList = GetVMList($sVBFolder) ; use VirtualBox commandline to query the name of existing VMs if $arVMList = 0 Then Return ; none was found, exit ShowVMs($arVMList, $sVBFolder) EndFunc Func GetVBFolder() Local $sFilePath if StringInStr(@OSArch, "64")>0 Then $sFilePath = RegRead("HKLM64\SOFTWARE\Oracle\VirtualBox","InstallDir") Else $sFilePath = RegRead("HKLM\SOFTWARE\Oracle\VirtualBox","InstallDir") EndIf Return $sFilePath EndFunc Func GetVMList($sFilePath) if StringLen($sFilePath)>0 Then Local $iPID = Run(@ComSpec & ' /K "' & $sFilePath & '\vboxmanage" list vms', $sFilePath, @SW_HIDE, $STDOUT_CHILD) ProcessWaitClose($iPID) ; Wait until the process has closed. Local $sOutput = stringreplace(StdoutRead($iPID), '"', '') ; Read the Stdout stream Local $arVMLst = StringSplit($sOutput, @CRLF,1) for $i = 1 to $arVMLst[0] if StringInStr($arVMLst[$i], "{")>0 Then $arVMLst[$i] = StringLeft($arVMLst[$i], StringInStr($arVMLst[$i], "{") - 2) Else $arVMLst[$i] = "" EndIf Next Return $arVMLst Else MsgBox(0,"debug",@error & @LF & @extended) Return -1 EndIf EndFunc Func ShowVMs($arVMs, $sFilePath) Local $sCurVMSel Local $sFilter Local $frmMain = GUICreate("Menu Key Tester", 623, 450, 192, 124) Local $lblFilter=GUICtrlCreateLabel("Display filter:", 10, 5, 100, 20) Local $txtFilterEdit = GUICtrlCreateEdit("", 120, 5, 200, 20) Local $btnApplyFilter = GUICtrlCreateButton("Apply Filter", 350, 5, 100, 20) GUICtrlSetState($btnApplyFilter, $GUI_DISABLE) $ListID = GUICtrlCreateListView("", 10, 27, 590, 390, BitOR($LVS_SORTDESCENDING, $GUI_BKCOLOR_LV_ALTERNATE, 0x00000020)) ;LVS_EX_FULLROWSELECT = 0x00000020 PopulateVMList($arVMs) $btnOK = GUICtrlCreateButton("OK", 10, 420, 180, 25) Local $btnStartVM = GUICtrlCreateButton("Start VM",250, 420, 180, 25) GUICtrlSetState($btnStartVM, $GUI_DISABLE) GUISetState(@SW_SHOW) Local $nMsg while 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $btnOK Exit case $btnApplyFilter $sFilter = GUICtrlRead($txtFilterEdit) PopulateVMList($arVMs, $sFilter) case $btnStartVM ;MsgBox(262144, 'Debug line ~' & @ScriptLineNumber, 'Selection:' & @CRLF & '$sFilePath & ''\vboxmanage" startvm "'' & $sCurVMSel & ''"''' & @CRLF & @CRLF & 'Return:' & @CRLF & $sFilePath & '\vboxmanage" startvm "' & $sCurVMSel & '"') ;### Debug MSGBOX Local $iPID = Run(@ComSpec & ' /K ""' & $sFilePath & 'vboxmanage" startvm "' & $sCurVMSel & '""', $sFilePath, @SW_HIDE, $STDOUT_CHILD) case $ListID case Else ;$sCurVMSel = "" for $i = 1 to $arLVItems[0] if $nMsg = $arLVItems[$i] Then $sCurVMSel = GUICtrlRead($arLVItems[$i]) ; MsgBox(262144, 'Debug line ~' & @ScriptLineNumber, 'Selection:' & @CRLF & '$sCurVMSel' & @CRLF & @CRLF & 'Return:' & @CRLF & $sCurVMSel) ;### Debug MSGBOX ExitLoop ; Else ; MsgBox(262144, 'Debug line ~' & @ScriptLineNumber, 'Selection:' & @CRLF & 'GUICtrlRead($arLVItems[$i])' & @CRLF & @CRLF & 'Return:' & @CRLF & GUICtrlRead($arLVItems[$i])) ;### Debug MSGBOX EndIf Next if stringlen($sCurVMSel)>0 and BitAND(GUICtrlGetState($btnStartVM), $GUI_DISABLE) = $GUI_DISABLE Then local $res = GUICtrlSetState($btnStartVM, $GUI_ENABLE) Elseif stringlen($sCurVMSel)=0 and BitAND(GUICtrlGetState($btnStartVM), $GUI_ENABLE) = $GUI_ENABLE Then ;MsgBox(262144, 'Debug line ~' & @ScriptLineNumber, 'Selection:' & @CRLF & '$sCurVMSel' & @CRLF & @CRLF & 'Return:' & @CRLF & $sCurVMSel) ;### Debug MSGBOX GUICtrlSetState($btnStartVM, $GUI_DISABLE) EndIf Local $FilterCurrentText = GUICtrlRead($txtFilterEdit) if stringlen($FilterCurrentText) = 0 and BitAND(GUICtrlGetState($btnApplyFilter), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($btnApplyFilter, $GUI_DISABLE) Elseif stringlen($FilterCurrentText) > 0 and BitAND(GUICtrlGetState($btnApplyFilter), $GUI_DISABLE) = $GUI_DISABLE Then GUICtrlSetState($btnApplyFilter, $GUI_ENABLE) EndIf EndSwitch WEnd EndFunc Func PopulateVMList($arVMs, $sFiltr = "") Local $ItemIDList GUICtrlDelete($ListID) $ListID = GUICtrlCreateListView("", 10, 27, 600, 390, -1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES)) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_LV_ALTERNATE) GUICtrlSetStyle(-1, $LVS_LIST) for $i = 1 to $arVMs[0] if StringLen($arVMs[$i])>0 Then if StringLen($sFiltr)>0 Then if StringInStr(StringUpper($arVMs[$i]), StringUpper($sFiltr))>0 Then $ItemIDList &= GUICtrlCreateListViewItem($arVMs[$i], $ListID) & "," EndIf Else $ItemIDList &= GUICtrlCreateListViewItem($arVMs[$i], $ListID) & "," EndIf GUICtrlSetBkColor(-1, 0x00E0FFFF) ; color item light blue EndIf Next if StringLen($ItemIDList) Then $ItemIDList = StringLeft($ItemIDList, StringLen($ItemIDList)-1) ; trim final comma EndIf $arLVItems = StringSplit($ItemIDList, ',') GUISetState(@SW_SHOW) EndFunc