Friday, January 25, 2013

How to install Ubuntu from scratch, along with Windows (VERY detailed tutorial, excellent for beginners)

I din't know if I should publish this, because there's a lot of info sources for this topic in Internet. Nevertheless, I realized that there's always something missing. I always have to consult more than one source of information. Thus I decided to write a guide with all the things you should do from the beginning. I hope this encourage you to try Ubuntu.  Since I live in the real world, I can't recommend you to switch completely from Windows to Ubuntu. There's still too many applications for Windows that don't have their counterpart in Ubuntu, so you couldn't have the required tools for some important jobs. Anyway, Ubuntu is a great piece of software, and it's free! So it's worth giving it a chance.

I'm going to show how to install Ubuntu in a Windows machine without having to erase Windows.  Now, I know very well that sometimes you don't have enough space in you'r C: partition.  I know that you may want to install Ubuntu in a partition where you have more space.  Taking that into account, I will set the following environment:
  • A machine with Windows XP.
  • 2 partitions, C and D.
  • Ubuntu installed in a disk different than C.  In this case we will use E (it could be D, it depends on you configuration). We're not going to use all the space available in E, assuming that we have data there.
  • Boot configured to start with Windows.
  • Ubuntu installed from a USB Flash Drive. 

Mini Partition Tool installed.  Download it here: This tools will let you make the required partitions on the disk.

The last Ubuntu Version: Of course, the OS to install.

UNetbootin.  Download it here: This tool will allow you to install Ubuntu from a USB Flash Drive.


Make the bootable USB Flash Drive

1. Open unetbootin-windows-583.exe.  Set the options as shown in the following image and press Ok:
Modify the disk

1. Open Mini Partition Tool.
2. Select E:
3. Click on Move/Resize
4. Shrink the disk.  I'll shrink the disk to half its current size.  The idea is to create free space for everything you need in Ubuntu. Then press Ok.
5. Press Apply
Now you have space for Ubuntu in E.

Install Ubuntu

1. Restart the machine.  The USB drive should be connected by now.
2. Enter the Bios and configure it to boot from the USB drive.  This depends on your machine. You usually can enter you Bios by pressing F2 or Del in the first moments when the machine is starting.
3. If it boots from the USB drive, you will see a screen with "Default" selected; that is to start Ubuntu from the USB. Just the time pass or press Enter.
4. After that, Ubuntu will be started.  You will see something like this:
That's the Ubuntu desktop directly launched from the USB Driver. Double click on the "Install Ubuntu 12.10" icon.
5. In the Welcome dialog, select your languaje and press Continue.
6. I recommend to install the third party stuff with Ubuntu.  It's bothering to install things like the mp3 plugins afterwards, so check "Install this third-party software" an press Continue.
7. In the Installation Type dialog, you could select "Install Ubuntu alongside Microsoft Windows XP Professional", but here you don't have enough control of what's happening.  Remember, we want to install Ubuntu in the space we created for it in E:.  Select "Something Else" and press Continue.
8. As you can see, the next screen shows the disk with the free space we just created. Select "free space".
Now, it's time to make the partitions for Ubuntu.  This OS usually needs the following partitions:

Just that symbol.  It's the root path.  Ubuntu will be installed here.  Any programs you install in Ubuntu will be installed here as well.  So, think for a moment how much of the space is needed. In this case, I'll use about 40% of the available space for Ubuntu.

/home All the documents, photos and data will be stored. It's like "My Documents" for Windows, but this is more general.  The logic is a little dfferent for Ubuntu.  You are not supposed to worry about C: or D: units to store data.

swap area This is like the virtual memory for Windows.  The OS uses it when it's out of memory.  The general rule for the size of the swap area is to double the size of the memory.  If you have a RAM of 512, put 1GB.  Nevertheless, with 2GB or more of memory, 2GB should be enough.  In this case, I have a machine with 512 of RAM, so the swap area will have 1GB.

9. To add each partition, select the "+" sign after selecting "free space". 

To create / : Configure the "Create partition" dialog like the following picture (remember, I'm using 40% for this partition):
To create swap area : Configure the "Create partition" dialog like the following picure:
To create a /home : Configure the "Create partition" dialog like the following picure.  I'll leave the rest of the free space for this:
 Leave "Device for boot loader installation" in /dev/sda an press Install Now.
10. Select you city and press Continue (it should detect it automatically).
11. Select your Keyboard layout and press Continue.
12. Enter your personal data in the "Who are you?" dialog.
Now wait...this takes long...

After this, you already have Ubuntu Installed.

Post installation problems: Restore Grub

Every time I installed Ubuntu alongside with Windows I had this problem: Grub (the Ubuntu boot loader) doesn't work. It's like it was never installed. When I rebooted my computer, Windows initiated without giving me any chance to enter Ubuntu. In case you have the same problem, here are the steps to restore Grub, and how to configure it to have Windows as the default OS.

1. Boot from the USB drive.
2. When you see the Ubuntu desktop, open the Terminal.
3. Enter the following commands. Just press Enter when you are asked to.

sudo add-apt-repository ppa:yannubuntu/boot-repair (note that you have to enter your root password)
sudo apt-get update
sudo apt-get install -y boot-repair
This will install a boot repair app.

4. Go to Dash Home and write "Boot Repair".  Open it.

5. Click on "Recommended repair" and wait.
6.  Press Ok in the windows that is opened after the process ends.  Your will have to restart your computer.

Set Windows as Default OS in Grub

1. Open the Terminal and open Grub: gksu gedit /etc/default/grub
2. A text file will be opened.  Change "GRUB_DEFAULT=0" to "GRUB_DEFAULT=4".  If you saw the Grub menu when the system is starting, you will see that there are some options to select. The first is the regular Ubuntu, so it corresponds to 0.  If Windows is in position 5 (which is very likely), it corresponds to number 4.
3. You can change the Grub timeout as well.  This is useful if you want to enter quickly to Windows, but  you want to select Ubuntu in special cases.

1 comment:

  1. I have Add button instead of +, but it's inactive and I cannot press on it! Any ideas why?