A Digital Age Deserves A Digital Leader

How to: Dual-boot Windows Vista and Linux

How to: Dual-boot Windows Vista and Linux

Postby imnuts » Tue Jun 20, 2006 12:39 am

<img src="http://parcom.pro-networks.org/PROneT-News/ms_winxp.gif" align="right"> <img src="http://parcom.pro-networks.org/PROneT-News/WindowsVista.jpg" align="right"> <img src="http://parcom.pro-networks.org/PROneT-News/linux.gif" align="right">



Dual-boot Windows Vista and Linux

With the public beta release of Windows Vista, there are likely many users that would want to install Windows Vista along side some sort of Linux distribution. The problem arises with two small features of Windows Vista that do not play well with Linux. The first of which, and the main issue, is the new bootloader that Windows Vista uses. The second, which only causes minor issues, is the new NTFS format that is used by Vista. The main installation procedure here is install Windows Vista, see the <a href="/forum/about77377.html" target="_blank">PROnetworks Installation Guide</a> for details, and then install Linux. This guide will give users the instructions for doing so using the GRUB bootloader do to popularity. LILO, being a significantly less used bootloader, will not be looked at as distributions that have the option for LILO also can use GRUB.

For ease of use, this guide will be split up into three major sections that will cover the main multi-boot scenarios one might encounter.
1. <a href="#dualboot">Dual-Boot Windows Vista and Linux</a>
2. <a href="#tripleboot">Multi-Boot Windows XP, Windows Vista, and Linux</a>
3. <a href="#vista_last">Installation of Linux before Vista</a>

<a id="dualboot"></a><font size="+1"><b><u>Dual-Boot Windows Vista and Linux</u></b></font>
After the installation of Windows Vista, you will want to install Linux. <font color="#FF0000"><b>DO NOT resize the Vista partition during the installation of the Linux distribution!</b></font> Due to the change in NTFS versions, no Linux partitioning program, nor standard Windows partitioning programs, can properly alter the partition that Vista is installed to. Also, be sure to specify that GRUB is the bootloader to be installed if this is an option. After installation is completed and you will boot into the Linux operating system that you installed (because GRUB over-wrote the Vista bootloader in the MBR). From here, open up a terminal window (the method of doing so will vary across distrobutions/window managers). After you are at the terminal, all commands that are going to be needed to modify the boot menu will need to be run as 'root' so you will need to know how to accomplish this on your system (su or sudo). The first thing that we will do is backup the current boot menu, which can easily be done by doing this (remember to run this as root):

Code: Select all
cp /boot/grub/menu.lst /boot/grub/menu.lst.bak


Next, we need to edit the file "/boot/grub/menu.lst" in the text editor of your choice. You will now want to add an entry for Windows Vista. To do so, you need to add three lines to the file at the end of the file. Example entries follow:

<b>Vista is installed to the first partition of the first IDE hard drive:</b>
Code: Select all
title         "Windows Vista"
root         (hd0,0)
chainloader      +1


<b>Vista is installed to the first partition of the first SATA/SCSI hard drive:</b>
Code: Select all
title         "Windows Vista"
root         (sd0,0)
chainloader      +1


If your setup is not the same as either of the examples above, you will need to modify one to match your current setup. The only area that should need modification is the line that starts with "root". The item that will likely need modification is the drive and partition information. For editing the drive that Windows Vista is installed on, you will have to change the first '0' to the number of the drive. If it is the primary or first drive, it will be a '0', the secondary or second drive would be '1', and so on. The same numbering scheme is followed for the partition information, which is the second '0'. First partition on the device is '0', second partition is '1' and so on. If you do not know what drive/partition you should put into the list, you can find this out with a disk or partition management program that may be installed with the system. If you know the device that Vista is installed on, you can also translate that to the GRUB menu. For instance, if Windows Vista is installed to "/dev/hda3" then the "root" entry would be "(hd0,2)" and if the device was "/dev/sdc5" the "root" entry would be "(sd2,4)". A general note here as well, if you have Windows Vista installed to a logical partition within an extended partition, the extended partition counts as a partition. Because of this, what would be thought of as the "second" partition, if it is logical, would actually be the third, as the whole extended partition counts as '1'. If you do not know what the entry should look like, please <b>ask</b> as the only stupid question is the one not asked. It will likely save time and frustration on your part. After you have the file modified, save it and now restart the system to test it out.

