ICS 412: Installing Ubuntu with VirtualBox

These are the steps I followed to install Ubuntu on VirtualBox on my Intel-based MacBook Pro laptop. Please send feedback if you have suggestions on improving this. I don't create VMs for a living :)

  1. Download an Ubuntu ISO-image. For instance from here. Save the ISO file (mine's called ubuntu-9.04-desktop-i386.iso) somewhere on your computer.
  2. Download VirtualBox from the VirtualBox Web site.
  3. Installed VirtualBox using the easy step-by-step installer.
  4. Start VirtualBox by double-clicking on its icon or whatever you do on your OS to start an installed application.
  5. Click on the "New" blue sun-looking icon in the VirtualBox GUI to create a new VM, and start following the instructions. They are very detailed and self-explanatory, but I detail my steps below.
  6. Pick a name for your VM (I used "My Ubuntu VM").
  7. Select "Linux" and "Ubuntu" for the Operating System and Version menus.
  8. On the next panel, select a RAM size for your VM. You won't need much, so using the default of 384MB should be fine. If at some point in the semester you want more, you can recreate a VM easily.
  9. On the next panel, select the "Create a new hard disk" option. This pops up a new panel. Select "Dynamically expanding storage" (most likely the best choice). Then specify where you want the file that contains your new VM's disk space to be located. (The default is probably fine.) Pick the size of your virtual hard disk. (8GB should be fine.)
  10. Click "finish" and double-click on your newly created VM instance which is displayed in the list of VM configurations on the left of the main VirtualBox window. This will pop up a window and explains to you about "mouse capture". Essentially, if you click in the VM the mouse will be trapped there and you need to hit a key to recover your "real" mouse. Read the instructions in the dialog box, they are very clear.
  11. A new Wizard pops up telling you that you need to install an OS on your VM. Select the "CD/ROM" and the "Image file" options, indicating the path to the ISO image you downloaded in Step #1. Click "finish".
  12. At this point you're entering the Ubuntu configuration (remember that your mouse is trapped and must be released by hitting a key.) If you've installed Ubuntu before, you know what to do. If not, continue reading .
  13. Select the language you want to use. Then, using the up/down arrows select the "Install Ubuntu" option and press enter. This will take a while, but you should see some moving Ubuntu progress bar. When it's done you'll be asked a few easy questions (time zone, keyboard, etc.)
  14. Next, you're asked about partitions. If you know about this, then create whatever partition table you want. If you don't and want to find out, there are again many tutorials on-line. Otherwise, you can create a single partition. This would be a poor idea on a real system. One may argue that, even for us, a swap partition could be nice, especially if you didn't pick a large RAM space. To create a swap partition go into the advanced partitioning option, click on the free space and select "Create new partition". Select "Logical", "Swap" and set the size to double your system memory.
  15. You now have to enter your name, user name, password, etc. These are for the Ubuntu machine, just like on a real system you'd be installing.
  16. You're done and you can click "Install". This takes a while again and eventually asks you to restart the machine You'll have to press enter to answer a question about ejecting a disk at some point (just press enter), and then select the "Boot from First Hard Disk" option with the up/down arrows and enter.
  17. Once the machine has restarted, you see a login prompt. Type your user-name and password, and you're in. Navigate the menu on top of the screen to launch the "Terminal" application (Applications > Accessories > Terminal). This opens a windows with a shell in it. You're almost done.
  18. You may see the "Package Manager" pop up asking you to install updates and in particular security updates. Do so. (yes, your VM has access to the network.)
  19. For this course, we need a Linux box with some software. To install a software package under ubuntu you must use the following command: "sudo apt-get install <package name>". (This command prompts you for your password.)
  20. Install Java by typing: "sudo apt-get install sun-java6-bin sun-java6-jdk". After typing in your password, type enter when asked if you really want to download/install, and wait until you get the prompt back.
  21. You can now use javac/java to compile/run programs in Java. The standard Linux things are all there. I'll stop here. You're strongly encouraged to independently research what you can do on your Ubuntu machine. Also, VirtualBox has many cool options (e.g., to share files between the VM and your host), which I haven't tested yet. But given how easy this is (in spite of the many steps), I can't imagine anything being too difficult.
  22. Congratulations, you've successfully installed a Linux Virtual Machine.