Friday 9 July 2010

Creating Your First Virtual Machine: Ubuntu Linux (Part 2)

Running your Ubuntu Linux VM

This is going to be the most entertaining section of the article: you'll get to play with your brand-new Ubuntu Linux virtual machine! If you haven't used Linux before, I'd definitely recommend that you browse through the Ubuntu documentation at https://help.ubuntu.com/9.10/index.html.

Time for action – running Ubuntu Linux

The best way to test your new virtual machine is experimenting, so let's get on with it!
  1. Open VirtualBox (in case you closed it after the last section's exercise), select your UbuntuVB virtual machine, and click on Start to turn it on:
    VirtualBox 3.1: Beginner's Guide
  2. Ubuntu will start to boot in your virtual machine. Eventually, the Ubuntu logo will show up along with the progress bar and, after a few seconds (or minutes, depending on your hardware), the Ubuntu login screen will show up. Click inside the virtual machine screen to capture the mouse and keyboard, type the username you assigned in the installation process, and hit Enter to continue.
  3. Now type the password for your username, and hit Enter again. Ubuntu will start to load. When finished, you'll see the Ubuntu GNOME Desktop screen:
    VirtualBox 3.1: Beginner's Guide
  4. One of the first things you'll notice is the Update Manager dialog. This dialog shows up when your Ubuntu system needs software updates. Click on Install Updates to start the updating process. Normally, the Update Manager will ask for your administrator password. Type it, press Enter, or click on OK and then wait for the Update Manager to finish its job so you can work with your Ubuntu system fully updated.
  5. If the Update Manager asks you to restart your Ubuntu system after updating, click on the Restart Now button, and wait for your Ubuntu virtual machine to reboot.

What just happened?

Isn't it cool to have a little Ubuntu system running inside your real PC? Just like a pregnant mother feeling her baby's first movements! Well, not as touching, but you get the point, right?
Ubuntu is one of the friendliest Linux distributions available. That's why I decided to use it for this article's exercises. Now let's go and test the Internet connection on your new Ubuntu virtual machine!

Web browsing with Mozilla Firefox

One of the best things about the Ubuntu Desktop edition is that you can use Mozilla Firefox out of the box. And the Ubuntu Update Manager keeps it updated automatically for you!

Time for action – web browsing in your Ubuntu VM

You have your virtual machine installed. What's next? Let's surf the web! After all, what could be more important than that?
  1. Open the Applications menu on your Ubuntu virtual machine, and select Internet | Firefox Web Browser from the menu:
    VirtualBox 3.1: Beginner's Guide
  2. The Mozilla Firefox window will show the Ubuntu Start Page. Type virtualbox.org on the address bar and press Enter:
    VirtualBox 3.1: Beginner's Guide
  3. The VirtualBox homepage should appear as an indication that you have Internet access in your virtual machine. You can close Mozilla Firefox now.
If you cannot connect to Internet from your virtual machine, check your host's network settings. If you can connect from your host, try using another virtual network adapter type in your virtual machine to see if the problem disappears.

What just happened?

Well, this exercise is not really hard, right? But this is a cool way to test if your new virtual machine has Internet enabled by default. Later on, we'll talk about the different settings related to virtual network interfaces and VirtualBox. You can also know if your virtual machine can connect to Internet through the Ubuntu Update Manager because it will issue a warning if it cannot access the Ubuntu software sources. For now, it's good to know we can surf the web! Now let's see how you can do some real work inside your Ubuntu VM…

Using OpenOffice.org in your virtual machine

Ok, we have Internet enabled on our Ubuntu virtual machine; what else could we ask for? How about some word processing, a spreadsheet, and some presentations, for starters? I know it's boring, but some of us also use VirtualBox to work!

Time for action – using OpenOffice.org

Ubuntu comes with OpenOffice.org, the open source productivity suite that has proven to be an effective alternative to MS Office for Linux users. Now let's try it out on your new Ubuntu virtual machine...
  1. Open the Applications menu on your Ubuntu virtual machine, and select Office | OpenOffice.org Word Processor from the menu:
    VirtualBox 3.1: Beginner's Guide
  2. The Untitled 1 – OpenOffice.org Writer window will appear. You can use OpenOffice Writer as if you were on a real machine:
    VirtualBox 3.1: Beginner's Guide
  3. Now go to the Applications menu again, and this time select the Office | OpenOffice.org Spreadsheet option.
  4. The Untitiled 2 – OpenOffice.org Calc window will show up, overlapping the Writer window. You can also work with it as in a real PC:
    VirtualBox 3.1: Beginner's Guide
  5. And now, go back to the Application menu, and select the Office | OpenOffice.org Presentation option.
  6. The Presentation Wizard screen will show up. Select the Empty Presentation option, click on Next twice, and then click on Create to continue. The Untitled 3 – OpenOffice.org Impress window will show up, overlapping the other two windows:
    VirtualBox 3.1: Beginner's Guide
  7. Now you can close all the application windows inside your virtual machine.

What just happened?

How about that? A complete office productivity suite inside your main PC! And Internet access too! So, if you always wanted to learn about Linux or any other operating system but were afraid of messing up your main PC, VirtualBox has come to your rescue!
Now let's see how to turn off your virtual machine…

Have a go hero – trying out Ubuntu One: your personal cloud

Now that you have an Ubuntu virtual machine, you would likely benefit from trying out the Ubuntu One service, where you can back up, store, sync, and share your data with other Ubuntu One users. And the best of all, it's free! To open an account, select Applications | Internet | Ubuntu One, and follow the instructions on screen.

Have a go hero – sharing information between your VM and your host PC

Use your Ubuntu One account to transfer some files between your virtual machine and your host PC. If you're using Windows, you can work with the Ubuntu One web interface at http://one.ubuntu.com.

Shutting down your virtual machine

I know you're thinking, "Geez, I can't believe this guy! He's actually going to spend an entire subsection of this article just to show us how to shutdown a virtual machine! Aw, come on!"
Now it's my turn: Remember we're talking about a virtual machine here, not a real PC! You need to consider several things before shutting this baby down!

Time for action – shutting down your VM

Now it's time to stop whining and start learning how to shut down your virtual machine...
  1. Make sure you close all the applications inside your virtual machine, open the Mozilla Firefox Web browser, 'uncapture' your keyboard and mouse so that you can move to the VirtualBox main menu, and select the Machine | Close option.
  2. The Close Virtual Machine dialog will show up with three choices for shutting down your virtual machine. Select the Save the machine state option, and click on OK to continue:
    VirtualBox 3.1: Beginner's Guide
  3. VirtualBox will show the following dialog before shutting down the virtual machine:
    VirtualBox 3.1: Beginner's Guide
  4. Once your virtual machine's state is saved, it will shut down automatically, and you'll be returned to the VirtualBox main screen. Also, your UbuntuVB virtual machine status indicator will change from Powered Off to Saved. If you start it again, it will continue exactly where it was left off, with the Mozilla Firefox web browser window open.
  5. Start your UbuntuVB virtual machine again, leave the Mozilla Firefox window open, and select the Machine | Close menu option from the VirtualBox main menu again to open the Close Virtual Machine dialog.
  6. This time select the Send the shutdown signal option, and click on OK to continue. This has the same effect as if you had pressed the power off button on a real PC. The Shutdown the computer dialog from Ubuntu will show up:
    VirtualBox 3.1: Beginner's Guide
  7. Click on the Shut Down button to continue. Your Ubuntu virtual machine will shutdown without saving its state. This is the same as using the regular shutdown process in Ubuntu: you select the Shut Down… option from the pull-down menu in the upper right corner of your Ubuntu virtual machine. If you later start it again, the Mozilla Firefox window won't open.

What just happened?

Well, it was pretty much just a simple 'shutdown your virtual machine' exercise, don't you agree? In VirtualBox, you have three choices when shutting down your virtual machines. We already saw the first choice –Save the machine state –in action. It's kind of like suspending or hibernating a laptop computer. Your virtual machine's state 'freezes' and stays that way until you later start it again. Then, it resumes normal operation as if nothing happened. All the applications you left open will still be there.
The second choice, Send the shutdown signal, acts as if you pushed the power button on a real machine. Most modern operating systems will try to use a proper shutdown mechanism.
The third choice, Power off the machine, is like pulling the power plug on a real PC, so be careful! You could lose sensitive data if you use it carelessly! I only use this option when a virtual machine crashes and I can't shut it down with the other two choices...
Always try to use the guest operating system interface first to shutdown the virtual machine. If that fails, you can use the Send the shutdown signal option instead, but it's better to treat your virtual machine as if it were a real PC, don't forget it.
Remember that the Send the shutdown signal option only works if your guest operating system supports ACPI events. For example, this option is useless when your virtual machine is showing up the Ubuntu GRUB loader boot screen.

Have a go hero – experimenting with a KUbuntu virtual machine

There's another Ubuntu-derived distribution around called KUbuntu. Why the K? Well, the primary difference between Ubuntu and KUbuntu is that Ubuntu uses the GNOME window manager (http://www.gnome.org), and KUbuntu uses the KDE window manager (http://www.kde.org/). And which one is better? Well, that's what you need to try out for yourself...
Go and grab a copy of KUbuntu from http://www.kubuntu.org, create a virtual machine named KUbuntuVB or something like that, and install KUbuntu on it. If possible, try to run your Ubuntu and KUbuntu virtual machines at the same time to compare them, so you can decide which one is better!
And if you're feeling reckless, you should definitely try out other Linux distributions, for example: SuSE, Red Hat, Slackware, or Fedora. Come on, I know you can do it!

Summary

I hope you enjoyed the exercises in this article, especially if you've never used Ubuntu Linux before (or any other Linux distro whatsoever). Here you learned about the basic settings needed to create a virtual machine, installed the Ubuntu operating system, ran the virtual machine, and shut it down appropriately.
Specifically, we covered:
  • How to download the Ubuntu Linux Desktop Live CD
  • How to configure a new virtual machine in VirtualBox
  • How to adjust your virtual machine's basic settings to install Ubuntu on it
  • How to install the Ubuntu Linux Desktop operating system on your VM
  • How to use the VirtualBox host key and to 'capture'/'uncapture' the mouse and keyboard in your virtual machine
  • How to run your Ubuntu virtual machine and test some basic functions such as Internet access and OpenOffice.org applications
  • The different choices available when shutting down your virtual machine

Thursday 24 June 2010

Creating Your First Virtual Machine: Ubuntu Linux (Part 1)

In this two-part article you shall:
  • Create your first virtual machine in VirtualBox, using Ubuntu Linux
  • Learn about your virtual machine's basic configuration
  • Download and install Ubuntu Linux on your virtual machine
  • Learn how to start and stop your virtual machine
So let's get on with it...

Getting started

In this article, you'll need to download the Ubuntu Linux Desktop Live CD. It's a pretty big download (700 MB approximately), so I'd recommend you to start downloading it as soon as possible. With a 4 Mbps Internet connection, you'd need approximately 1 hour to download a copy of Ubuntu Linux Desktop.
That's why I decided to change the order of some sections in this article. After all, action is what we're looking for, right?

Downloading the Ubuntu Linux Live CD

After finishing the exercise in this section, you can jump straight ahead into the next section while waiting for your Ubuntu Live CD to download. That way, you'll have to wait for less time, and your virtual machine will be ready for some action!

Time for action – downloading the Ubuntu Desktop Live CD

In the following exercise I'll show you how to download the Ubuntu Linux Desktop Edition from the official Ubuntu website.
  1. Open your web browser, and type http://www.ubuntu.com in the address bar. The Ubuntu Home Page will appear. Click on the Ubuntu Desktop Download link to continue:



    VirtualBox 3.1: Beginner's Guide

  2. The Download Ubuntu page will show up next. Ubuntu's most recent version will be selected by default (Ubuntu Desktop 9.10, at the time of this writing). Select a location near you, and click on the Begin download button to continue.


    The Ubuntu Download page lets you download the 32-bit version automatically. If you want the 64-bit version of Ubuntu 9.10, you'll need to click on the Alternative download options link below the Download locations list box. The exercises in this article use the 32-bit version.
  3. You'll be taken to the download page. After a few seconds, your download will start automatically. Select the Save File option in your browser, and click on OK to continue.
  4. Now you just have to wait until the download process finishes.

What just happened?

I think the exercise pretty much explains itself, so I just want to add that you can also order a free Ubuntu CD or buy one from Ubuntu's website. Just click on the Get Ubuntu link at the front page and follow the instructions. I ordered mine when writing this article to see how long it takes to arrive at my front door. I hope it arrives before I finish the book!

Have a go hero – doing more with the thing

You can try downloading other Ubuntu versions, like Ubuntu 8.10 Hardy Heron. Just click on the Alternative download options link below the Download locations list box, and explore the other options available for download.

Creating your Ubuntu Linux VM

Now that you installed VirtualBox, it's time to learn how to work with it. I've used other virtualization products such as VMware besides VirtualBox, and in my humble opinion, the user interface in VirtualBox is a delight to work with.

Time for action – creating a virtual machine

At last you have the chance to use Windows and Linux side by side! This is one of the best features VirtualBox has to offer when you want the best of both worlds!
  1. Open VirtualBox, and click on the New button (or press Ctrl+N) to create a new virtual machine:



    VirtualBox 3.1: Beginner's Guide
  2. The Welcome to the New Virtual Machine Wizard! dialog will show up. Click on Next to continue. Type UbuntuVB in the Name field, select Linux as the Operating System and Ubuntu as the Version in the VM Name and OS Type dialog.
  3. Click on Next to continue. You can leave the default 384 MB value in the Memory dialog box or choose a greater amount of RAM, depending on your hardware resources.
  4. Click on Next to continue. Leave the default values in the Virtual Hard Disk dialog, and click on Next twice to enter the Create New Virtual Disk wizard. Leave the default Dynamically Expanding Storage option in the Hard Disk Storage Type dialog, and click on Next to continue.
  5. Leave the default values chosen by VirtualBox for your Ubuntu Linux machine in the Virtual Disk Location and Size dialog (UbuntuVB and 8.00 GB), and click on Next to continue.
  6. A Summary dialog will appear, showing all the parameters you chose for your new virtual hard disk. Click on Finish to exit the Create New Virtual Hard Disk wizard. Now another Summary dialog will appear to show the parameters you chose for your new virtual machine. Click on Finish to exit the wizard and return to the VirtualBox main window:



    VirtualBox 3.1: Beginner's Guide
  7. Your new UbuntuVB virtual machine will appear on the VirtualBox main screen, showing all its parameters in the Details tab.

What just happened?

Now your Ubuntu Linux virtual machine is ready to run! In this exercise, you created a virtual machine with all the parameters required for a typical Ubuntu Linux distribution. The first parameter to configure was the base memory or RAM. As you saw in step 3, the recommended size for a typical Ubuntu Linux installation is 384 MB.

Exercise caution when selecting the RAM size for your virtual machine. The golden rule of thumb dictates that, if you have less than 1 GB of RAM, you can't assign more than one half of your physical RAM to a virtual machine because you'll get into trouble! Your host PC (the one that runs VirtualBox) will start to behave erratically and could crash!

With 2 GB, for example, you can easily assign 1 GB to your virtual machine and 1 GB to your physical PC without any problems. Or you could even have three virtual machines with 512 MB of RAM each and leave 512 MB for your host PC. The best way to find out the best combination of RAM is to do some experimenting yourself and to know the minimum RAM requirements for your host and guest operating systems.

Don't assume that assigning lots of RAM to your virtual machine will increase its performance. If, for example, you have 2 GB of RAM on your host and you assign 1 GB to an Ubuntu virtual machine, it's very unlikely there will be a bigger performance increase than if you were assigning only 512 MB to the same Ubuntu virtual machine. On the contrary, your host PC will work better if you only assign 512 MB to the Ubuntu virtual machine because it will use some of the extra RAM for disk caching, instead of recurring to the physical hard disk. However, it all depends on the guest operating system you plan to use and what applications you need to run.

If you look closely at the Base Memory Size setting in the Memory dialog when creating a virtual machine, you'll notice that there are three memory areas below the slider control: the green-colored area indicates the amount of memory range you can safely choose for your virtual machine; the yellow-colored area indicates a dangerous memory range that you can choose, but nobody knows if your virtual machine and your host will be able to run without any problems; and the red-colored area indicates the memory range that your virtual machine can't use. It's wise to stick with the default values when creating a new virtual machine. Later on, if you need to run a memory-intensive application, you can add more RAM through the Settings button, as we'll see in the following section.

Another setting to consider (besides memory) when creating a virtual machine is the virtual hard drive. Basically, a virtual hard disk is represented as a special file on your host computer's physical hard disk, and it's commonly known as a disk image file. This means that your host computer sees it as a 'large' file on its system, but your virtual machine sees it as a 'real' hard disk connected to it. Since virtual hard drives are completely independent from each other, there is no risk of accidental overwriting, and they can't be larger than the free space available on your real computer's physical hard drive. This is the most common way to handle virtual storage in VirtualBox; later on, we'll see more details about disk image files and the different formats available.

VirtualBox assigns a default value based on the guest operating system you plan to install in your virtual machine. For Ubuntu Linux, the default value is 8 GB. That's enough space to experiment with Ubuntu and learn to use it, but if you really want to do some serious work —desktop publishing or movie production, for example—you should consider assigning your virtual machine more of your hard disk space.
You can even get two hard drives on your physical machine, and assign one for your host system and the other one for your virtual machine! Or you can also create a new virtual hard disk image and add it as if it were a second hard drive!

Before going to the next section, I'd like to talk about the two virtual hard disk storage types available in VirtualBox: dynamically expanding storage and fixed-size storage. The Hard Disk Storage Type dialog you saw in step 4 of the previous exercise contains a brief description for both types of storage. At first, the dynamically expanding option might seem more attractive because you don't see the space reduction in your hard drive immediately.

When using dynamically expanding storage, VirtualBox needs to expand the storage size continuously, and that could mean a slight decrease in speed when compared to a fixed-size disk, but most of the time this is unnoticeable. Anyway, when the virtual hard disk is fully expanded, the differences between both types of storage disappear.

Most people agree that a dynamically expanding disk represents a better choice than a fixed one, since it doesn't take up unnecessary space from your host's hard disk until needed. Personally, when experimenting with a new virtual machine, I use the dynamically expanding option, but when doing some real work, I like to set apart my virtual machine's hard disk space from the beginning, so I choose the fixed-size storage option in these cases.

Have a go hero – experimenting with memory and hard disk storage types

When creating a virtual machine, you can specify the amount of RAM to assign to it instead of using the default values suggested by VirtualBox. Create another virtual machine named UbuntuVB2, and try to assign the entire RAM available to it. You won't be able to continue until you select a lower value because the Next button will be grayed out, which means you're in the red-colored memory range. Now move back the slider until the Next button is active again; you'll probably be in the yellow-colored memory range. See if your virtual machine can start with that amount of memory and if you can use both your host PC and your VM without any problems. In case you encounter any difficulties, keep moving back the memory range until all problems disappear.

Once you're done experimenting with the memory setting, use the UbuntuVB2 virtual machine with the same exact settings as the one you created in the previous exercise, but this time use a fixed-size hard drive. Just take into account that since VirtualBox must prepare all the storage space at once, this process may take a long time depending on the storage size you selected and the performance of your physical hard disk. Now go and try out different storage sizes with both types of disks: dynamically expanding and fixed size.

Configuring basic settings for your Ubuntu Linux VM

All right, you created your Ubuntu virtual machine and downloaded a copy of Ubuntu Desktop Live CD. Can you start installing Ubuntu now? I know you'll hate me, but nope, you can't. We need to tell your virtual machine where to boot the Live CD from, as if we were using a real PC. Follow me, and I'll show you the basic configuration settings for your VM, so you can start the Ubuntu installation ASAP!

Time for action –basic configuration for your VM

In this exercise you'll learn how to adjust some settings for your virtual machine, so you can install Ubuntu Linux on it.
  1. Open VirtualBox, select your UbuntuVB virtual machine, and click on the Settings button:



    VirtualBox 3.1: Beginner's Guide
  2. The UbuntuVB – Settings dialog will appear, showing all the settings in the General tab.
  3. Click on the Storage category from the list in the left panel. Then select the Empty slot located just below the UbuntuVB.vdi hard disk image, under the IDE Controller element inside the Storage Tree panel, and click on the Invoke Virtual Media Manager button:


    VirtualBox 3.1: Beginner's Guide
  4. The Virtual Media Manager dialog will appear next. Click on the Add button to add the Ubuntu Linux Live CD ISO image:


    VirtualBox 3.1: Beginner's Guide
  5. The Select a CD/DVD-ROM disk image file dialog will show up next. Navigate to the directory where you downloaded the Ubuntu Desktop ISO image, select it, and click on the Open button to continue.
  6. The Ubuntu Desktop ISO image will appear selected in the CD/DVD Images tab from the Virtual Media Manager dialog. Click on the Select button to attach the Ubuntu ISO image to your virtual machine's CD/DVD drive.
  7. Next, the Ubuntu ISO image file will appear selected on the ISO Image File setting from the UbuntuVB – Settings dialog. Click on OK to continue.
  8. Now you're ready to start your virtual machine and install Ubuntu!

What just happened?

As you can see from the previous exercise, your virtual machine is just like a real PC. You need to 'insert' a bootable CD so that the VM can boot and start installing Ubuntu. In this case, we used an ISO image of Ubuntu Desktop instead of having to insert a real bootable CD. That's one of the benefits of VirtualBox: you can forget about having to burn a CD to test the new Ubuntu version or any other operating system! You just need to download the ISO image and configure your virtual machine to act as if there was a real CD inserted in the CDROM drive!

You can also go the traditional way, in case you have a DVD or CD ready to install your Ubuntu Desktop system. Just insert your DVD/CD, click on your virtual machine's Settings button, go to the CD/DVD-ROM category, and select the Host CD/DVD drive option instead of ISO Image File.
Whichever option you choose, your virtual machine will start to boot like a real physical PC! In the following section you'll get to see it with your own eyes...

Installing Ubuntu Linux on your VM

Now everything's ready to start installing Ubuntu! At last you're about to see this wonderful piece of software in action...

Time for action – installing Ubuntu Desktop on your VM

Ok, it's time to try out our new toy! Get ready for the ride of your life...
  1. Click on the Start button to start your virtual machine:



    VirtualBox 3.1: Beginner's Guide
  2. An Information dialog will appear to tell you that the Auto capture keyboard option is turned on. Enable the Do not show this message again option, and click on OK to continue.
  3. Another Information dialog will show up to tell you about the color depth of your virtual machine. Enable the Do not show this message again option, and click on OK to continue.
  4. The Ubuntu menu screen will show up, along with a pop-up menu where you can select the language of installation. Click anywhere inside the virtual machine screen, and the following information dialog will pop up:


    VirtualBox 3.1: Beginner's Guide
  5. Enable the Do not show this message again, and click on Capture to continue. The mouse pointer will disappear, and you will be able to move along the language menu. Select the English option, and press Enter to continue.
  6. Remember you can press Right-Ctrl, the default host key, at any time to uncapture the keyboard and mouse so you can move your mouse pointer out of the virtual machine screen.
  7. Now select the Install Ubuntu option on the Ubuntu start-up menu, and press Enter:



    VirtualBox 3.1: Beginner's Guide
  8. Ubuntu will start to boot and, depending on your hardware, it will take some time to boot up completely. A red bar below the Ubuntu logo will appear to show the progress of the booting process (the bar should turn completely yellow when it's finished).
  9. At the end of the Ubuntu booting process, the Welcome screen will appear, as shown below:



    VirtualBox 3.1: Beginner's Guide
  10. Select the language you want to use for the installation process (in this exercise, we'll stick with English). Click on Forward to continue. Select your Region and City in the Where are you? screen, and click on Forward to continue.
  11. The Keyboard layout screen will appear next. You can leave the default option if you're using a typical QWERTY keyboard or choose an appropriate layout for your keyboard. To be sure the layout you chose works with your keyboard, type something into the test box. Click on Forward when you're ready to continue the installation process.
  12. The Prepare disk space Use the entire disk) to let Ubuntu prepare the disk for you. Click on Forward to continue.
  13. Remember you're using a virtual hard disk and not the physical hard drive of your real PC; it's perfectly ok to use the entire virtual hard disk for your Ubuntu guest operating system; the rest of the files in your real hard drive won't be affected.
  14. On the next screen (Who are you?), you need to fill in your name, username, password, and your computer's name. You can also choose to login automatically or require a password to login. Use the following screenshot as a guide, but remember to replace my personal info with yours! Click on Forward when you're ready to continue:



    VirtualBox 3.1: Beginner's Guide
  15. The Ready to Install screen will show up next with a summary of all the settings you chose for the Ubuntu installation. Click on Install when you're ready to begin the installation process.
  16. Ubuntu will start to install in your virtual machine. An Installing System dialog will show you the installation progress:



    VirtualBox 3.1: Beginner's Guide
  17. After some time (depending on your hardware speed), the Installation Complete dialog will appear. Click on Restart Now to exit the installer.
  18. Eventually, the Ubuntu logo will show up. In a real PC, you would have to remove the installation disc and press Enter. In this case, you need to shutdown the virtual machine and change the CD-DVD Rom drive setting. Hit the Right-Ctrl key to uncapture the mouse so you can move it to select the Machine | Close option from the VirtualBox main menu:



    VirtualBox 3.1: Beginner's Guide
  19. The Close Virtual Machine dialog will appear next. Select the Power off the machine option, and click on OK to continue.
  20. VirtualBox will shutdown the virtual machine, and you'll return to the main screen. Now click on the Settings button to open the UbuntuVB – Settings dialog, go to the Storage category, select the ubuntu-9.10-desktop-i386. iso image in the Storage Tree panel; then click on the CD/DVD Device list box, and select the Empty option to remove the Ubuntu ISO image:



    VirtualBox 3.1: Beginner's Guide
    Click on OK to close the UbuntuVB – Settings dialog. Your virtual machine is now ready to start Ubuntu Linux for the first time!

What just happened?

Ok, you mixed up all the ingredients, baked the mix, and now the cake is ready to eat! Sorry about the analogy, but I was hungry at the time I wrote this!

Personally, I think this is one of the coolest things I've seen in the last few years... Installing a completely standalone guest operating system inside a host operating system with just a few clicks... Whew! Now we'll really start to squeeze all the juice out of our hardware! But before jumping to the next exercise, there are a few things I want to talk about.

Every time you start a virtual machine in VirtualBox, it has to share the keyboard and the mouse with your real PC. The Auto capture keyboard feature lets your virtual machine 'capture' all the keyboard action automatically every time you activate its window, and it's enabled by default on every new virtual machine. As you saw in step 2, an information dialog shows up when starting a virtual machine for the first time to tell you about this feature.

Also, if you click with your mouse inside the virtual machine's window, it will 'capture' all your mouse movements, as the information dialog in step 4 indicates. And how can we 'uncapture' the keyboard and the mouse to use it outside the virtual machine again? VirtualBox uses a special key, called the Host Key, for this purpose. By default, the host key is Right Ctrl.

To redefine the host key, you need to go to the VirtualBox main screen and select File | Preferences in the main menu:
VirtualBox 3.1: Beginner's Guide
Then you need to select the Input category in the VirtualBox – Settings dialog, click on the Host Key field, and then hit the key you want to use as the new host key. Finally, you just need to click on the OK button to apply the changes.

Once you define the key you want to use as the host key, you can use it to 'capture' and 'uncapture' the keyboard and the mouse in your virtual machine. Every VM shows the actual state of the host key at the bottom-right part of its main window:
VirtualBox 3.1: Beginner's Guide
In short, to use your virtual machine, you need to move your mouse inside its main window and click on it. You can also select the virtual machine's window and hit the host key to 'capture' the keyboard and the mouse. Then, if you want to exit your virtual machine and use something on your host PC, you just hit the host key, and you can move your mouse out of the virtual machine's window, along with your keyboard. Simple enough, right?

The last thing I want to mention is the color depth of your virtual machine's screen. In step 3 of the previous exercise, an information dialog appeared on your virtual machine to tell you about this. Now let's just try out your new Ubuntu virtual machine!

Thursday 17 June 2010

Walkthrough Tools within SketchUp 7.1

Walkthrough Tools within SketchUp 7.1:
In this article we will cover
* What to include in your animation
* How to create a simple walkthrough in SketchUp

The same principles for stills and animation

Creating moving images, or movies for architectural visualization, takes a slightly different but related mindset to still images (stills). That's because an animated sequence shows off more of the scene than in a still. For example, you might see the back of a building which you wouldn't have bothered modeling for a still. Now you have to model it.

Here's a recap

* If you can't see it, it isn't there (don't model it)
* If it's in the background, make it low poly or a 2D cutout
* Use interesting and varied camera angles

But this time, all this has to be kept in mind for the duration of a 30-second, 5-minute, or even feature length presentation made up of many views of the model. This can quickly become an overwhelming premise. So, we need to do it like all good movie producers do it. And guess what? You already know what that is, and practice it just about every day, because we're simply talking about breaking it down into bite sized chunks.
Rome wasn't built in a day

Some architect didn't sit down one day and start sketching Rome, starting with the Coliseum and working outwards until he'd finished the whole city. It took ages (literally) and involved many different designers and designs. So, Rome was made up of component parts, and each component part was made up of individual bricks. Just like you do every day with other design projects, home DIY, life goals, or even a holiday itinerary, you're going to break down your animation scene by scene and shot by shot.
Making a start: Sketch it out

Even if you already have a fully detailed model that you can quite happily view from any angle, you need to start by planning what you want to see in your animation. Actually, that's a complete lie. Why would the client want to see what you want to see? You're interested in buildings for pity's sake! So, we must start by filling the boots of the client or "audience" and from now on only think in terms of their wishes. If there was a switch to turn them on, what would it be?
Time for action – write out your itinerary

If you were to visit the quaint English village of Bourton-on-the-Water, what would be the absolute "must sees" of your trip? If you have travelled for 17 days to get there, you knew you could never go back there again, and you were the last one to go with a film camera before it was leveled by hungry bulldozers? So, write out your itinerary. There's a method of doing this that's completely easy and foolproof. You can do it when you're on the train or eating your cornflakes:

1. Take an A3 sheet of paper.
2. Start at the centre of the page and write down a feature of the building you're "selling" to your audience.
3. Rotate the page randomly and write another somewhere in a blank space.
4. Do it again and again
5. Go completely crazy and write down whatever pops into your head (such as "dishwasher", "great drainage", or "south facing").
6. When you've filled the page, collect them all up in a list.
7. Put three columns down the right-hand side, labeled Quality, Desirability, and a blank column.

It doesn't matter if you spell desirability wrong. That's the point of the exercise, no wrong answers, don't worry about spelling or getting the best stuff down. Just get the flow going. When you're done, in the Quality column give a rating 1 to 5 for how "nice" this part of this particular development is:
8. Now do a valley fold to hide the first column.
9. In the Desirability column, give a rating 1 to 5 for how desirable such a building feature is to your audience. You need to divorce this from your particular building completely. Rate it purely on how your audience would view this feature on any building. Does anti-vandal paint on a bin store make someone want to buy a property?
10. When you're done, multiply the first and second column and put the total in the third.

What just happened?

Without knowing it or finding it remotely difficult, you have written the itinerary for your animation. Easy wasn't it? You probably don't think you've achieved much, but you have. By using this method you were forced to be dispassionate about your design or model. You were also forced to separate out what you like (as a building feature lover) and what your audience wants (as the ones wanting to be in it!). What you have in the third column is a definitive rating of the impact of each feature on your audience. Go ahead and label it "impact" now.
Generating the story board

You are now ready to sketch out the storyboard, because you now know what to include in your animation and what to leave out. Take a pink marker and highlight everything with a score of 20-25. This is your prime real-estate. Take an orange marker and highlight scores of 12-16. And take a yellow marker to all the nines. Nines are just about tolerable. What you now have is a color coded scene allocation system. When deciding what to put into your animation, you should get all the pinks in as many times as you can. You should get the oranges in the rest of the time. And you should use the yellows to pad the content out where necessary and give an overall context to the presentation. And guess what? Anything you've not colored will actually detract from the presentation and stop people buying the property.

Don't you dare even model them!
Dealing with detractions

As you've discovered, anything in your list that didn't get colored could easily detract so much from your presentation that someone who would normally be enamored with it is left cold instead. So, these areas should be minimized if possible, but what do you do if they're a central feature and have to be included for context (or honesty)? For example the electricity enclosure, the bin store, or the plant room? Here's a quick list of ways to overcome this problem:

* Leave non-critical areas blank and un-textured, giving the context but not the detail
* Cover or mask with entourage
* Leave unfocussed in the background (with moving images this only possible when using professional level compositing software)
* Use viewing angles that obscure these features

Probably as much of your effort should be spent in minimizing bad features as promoting good ones. You should aim at showing the development in its best light and greatest potential.
Time for action – the storyboard

Now that you've decided what needs to be included and what needs to be left out, you need to decide how long to allocate to each, and what the camera views should be. Do the following on paper with sketches.

1. Split up your list into scenes, including wide views and close-up views.
2. Decide how long the whole animation should last. Add a couple of seconds for cutting out later.
3. What about transitions? Are you going to travel from one scene to the next, or cut to it?
4. Work out how long to spend on each scene, each transition.
5. Create a rough sketch for the start of each scene.
6. Scan them into your computer.

The following steps are shown specific to Windows Movie Maker, but are similar to all basic video editing software (Adobe Premiere Elements, Final Cut Express, iMovie, or similar)
7. In Windows Movie Maker or similar, import each picture.
8. In Import Pictures hold Ctrl to select more than one then click Import.
9. The pictures will open in the Collections area.
10. Drag them one by one into the StoryBoard in the sequence you want
11. Click Show Timeline. Drag the edge of each image out to the correct time-length.
12. Press play on the preview viewer.
13. Keep adding scene sketches and editing the timing until you're happy.
14. Add voice or music to the audio channel if you want to key the scene transitions to that as follows:
15. Click Import Audio or Music. Navigate to the file, then drag into the storyboard as before.
16. Remember to save the project.

What just happened?

You just storyboarded your whole animation so that you now know exactly where and what you need to go and model. You did this in Movie Maker or something similar, creating place markers so you can easily import your moving clips later. This saves an enormous amount of time in the long run because you will only model, texture, animate, and render what you're going to see, not what'll get left on the cutting room floor. If you already have your SketchUp scene completed, you could take screenshots from that instead of sketching it out. You can use this later, as a template to insert the actual animations into.

When you're doing a complex project such as an animation, it's vital to get a second or third pair of eyes onto it early on. Use your rough and ready movie to talk it through with a colleague, tutor, or a "clued up" friend. It's important to do it at this early stage because you haven't invested lots of time and emotion into it yet.
Animating in SketchUp

Now comes the really fun bit! We're going to look at the main ways you can get animation out of SketchUp. And don't forget, whatever you animate in SketchUp can be turned into a render in Kerkythea. So, SketchUp is a pre-visualization tool for rendering as well as a visualization tool in itself.
Time for action – a simple walkthrough

1. Create the simple scene illustrated here in SketchUp. The tallest object is about 2 meters (6.5 feet) tall.

 

2. Texture all the faces differently so that you can recognize where you are at any time.
3. Now go to View | Toolbars | Walkthrough.
4. Select the Walk button.
5. Type in your Eye Height and hit Enter (see the following screenshot).

6. Click the Look Around button to move your eyes around.
7. This can be the start of your walkthrough. Go to View | Animation | Add Scene.
8. We're going to walk in between the boxes and look what's on one of the surfaces we can't see.
9. With the Walk button selected, click on the screen, hold the left mouse button, and move the mouse forward. You start to walk! Move the mouse from side to side to steer.
10. Walk in-between the boxes. Now add another scene.
11. Use the Look Around function to turn on the spot and look directly at the right hand box. Add another scene.
12. To see how you've done, go to View | Animation | Play.

What just happened?

You set up a simple scene and told SketchUp you wanted to view it from eye level. Using the Walkthrough tool bar you simulated a person walking through your SketchUp model. This in itself is a highly effective presentation tool. You used the Look Around tool to change your view without altering eye height or camera position. It's important to use these tools to change views rather than your usual Pan and Orbit, in order to maintain a level eye height. You then created scenes to act like key-frames for the animation.

When you viewed it, you will have noticed the animation paused, flew quickly in-between the boxes, paused again, and then rotated the camera to the right. The settings that control the speed of a scene transition's length of pause are in the View | Animation | Settings dialog box. Go there now for a look.

Use your laptop for real time walkthroughs
The walkthrough tools you've seen right here are really useful for helping people visualise a design. There's nothing better than interacting with an environment and viewing it as you would see it in real life. Why not take your laptop to meetings and allow people to see your models first hand?
Animation settings

The animation settings dialog box looks like this:

You'll notice there are very few settings here and it's not possible to control individual scene timings. That's a pity in one way, but it does help keep everything simple. You'll look at how to control individual scene timing using a plugin a little later in the article. Here's what each setting does.
For now, you're going to add some intermediate steps to your walkthrough to smooth out the movement, and also slow things down a little.
Time for action – getting the timing right

1. Still in the settings dialog, change the scene transitions to 2 seconds.
2. Change Scene Delay to 0.
3. Close the dialog box.
4. Click on Scene 1.
5. Walk half-way between Scene 1 and Scene 2.
6. Right-click on Scene 1 and select Add Scene. Scene 4 appears between 1 and 2.
7. Play the animation again and note the difference.
8. Click to go back to Scene 4 and now move your position or eye view, then update Scene 4 (right-click and select update).
9. Play the animation again and repeat until you get a smooth timing between scenes.
10. Now create further scenes as you walk around the back of the cylinder and back through to where you started.
11. Click on each scene tab to view, edit, and update as necessary.

What just happened?

You just learned how to adjust animation properties and create a regularly paced animated walkthrough. You set up the scenes and were able to go back and tweak each one to get the desired effect. You will have noticed that the animation can still be a little jerky, and we still want to alter individual transition timings. Thankfully, there's a plugin for that and we're going to look at it now.
Time for action – adding individual timing to scenes

1. Get scenes_transition_times.rb from http://morisdov.googlepages.com.
2. Drop the plugin into your plugins folder and restart SketchUp.
3. Go to Plugins | Scenes Transition Times.
4. Type values (in seconds) into the boxes (-1.0 leaves it as default).
5. Play the animation again to see the difference.
6. Now find the scene in which you're turning your head to look at the box. Type 4 here.

7. Play the animation again to see the difference.

What just happened?

You installed a plugin that allows scene transitions to be adjusted individually. You then increased the scene transition time to four seconds when you turn to look at the box beside you. You may have worked out that the value goes in the box relating to the scene after the one you need to edit.

Note that the animation is still jerky. This may be good enough for your current project, especially if you stitch together different scenes into a collage of moving views in your video editing software. You just cut out the dodgy transitions. But for an altogether smoother animation there are some further techniques that you can work on now.
Summary

In this article, you learned:

* How to create walkthroughs
* Planning your animations the easy way

Friday 26 March 2010

Protecting Your Kids Online Through IP Change

Protecting Your Kids Online Through IP Change
By Virender Labroo

IP Change gives extra security for children while surfing the internet IP or internet protocol address is the answer when you are looking for identity protection in the internet. This article will show how we can protect our children on the internet from predators and other unsavory characters by a rather simple new piece of technology that involves rapid IP Change.

Modern day living without internet is unattainable. This holds true for us as well as our children. Denying children with internet access in today's time is quite impossible. Internet is becoming essential for the achievement of quality education. Thus, schools need to provide internet access to the kids. Internet is very important towards a wonderful learning process for children. It is used for researches, communication, and other educational and interactive games.

More mature children in their teens are now wired with their friends with Social Media Sites such as Face Book and My Space. Internet indeed dratiscally changed the teen world. .

However, internet does not offer all great opportunities only. It can also be a very dangerous place for vulnerable children with many predators lurching around on the net.

In order for us to safeguard our children, understanding of internet browsing is a must. We must have a knowledge as to where they hang out on the web. This includes forums, chat rooms, and other sites. Each of those should have rules to try to protect the young on the internet. For instance, you must make certain that for Face Book and My Space, only 13 years old and above can sign up. Are the forums and chat rooms controlled or not? Parents should be able to talk this out with kids to ensure that sites visited are safe.

It is also a must that parents use software to prevent violent and sexual content from being viewed by the kids. Parents must support their children all the way. They have to educate their children about indentity protection online. This includes education as to what should and should not be included when giving information online. They should be educated early on the risks and outcomes of identity theft and how important it is to protect the identity to ward of dangers now and consequences later in life.

Using simple language, children should understand how the internet works and how they can be protected when they are online. They should be reassured that their computer is firewall protected and has complete internet security suite updated and protecting them all the time. However, they must be reminded that they have to be extra careful about their identity online.

Parents, should however be conscious that technologies change all the time and new security technologies are being developed for better security and privacy on the net. One of these technologies is frequent IP Change. This routes your internet connection through various servers termed as proxy servers placed across the globe with the use of software called IP Changer. This software conceals your real IP address given by your ISP or Internet Service Provider since only one of the various IP addresses of the proxy servers are shown to the sites you and your children may visit. Internet surfing can now be done anonymously. Combining this IP Change technology with data encryption you are making your browsing secure and private. You are keeping hackers away by denying them your real IP address which is the key to access your computer.

Given this, when you put to practice good parenting , internet security software, and IP Change for anonymous browsing, you can be of great help for the security of children of children online.

About the Author: For more information about this important topic which is IP Change

Source: www.isnare.com

Friday 5 March 2010

Building Your First iReport

Building Your First iReport

We will develop our first simple report using iReport, and before doing so, we will create a connection/data source that will be used to fill the reports.

In this article by Shamsuddin Ahammad, author of iReport 3.7, we will learn about:

>> Creating a new data source or database JDBC connection
>> Creating a report using the wizard
>> Using the design query feature to produce the SQL query for the report
>> Viewing and exporting the report using the built-in viewer

So let's get on with it!

Creating a connection/data source

Before going to create the connection, a database should be set up. The SQL query for the database used for creating reports can be downloaded from the Packt website. Now, we are going to create a connection/data source in iReport and build our first report in some easy to follow steps:

You need to create the connection/data source just once before developing the first report. This connection will be reused for the following reports.

1. Start iReport.
2. Press the Report Datasources button in the toolbar. You will see a dialog box similar to the following screenshot:


3. Press the New button. Another dialog box will appear for selecting the data source type. There are several types to choose from, according to your requirement. For now, choose Database JDBC connection, and press Next >.


4. Another dialog box will appear to set up the Database JDBC connection properties. Give a sensible name to the connection. In this case, it is inventory.

5. Choose the JDBC Driver from the list, according to your connection type and/or your database. In this case, it is MySQL (com.mysql.jdbc.Driver).

6. Write the JDBC URL, according to the driver you have chosen. For this tutorial, it is jdbc:mysql://localhost/inventory.

In the previous code for connecting to a database from a Java program using JDBC—jdbc is the connection protocol, mysql is the subprotocol, localhost is the MySQL server if it runs on the same computer, and inventory is the database name.

7. Enter the Username and Password. Generally, for a MySQL server, the username is root and you have set a customized password during the installation of the MySQL server. The screenshot is as follows:


8. Press Test to confirm that you have set all the properties correctly. If all the settings are correct, then you will see a message that says Connection test successful!.

You can save the password by checking the Save Password checkbox, but be warned that iReport stores passwords in clear text. Storing passwords in clear text is a bad thing for us, isn't it? If you do not specify a password now, iReport will ask you for one only when required and will not save it.

9. Now save the connection. You will see that the newly created connection is listed in the Connections/Datasources window. If you have more than one connections, then you can set one as the default connection. In order to do this, select the connection and press Set as Default.

10. Enter the Username and Password. Generally, for a MySQL server, the username is root and you have set a customized password during the installation of the MySQL server. The screenshot is as follows:


When we execute the report with an active connection, the reports are filled with data from the database or other data sources. We can also see the report output with empty data sources, which has, by default, a single record with all fields set to null. An empty data source is used to print a static report. However, in order to choose the tables and columns from a database automatically using the Report Wizard, we need to connect to a database/data source first. To do this, we must create a connection/data source.

Building your first report

Having set up a connection, we are ready to build our first report. We will keep it very simple, just to be familiar with the steps required for building a report. We will create a report that lists out all the products; that is, we will show all the rows of the product table of our database.

Follow the steps listed and build your first report:

1. Go to the File menu and click New…. You will see a dialog box like the following screenshot:


2. From the list of Report templates, select Simple Blue and press Launch Report Wizard.


3. Enter Report name as List of Products and press Next >.
4. Now you will specify the query to retrieve the report fields. Select your connection from the Connections / Data Sources drop-down list.


5. Write the SQL query for the report you want to develop. In our case, it is

SELECT ProductCode, Name, Description FROM Product.

--------------------------------------------------------------------------------

iReport 3.7

Learn how to use iReport to create, design, format, and export reports
>> A step-by-step, example-oriented tutorial with lots of screenshots to guide the reader seamlessly through the book
>> Generate enterprise-level reports using iReport 3.7
>> Give your reports a professional look with built in templates
>> Create master/detail reports easily with the sub-report feature
>> Produce summary data and present them in a dynamic crosstab report
http://www.packtpub.com/ireport-3-7/book

--------------------------------------------------------------------------------

6. Alternatively, you can use the Design query option if you want to design the query graphically by selecting tables and columns easily, without writing the SQL commands. For this, double-click on the table name, select the fields from the table, and then press OK.


7. After writing the SQL query or designing the query, press Next >.


8. In this step, we will select the fields that we want to show in the report. We may select all the fields or choose some of them. For this example, select all the fields (ProductCode, Name, and Description) by clicking on >> (double arrow). Note that the fields listed here are based on the query specified in the previous step.


9. After selecting the fields, press Next >.

10. Now we are in step 5 (Group by…) of the wizard. Ignore this just for now; we will learn about grouping later. Press Next > to proceed.

11. We are at the last step of the Report Wizard. Now press Finish.


12. You will see the following output:


13. To change the title, select TITLE, and enter List of Products in the Text box of the Properties window, at the bottom-right corner. You can change the font name, size, and style according to your requirements from the same window. In this example, Font name is SansSerif, Size is 20, and style is Bold.


14. It's time to see the output of your first report. Just press the Preview button at the top of the report design. You will see a report similar to the following one:


To build the report easily, we can use the Report Wizard, where the database columns can be selected from the list, and the layout of the report can be set very easily by choosing templates. Note that for choosing the layout, the tabular format is generally suitable if your report shows more than one row from the database table, and the column format is suitable if the query returns only a single row. If the number of columns in the query result is quite large, then you can choose the landscape template.

Viewing and exporting the report

We can view our report using JRViewer or any other supported external programs, such as Acrobat Reader (PDF preview), Microsoft Word (RTF preview), any browser (HTML preview), and so on. You have seen the JRViewer preview. There is a built-in toolbar in the JRViewer; here you can save the report in various formats, such as PDF, RTF, HTML, CSV, XML, and so on. To do this, just press the Save button, and then choose PDF/ RTF/ HTML/ CSV/ XML or others from the Files of type drop-down list.

You can print the report from the viewer by just pressing the Print button in the toolbar. If your report contains more than one page, then you can navigate through the report pages using these four buttons: First Page, Previous Page, Next Page, and Last Page from the toolbar. You can resize the page to Fit the page, Fit the page width, or Actual size. You can also zoom in or zoom out. All options are available in the toolbar—you just have to choose the appropriate button.

You can change the report viewer from the Preview menu to see the preview in another application. You can choose from PDF, HTML Java 2D, RTF, or other preview options. However, before seeing these previews, you have to set the external programs for the appropriate viewers. You can do this from Tools | Options | iReport | Viewers. Browse the required programs for each viewer. Then choose the appropriate viewer from the Preview menu, and preview the report again.


Summary

In this article, we had a look at creating connections and building simple reports.

Specifically, we covered:
>> Creating a database JDBC connection
>> Using the Report Wizard
>> Using the design query feature for designing a query without writing the SQL command
>> Choosing the appropriate layout and template
>> Viewing report in JRViewer and other external programs