dual-boot: how can windows 7 or any other OS be installed in ubuntu ?

Asked by Boamah Andrews

how can windows 7 or any other OS be installed in ubuntu 12? making ubuntu 12 as your main OS and windows 7 as your alternative OS.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu ubiquity Edit question
Assignee:
No assignee Edit question
Solved by:
Ivo Xavier
Solved:
Last query:
Last reply:
Revision history for this message
Warren Hill (warren-hill) said :
#1

It is easier if you install Ubuntu last but you can do it either way round. See here
https://help.ubuntu.com/community/WindowsDualBoot

Revision history for this message
Best Ivo Xavier (ivoxavier) said :
#2

If you have already Ubuntu as your main OS, you can boot with the Ubuntu Live CD and with Gparted make the partition of the disk as you like. Then, you boot with windows 7 and install it. After the installation is complete the Windows 7 will replace the grub that allows you to boot Ubuntu. So, you need, again, to boot from Ubuntu Live CD and then go to "Terminal" then type:

» sudo fdisk -l (this allows you to locate your Ubuntu partition)

 » sudo sudo mount /dev/sdb /mnt (remember that /dev/sdb/ maybe different for you. If Ubuntu is your main, could be sda.)

» sudo grub-install --root-directory=/mnt /dev/sdb (This will re-install the grub that allows you to boot Ubuntu and Windows 7. NOTE: Change the /dev/sdb according to your spefication!).

---------OR-----------

You can make like Warren Hill say's, install Windows 7 first then Ubuntu.

Good Luck!

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

In a dual boot, there is no 'Main OS'. You simply choose the OS you want to use at boot, neither of them is the 'Main OS', where do you get this terminology from? Just because you use one more than the other, or that one OS was installed first doesn't make it the 'main OS', you just happen to use that one more. Nothing more.

If you already have Ubuntu installed and want to install Windows 7 then you will need to boot to the Ubuntu liveCD and resize your Ext4 partition (I recommend a full backup of your data before starting out). You can then leave the space unpartitioned and install Windows to the freed space.

After the install you will onoly be able to boot to Windows. You will need to boot back to the liveCD and reinstate Grub to the MBR as the junk Windows installer will blindly overwrite it with its own loader. Once you do this you will only be able to boot to Ubuntu. Boot to Ubuntu (not liveCD) and run:

sudo update-grub

And it should see the new Windows OS.

An alternative to all this is to wipe the Ubuntu OS using the WIndows installer (This will destroy ALL data so be sure your backups are fully up to date) and install Windows, leaving unpartitioned space for Ubuntu. You can then install Ubuntu to the free space and restore the user data etc, the dual boot will be fully handled for you as the boot loader for Ubuntu (Grub 2) is far better than the Windows loader and it will accommodate the Windows OS.

Revision history for this message
Boamah Andrews (myweezy14) said :
#4

Thanks Ivo Xavier, that solved my question.