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 :)
- 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.
- Download VirtualBox from the VirtualBox Web site.
- Obviously you need to select the version for your own OS.
- Installed VirtualBox using the easy step-by-step installer.
- See the VirtualBox User Manual for all details. (I actually never even looked at it since everything was so intuitive.)
- Start VirtualBox by double-clicking on its icon or whatever you do on your OS to start an installed application.
- 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.
- Pick a name for your VM (I used "My Ubuntu VM").
- Select "Linux" and "Ubuntu" for the Operating System and Version menus.
- 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.
- 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.)
- 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.
- 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".
- 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 .
- 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.)
- 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.
- 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.
- 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.
- 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.
- 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.)
- 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.)
- 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.
- 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.
- Congratulations, you've successfully installed a Linux Virtual Machine.