Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
VirtualBox 3.1: Beginner's Guide

You're reading from   VirtualBox 3.1: Beginner's Guide Deploy and manage a cost-effective virtual environment using VirtualBox

Arrow left icon
Product type Paperback
Published in Apr 2010
Publisher Packt
ISBN-13 9781847199140
Length 348 pages
Edition 1st Edition
Arrow right icon
Authors (2):
Arrow left icon
Alfonso Vidal Romero Alfonso Vidal Romero
Author Profile Icon Alfonso Vidal Romero
Alfonso Vidal Romero
Alfonso Vidal Romero Elizondo Alfonso Vidal Romero Elizondo
Author Profile Icon Alfonso Vidal Romero Elizondo
Alfonso Vidal Romero Elizondo
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

VirtualBox 3.1: Beginner's Guide
Credits
About the Author
About the Reviewer
Preface
1. Getting to Work with VirtualBox FREE CHAPTER 2. Creating Your First Virtual Machine: Ubuntu Linux 3. Creating Your Second Virtual Machine: Windows 7 4. Installing Guest Additions and Advanced Settings 5. Storing Data in VirtualBox 6. Networking with Virtual Machines 7. Using Virtual Appliances 8. Managing your Virtual Machines from a Remote Computer Using Snapshots Pop Quiz Answers Index

Time for action – using branching snapshots in your VMs


In this exercise, you'll learn how to use branching snapshots so you can create alternate realities in your virtual machines.

  1. Go to your UbuntuVB virtual machine settings page and select the Snapshots (1) tab. Then, select the Before deleting bin folder snapshot and click on the Delete snapshot button or hit Ctrl+Shift+D to delete the snapshot.

    Note

    When you use the Delete snapshot command, you're actually deleting the point in time when the snapshot was taken. So, if you accidentally forget to restore your virtual machine's state to the Before deleting bin folder snapshot before actually deleting it, the Delete snapshot command will erase that snapshot and you'll lose your bin folder forever! That's why you need to be very careful when deleting snapshots because you could lose important data or leave your virtual machine completely useless!

  2. A VirtualBox – Question dialog will pop up, asking if you really want to delete the snapshot. Click on Delete to continue.

  3. Now select the Current State item inside the Snapshots panel and click on the Take Snapshot button:

  4. The Take Snapshot of Virtual Machine dialog will pop up next. Type Fresh Install in the Snapshot Name field, Fresh installation of Ubuntu Karmic in the Snapshot Description field, and click on OK to continue.

  5. The Fresh Install snapshot will appear above the Current State item. Now start your UbuntuVB virtual machine and log in. Once the Ubuntu desktop shows up, open a web browser window, go to http://www.google.com/chrome, and follow the instructions to download and install the Google Chrome web browser.

  6. Wait for the installation process to complete and then select Applications | Internet | Google Chrome and go to http://www.virtualbox.org to verify the Google Chrome web browser is working in your virtual machine:

  7. Now select Machine | Take Snapshot from your virtual machine's menu. The Take Snapshot of Virtual Machine dialog will pop up next. Type After installing Google Chrome in the Snapshot Name field, My Ubuntu VM state after installing the Google Chrome web browser in the Snapshot Description field, and click OK to save the new snapshot.

  8. If you go to the Snapshots tab of your UbuntuVB virtual machine, you'll see that the new snapshot is right below the Fresh Install snapshot you took before:

  9. Go back to your UbuntuVB virtual machine's main screen and shut it down without closing the Google Chrome web browser.

  10. Once your UbuntuVB VM is shut down, select the Fresh Install snapshot in the Snapshots panel and click on the Restore Snapshot button or hit Ctrl+Shift+R to revert your virtual machine's state back to that snapshot.

  11. A VirtualBox – Question dialog will pop up to ask if you're sure you want to restore the Fresh Install snapshot. Click on Restore to continue.

  12. Now start your UbuntuVB virtual machine again. After logging in you can check the Applications | Internet menu to verify the Google Chrome web browser isn't installed in your virtual machine, and the (Fresh Install) message will appear in your virtual machine's title bar to indicate your VM is in the state it was before you installed Google Chrome.

  13. Now open a terminal window (Applications | Accessories | Terminal), type sudo apt-get install konqueror, press Enter, and follow the on-screen instructions to install the Konqueror web browser in your UbuntuVB virtual machine.

  14. Once the installation process finishes, exit the terminal window, select Applications | Internet | Konqueror to open the Konqueror web browser, and go to http://www.virtualbox.org to verify it's working:

  15. Select Machine | Take Snapshot from your virtual machine's main menu, or hit Host + S to take a snapshot of your current configuration. The Take Snapshot of Virtual Machine dialog will pop up next. Type After installing Konqueror in the Snapshot Name field, My Ubuntu VM state after installing the Konqueror web browser in the Snapshot Description field and click on OK to continue.

  16. Wait until the snapshot is fully taken and then shut down your virtual machine without closing the Konqueror web browser window. In the Snapshot panel you will now see three snapshots:

  17. The After Installing Konqueror snapshot will be shown in bold to indicate your virtual machine's current state derives from it. Now select the After installing Google Chrome snapshot and click on the Restore Snapshot button to revert your virtual machine to that place in time where you installed Google Chrome.

  18. The VirtualBox – Question dialog will pop up to ask if you're sure you want to restore that snapshot. Click on Restore to continue.

  19. Start your UbuntuVB virtual machine and log in to confirm the Konqueror web browser is gone and the Google Chrome web browser is shown on your virtual machine's desktop. Now you can go back and forth in time with your virtual machines!