<a id="tripleboot"></a><font size="+1"><b><u>Multi-Boot Windows XP, Windows Vista, and Linux</u></b></font>
The "triple-boot" scenario is actually not difficult, although one might suspect otherwise. The installation sequence is specific though for an easy setup. The installation procedure will be, first, install Windows XP as you normally would. After setup has finished and you are done setting things up the way you want them to be, you will want to install Windows Vista. This will alter the bootloader, and will have the Vista bootloader with an entry for Vista and Legacy OSes (XP and earlier). Once you are done with installing and configuring Windows Vista, you need to install the Linux distribution of your choice. During testing, Ubuntu 6.06 was used, and the GRUB boot menu was properly edited during installation to include an entry for Windows. Although the entry was labelled "Windows XP Professional", when this entry was selected during boot, it would bring up the Windows Vista bootloader and you could then boot either Windows Vista or a legacy operating system. There is a chance however that the installation of Linux will not automatically add an entry for Windows Vista/XP. In such a situation, one should follow the <a href="#dualboot">first section</a> about adding an entry for Windows to the GRUB boot menu.

<a id="vista_last"></a><font size="+1"><b><u>Installation of Linux before Windows Vista</u></b></font>
While this situation is not the ideal situation, it is not hard to fix. This should just involve re-installing GRUB. This can be done by using the following directions. First, open up the terminal and run the following command as 'root':
Code: Select all
grub

This will bring up the GRUB shell, which will allow you to re-install GRUB. From here, you will need to specify the drive and partition that GRUB is going to be installed (or reinstalled) to. We can do that by using the following command:
Code: Select all
root (hd0,1)

There may be a few changes that need made here depending upon the current setup. First, you need to make sure the drive type is correct. If GRUB is going to be installed to an IDE hard drive, then 'hd', as shown in the example, is going to be used. Otherwise, it will be 'sd', for a SATA or SCSI hard drive. The next item, the '0', is the drive number. Zero (0) specifies that it is the first hard drive in the sequence. If it is the second hard drive, this would be changed to '1' (one) and so on. Keep in mind that numbering starts at '0' so you would take the drive number and decrease it by one for the number used here. The last number, '1' in the example, is the partition where GRUB is to be installed. This partition should be the one that contains the '/boot' directory, and again, numbering of partitions starts at '0', so the above example is installing to the 2nd partition on the physical disk. The last step would be to install GRUB to the MBR, which can be done with the last command:
Code: Select all
setup (hd0)

Which could also require editing, depending on the setup. The drive type would need changed as described above along with the disk number. Since we are installing to the MBR, you will want to specify the drive that currently contains the boot information that is used by Windows Vista.

From here, we are now done installing GRUB to the MBR and we can exit the GRUB shell by typing:
Code: Select all
quit

After exiting the shell, we can restart the computer and test out to see if the reinstallation of GRUB was successful. If you do not have any entries for Windows, you will need to follow the instructions above in the section on <a href="#dualboot">dual-booting</a> as this describes the process of adding Windows Vista/XP to the GRUB boot menu.
Last edited by imnuts on Sun Mar 23, 2008 4:26 am, edited 4 times in total.
PRO SUPREME
User avatar
Posts: 7457
Joined: Wed Mar 24, 2004 5:19 am
Location: Boothwyn, Pennsylvania
Real Name: Mark

Postby JabbaPapa » Tue Jun 20, 2006 6:51 am

Excellent guide, imnuts, and I'm sure this will be useful for MANY of our members :yesnod:
Image
PRO VETERAN
User avatar
Posts: 9538
Joined: Sun Feb 22, 2004 5:17 pm
Location: Monte-Carlo
Real Name: Julian Lord

Postby kd1966 » Tue Jun 20, 2006 12:12 pm

I used this guide to add SUSE 10.1 to my system yesterday, then completed the steps to make my system "Tri-Boot" in effect; the SUSE bootloader comes up first, and then I can pick SUSE or the Vista bootloader, which has both Vista installs and my XP. Very neat; a must have for anyone that either "must" have linux or just wants to "mess around" in linux.
PRO PLATINUM
User avatar
Posts: 6831
Joined: Tue Aug 09, 2005 2:00 am
Location: USA - GSO - NC

Postby Grav!ty » Tue Jun 20, 2006 12:43 pm

An excellent guide thank you imnuts ^*^
Image

"The great majority of mankind are satisfied with appearances, as though they were realities, and are often more influenced by the things that seem than by those that are." - Niccolo Machiavelli
PROfessional Member
User avatar
Posts: 15790
Joined: Tue Sep 14, 2004 5:22 am
Real Name: Graham

