<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic xml:lang="en-us" id="snapshots-take-restore-delete">
               <title>Taking, Restoring, and Deleting Snapshots</title>
               
               <body>
                  <p>There are three operations related to snapshots, as follows: </p>
                  <ol>
                     <li>
                        <p><b outputclass="bold">Take a snapshot.</b> This makes a copy of the machine's current state,
          to which you can go back at any given time later. </p>
                        <ul>
                           <li>
                              <p>If your VM is running: </p>
                              <p>In the VM window, select <uicontrol>Take Snapshot</uicontrol> from the <uicontrol>Machine</uicontrol> menu. </p>
                              <p>The VM is paused while the snapshot is being created. After snapshot creation, the VM continues to run as normal.</p>
                           </li>
                           <li>
                              <p>In <ph conkeyref="vbox-conkeyref-phrases/vbox-mgr"/>, if your VM is in either the Saved or the Powered Off state, as displayed next to the VM name in the <uicontrol>Machines</uicontrol> list:</p>
                              <p>Click <uicontrol>Snapshots</uicontrol> and do one of the following:</p>
                              <ul>
                                 <li>
                                    <p>Click <uicontrol>Take</uicontrol> in the Snapshots toolbar.</p>
                                 </li>
                                 <li>
                                    <p>Right-click the <uicontrol>Current State</uicontrol> item in the snapshots list and select <uicontrol>Take</uicontrol>.</p>
                                 </li>
                              </ul>
                           </li>
                        </ul>
                        <p>A dialog is displayed, prompting you for a snapshot name. This name is purely for reference purposes, to help you remember the state of the snapshot. For example, a useful name would be <i>Fresh installation from scratch, no Guest Additions</i>, or <i>Service Pack 3 just installed</i>. You can also add a longer text description in the <b outputclass="bold">Snapshot Description</b> field.</p>
                        <p>Your new snapshot will then appear in the snapshots list. Underneath your new snapshot, you will see an item called <b outputclass="bold">Current State</b>, signifying that the current state of your VM is a variation based on the snapshot you took earlier. If you later take another snapshot, you will see that they are displayed in sequence, and that each subsequent snapshot is derived from an earlier one.</p>
                        <p><ph conkeyref="vbox-conkeyref-phrases/product-name"/> imposes no limits on the number of snapshots you can take. The only practical limitation is disk space on your host. Each snapshot stores the state of the virtual machine and thus occupies some disk space. See <xref href="snapshots-contents.dita#snapshots-contents"/> for details on what is stored in a snapshot.</p>
                     </li>
                     <li>
                        <p><b outputclass="bold">Restore a snapshot.</b> In the Snapshots tab, select the snapshot you have taken and click <b outputclass="bold">Restore</b> in the toolbar. By restoring a snapshot, you go back or forward in time. The current state of the machine is lost, and the machine is restored to the exact state it was in when the snapshot was taken.</p>
                        <note>
                           <p>Restoring a snapshot will affect the virtual hard drives that are connected to your VM, as the entire state of the virtual hard drive will be reverted as well. This means also that all files that have been created since the snapshot and all other file changes <i>will be lost. </i>In order to prevent such data loss while still making use of the snapshot feature, it is possible to add a second hard drive in <i>write-through</i> mode using the <userinput>VBoxManage</userinput> interface and use it to store your data. As write-through hard drives are <i>not</i> included in snapshots, they remain unaltered when a machine is reverted. See <xref href="hdimagewrites.dita#hdimagewrites"/>.</p>
                        </note>
                        <p>To avoid losing the current state when restoring a snapshot, you can create a new snapshot before the restore operation.</p>
                        <p>By restoring an earlier snapshot and taking more snapshots from there, it is even possible to create a kind of alternate reality and to switch between these different histories of the virtual machine. This can result in a whole tree of virtual machine snapshots.</p>
                     </li>
                     <li>
                        <p><b outputclass="bold">Delete a snapshot.</b> This does not affect the state of the virtual machine, but only releases the files on disk that <ph conkeyref="vbox-conkeyref-phrases/product-name"/> used to store the snapshot data, thus freeing disk space. To delete a snapshot, select the snapshot name in the <uicontrol>Snapshots</uicontrol> tab and click <b outputclass="bold">Delete</b> in the toolbar. Snapshots can be deleted even while a machine is running.</p>
                        <note>
                           <p>Whereas taking and restoring snapshots are fairly quick operations, deleting a snapshot can take a considerable amount of time since large amounts of data may need to be copied between several disk image files. Temporary disk files may also need large amounts of disk space while the operation is in progress.</p>
                        </note>
                        <p>There are some situations that cannot be handled while a VM is running, and you will get an appropriate message that you need to perform this snapshot deletion when the VM is shut down.</p>
                     </li>
                  </ol>
               </body>
               
            </topic>
