Previous Section  < Day Day Up >  Next Section

Recipe 12.11. Adding Windows 95/98/ME to a Linux System

12.11.1 Problem

You have a single computer, and you would like to dual-boot Windows 95/98/ME and Linux, because you use applications on both platforms. Or you have a small test network, and you want to install as many operating systems are you can in multiboot configurations, so that you can test different combinations of operating systems without using a lot of computers. Or you already tried to add Windows 95/98/ME to your nice new Linux multiboot system, but it didn't even install—it complained about not being able to format the C: drive, which is a good thing, because it would have overwritten your Linux installations. You don't want to use an emulator like VMWare, which lets you run both at the same time without rebooting, because it's too expensive, or your hardware is too feeble.

12.11.2 Solution

There are a number of tricky bits to adding Windows 95/98/ME to a Linux system. You'll need to hide partitions, and restore GRUB to the MBR after the Windows installation, because Windows overwrites the bootloader. Windows 95/98/ME must have a primary partition prepared in advance. Unfortunately, GRUB does not boot CD-ROMs, so you'll need a Windows Startup diskette. (This is a very useful disk for all versions of Windows.) If you don't have one, it is easy to make one from 98 or ME:

  1. Load a new, blank diskette.

  2. Go to Control Panel Add/Remove Programs.

  3. Click on the Startup Disk tab.

  4. Click on the Create Disk button.

Write-protect the disk, and it's ready to go.

To install Windows 95/98/ME on /dev/hda4:

  1. Boot to the GRUB command shell.

  2. Insert the Windows 98 Startup diskette.

  3. At the GRUB command line, hide all of your existing partitions:

    grub>  hide (hd0,0)
    grub>  hide (hd0,1)
    grub>  hide (hd0,2)

  4. Now boot the Windows diskette:

    grub>  chainloader (fd0) +1
    grub>  boot

    Be sure to enable CD-ROM support as the diskette boots.

  5. Use MS-DOS fdisk on the Windows rescue diskette to create a primary DOS partition for Windows. When you're finished partitioning and back at the A:\> prompt, insert the Windows installation CD, change to the D: drive, and start the Windows Setup program:

    A:\> D:
    D:\> setup

  6. Windows will overwrite the MBR, which is convenient for getting through the many reboots. When it's done, restore GRUB to the MBR. Boot to your GRUB floppy, and run the following comands:

    grub> root (hd0,0)
    grub> setup (hd0)

  7. Remove the GRUB diskette and reboot, and your GRUB menu will reappear. Boot to Linux so you can edit menu.lst:

    title   Windows 98 on /dev/hda4
    hide (hd0,0)
    hide (hd0,1)
    hide (hd0,2)
    unhide (hd0,3)
    chainloader +1

12.11.3 Discussion

Let's look at the last three options more closely:


Don't try to read or mount the partition.


Set the bootable flag on the partition. Windows needs this.

chainloader +1

Points to the bootloader of operating systems that GRUB does not directly support, like Windows.

If you're thinking "Wow, this sounds like a lot of work," you are right. There is an easier way to dual-boot Windows 95/98/ME with Linux: install Windows 95/98/ME first, then add Linux. If you install Linux last, the installer will load GRUB in the MBR for you and will automatically create an entry for Windows in the GRUB menu.

You cannot run more than one 95/98/ME, unless you use GRUB's partition-hiding on every one and have enough primary partitions to give each one its own.

12.11.4 See Also

    Previous Section  < Day Day Up >  Next Section