Postby gries818 » Tue Jun 20, 2006 4:07 pm

Nice work ;)
Image

Mac OS 10.6.7 - Personal
Ubuntu Server 11.04 - Server
Software Development
User avatar
Posts: 3991
Joined: Wed Jul 07, 2004 6:28 pm

Postby l33t » Tue Jun 20, 2006 5:39 pm

wow, very good!

but, for those that installed Vista AFTER they installed older versions of Windows, and used a VIRTUAL DRIVE none of that is necessary

Here's what i did.

I made all the partitions (using a bootable CD)
one gig swap (for suse 10.1)
30 for suse 10.1
20 for Vista Beta 2
and the rest for Windows XP_x64 (i think, after formatting, its 100 gigs)

then i installed XP x64
then installed vista beta 2 (useing a virtual drive, alcohol 120% to be exact)
then installed suse 10.1

suse was the only install i had a bit of a problem with... it is by far the easiest installer, but i have a problem with some of its recommended default settings. i had to manualy design my installation (it wanted to wipe out my windows partitions)

but other than that, all was good.
suse installed... i gave it the default settings for GRUB (the bootloader)
and now, after POST, grub askes me if i want suse 10.1 or Windows.
selecting windows will bring me to the Vista bootlader, where i can pick X64 or Vista Beta 2


enjoy, and remember, messing with your hard disks partition setup can really screw things up if you dont know what it is that you are doing. Be carefull, and if you think its nessary, back up your data.
PRO Level 14
User avatar
Posts: 882
Joined: Mon May 02, 2005 2:06 am

Postby imnuts » Tue Jun 20, 2006 5:43 pm

l33t wrote:but, for those that installed vista AFTER they installed older versions of windows, and used a VIRTUAL DRIVE none of that is necessary


the second section describes exactly what you did, it just doesn't mention any installation method as that doesn't matter. The installation order is the only thing that really matters.
Image
PRO SUPREME
User avatar
Posts: 7457
Joined: Wed Mar 24, 2004 5:19 am
Location: Boothwyn, Pennsylvania
Real Name: Mark

Postby l33t » Tue Jun 20, 2006 5:56 pm

imnuts wrote:
l33t wrote:but, for those that installed vista AFTER they instealed older versions of windows, and used a VIRTUAL DRIVE none of that is nessary


the second section describes exactly what you did, it just doesn't mention any installation method as that doesn't matter. The installation order is the only thing that really matters.



ahhh, i thought that worked only because vista was installed through a virtual drive... i guess not.
PRO Level 14
User avatar
Posts: 882
Joined: Mon May 02, 2005 2:06 am

Postby imnuts » Tue Jun 20, 2006 6:01 pm

l33t wrote:ahhh, i thought that worked only because vista was installed through a virtual drive... i guess not.


It works because GRUB sees XP or another previous Windows Installation (which it recognizes) and then adds an entry for Windows to the GRUB menu. GRUB doesn't understand Vista or it's bootloader yet, so if you don't have a previous windows installation, youneed to follow section 1.
Image
PRO SUPREME
User avatar
Posts: 7457
Joined: Wed Mar 24, 2004 5:19 am
Location: Boothwyn, Pennsylvania
Real Name: Mark

Postby l33t » Tue Jun 20, 2006 6:57 pm

imnuts wrote:
l33t wrote:ahhh, i thought that worked only because vista was installed through a virtual drive... i guess not.


It works because GRUB sees XP or another previous Windows Installation (which it recognizes) and then adds an entry for Windows to the GRUB menu. GRUB doesn't understand Vista or it's bootloader yet, so if you don't have a previous windows installation, youneed to follow section 1.


well, somehow, grub boots, and allows me to select windows, which brings me to vista boot laoder...

i *think* this is becuase when vista is installed (if it detects a legacy partition), it installs the vista boot up code on the vista partition, not the MBR where it would be expected.

what it does, is just modify the xp bootlader to point to the locaion on the vista partition, which then links to all the other recognised partitions.... or so i think..

because if what you say is true (grub cant recognise vista boot loader) then how else could it work? the only ohter OS i have installed (besides vista) is xp pro_x64...(and of cousrse suse) so if grub cant recognise vista, but it can xp pro, and of course recognises suse, then it *has* to be the xp_pro boot laoder thast handing control over to some files somewhere on the vista partition (in the BOOT folder i would think)
PRO Level 14
User avatar
Posts: 882
Joined: Mon May 02, 2005 2:06 am

Next

Return to Guides

Who is online

Users browsing this forum: No registered users and 3 guests