What just happened?

Cool! You'll be able to do all those cool time-travelling tricks from the Back to the Future film series! Well, maybe not all of them, but I bet you didn't think it could be possible to try out different software configurations and then revert all changes as if nothing ever happened, right?

This was a lengthy exercise, but it's worth all the hassle. In steps 7 and 8 you created a snapshot after installing the Google Chrome web browser. If you look at the screenshot from step 8, you'll notice the After installing Google Chrome snapshot is a derivation from the Fresh Install snapshot, and if you look at the screenshot from step 16 you'll notice that the After installing Konqueror snapshot also derives from the Fresh Install snapshot.

Both snapshots are completely independent from each other. This effectively creates two time paths for your virtual machine, and if you take more snapshots on either path, you can go back and forth specific points of time at your leisure!

Note

You can think of a snapshot as a way to capture a specific point in time from your virtual machine.

In steps 17 and 18 you restored the After installing Google Chrome snapshot to go back to the point in time where you installed Google Chrome. From here you can install some other software package or make some changes to your virtual machine configuration, and then take another snapshot to preserve your new point in time, so later you can go back to the point where you installed Google Chrome, or to any other point in time preserved with a snapshot.

Note

With the branching feature you're able to create alternate realities for your virtual machines.

If you take a snapshot when your virtual machine is running, its memory state will also be preserved. That explains why on step 17, when you restored the After installing Google Chrome snapshot, the Google Chrome window was still open in your Ubuntu desktop.

And have you wondered how many snapshots can you take on a single virtual machine? Well, there isn't any limit imposed by VirtualBox, so practically you can take unlimited snapshots, but you need to take into account that each snapshot requires certain disk space in your host, so the only limitation is the space available on your host's hard disks.

Have a go hero – creating more alternate realities for your VMs

Practice with your other virtual machines, taking several snapshots and using the branching feature to create alternate realities. For example, you could install Microsoft Office in a Windows XP/Vista/7 virtual machine, and then create another alternate reality where you can install OpenOffice instead.

Pop quiz – creating alternate realities for your VMs

  1. You need to test two of the most popular IDEs for developing Java programs: NetBeans and Eclipse. The best way to do it would be to:

    1. Get two machines with the same RAM, processor and operating system, and then install NetBeans on one machine and Eclipse on the other.

    2. Use snapshots and VirtualBox to create a virtual machine with two alternate realities: one with NetBeans installed and the other with Eclipse installed.

    3. Flip a coin to decide which IDE you're going to use.

  2. After several days of testing your Eclipse and NetBeans installations, you decide NetBeans is the most appropriate IDE for you. What would you need to do to uninstall Eclipse from your virtual machine?

    1. Delete the snapshot where you installed Eclipse, and keep only the NetBeans-related snapshots.

    2. You'll need to erase everything, reinstall VirtualBox, and create a new virtual machine where you can install NetBeans again.

    3. You need to reformat your host's hard disk, and you'll need to delete all your valuable data!

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image