FreeBSD & WINDOWS VISTA

Posted by Benjamin Close on November 7, 2008 under FreeBSD | 10 Comments to Read

Dual Booting Windows Vista & FreeBSD / Linux / Some other OS

The Problem

After installing Windows Vista Enterprise Edition, I very quickly wanted to get back to FreeBSD. As per previous versions of Windows, Vista does a great job of overwriting the Master boot record (MBR). Unlike previous versions of windows, you cannot just install a different boot loader in the MBR – so I found out the hard way. (It used to be sooo easy fdisk /mbr would fix any broken boot sectors, then just install your favourite boot loader).

Vista writes a unique disk id in the MBR. This unique id (UID) is used by Vista to determine what disk is what. It does make some sense, Hardware can shift around, but the UID should always be the same. This allows Vista to always know where it’s files are and to appropriate label drive C: as the correct drive.

Installing another boot loader, however (ie Grub, lilo, the FreeBSD boot0 / boot loader /boot manager) will overwrites the UID in the MBR and Vista fails to load with an error:

"unable to access \windows\winload.exe"

The error message is semi appropriate but very misleading. What it really should say is ”I can’t work out which of my the drives has my files on it hence I can’t find winload.exe”.

Existing Solutions

Out on the web there is many solutions to the dreaded winload.exe. Many of them are misleading, some I believe are not even tested. Also many apply to Vista Release Candidate 1 (rc1) which I believe didn’t required the UID to be present in order to successfully boot. Below is some of the solutions that people say work (but Ifound didn’t).

Using Grub

Some say grub loading windows with something like:

Title Vista
  root (hd0,0)
  makeactive
  chainloader +1

will work – but grub still over writes the MBR hence the same issue will occur – though you may be lucky as the grub MBR is really small (and might leave the UID) untouched.

Using gag

There’s reports on a FreeBSD mailing list that gag will work, thought I’m running FreeBSD/amd64 which gag or grub for that matter won’t compile on. I know I could always install the lib32 compatability distribution to use it but I wanted the default FreeBSD boot loader.

Using the Vista Boot Loader

Many people have given up on trying to use a normal boot loader, and instead use the Vista boot loader.
The WinXP/NT bootloader (ntldr & config file boot.ini) have been replaced with files winboot.exe and bcedit.exefor configuration.

Theses commands could be setup to boot other operating systems though your milege may vary.

Commercial Software

Many people have decided it’s all too hard and gone and purchased software to handle it for them – there’s lots out there

Utilities

There is many utilities that claim to fix the issue. One such util is MBRFix.exe, this fixes the fact that vista won’t boot but it will clobber any boot loader you have got installed.

The Fix (That Worked)

The simple fix is to tell Vista that the drive it boots off of will always be the drive it can find its files on. This way you can clobber the UID in the MBR as much as you want and Vista won’t care. To do this you run:

BCDEDIT /set {bootmgr} device boot
BCDEDIT /set {default} device boot
BCDEDIT /set {default} osdevice boot

This can be run from either the Vista repair cd, from within Vista, or from something likehttp://www.ultimatebootcd.com (For Windows).

Conclusion

Hence it IS possible to run Vista with any boot loader that you like – in my case the FreeBSD boot loader is the one of choice.

  • jaalvarez

    jaalvarez said,

    I was getting the winlogon.exe not found error after installing PC-BSD with the BSD boot loader.

    I was in the process of checking your fix. I booted from the Vista CD and chose the REPAIR option. It automatically identified an error in startup (partition not found). I opted to have it automatically correct the problem. After just a moment it asked that I reboot and then allowed me to boot into my Vista partition.

    It did keep the BSD boot loader in place and functioning.

  • bice

    bice said,

    Worked perfectly, Vista on drive0 FreeBSD 7.1 on drive1.

  • Igor

    Igor said,

    Very useful and well structured information. Thanks

  • DougRH

    DougRH said,

    Hi,
    I’m trying to get Windows XP Pro running a RAID 1 array off of a pair of IDE HDDs from a PCI card and Vista Ultimate running off of a PCIe1 card on a different pair of RAID 1 SATA HDDs but canNOT get a dual boot running!. I’ve edited with BcdEdit directly on Vista, have used Vista Boot Pro, EasyBCD and tried OSL2000 all with no success. I can get it to boot to Vista AND start to boot XP but it always hangs up and stalls at CRCdisk.Sys (I think the file is, though it may be CRC.sys) and sometimes hangs up at Mup.Sys. If I have both Vista and XP hooked up and it will boot to Vista, subsequently it will not complete the XP initiation with the Vista HDDs unhooked until I either ‘repair’ or ‘reInstall’ XP (I’ve already had to have Win XP Pro ‘reactivated’ twice!)
    If I use EasyBCD and put the boot manager on the XP disks, then I can boot to XP, but Vista does not even show up in the boot menu.
    I’ve wasted way to much time on this already and need to get it working ASAP and move on.

    FYI – The PCIe1 card takes priority over the PCI card. It shows both during the boot up if I just have the XP array hooked up, but if I have it running Vista, the PCI/IDE card does not show up at all in the boot process.

    Thanks in advance for any and all help (< 8)
    DougRH

  • Benjamin Close

    Benjamin Close said,

    Since the pcie card is always found first you must put the boot loader on that disk. I think the problem may be related to how windows detects disks. Chances are your XP install is on your PCIHDD drive that XP considers to be C: however vista believes the PCIEXHDD drive is C:.

    I’d say that the the problem may be resolved by making sure that XP has drivers for the PCIEX card at installation time. This way XP will probe the drives in order and consider it’s PCIHDD to be D: not C:. This hopefully will allow it to resolve it’s drives correctly at boot.

    Good Luck!

  • DougRH

    DougRH said,

    Hi Benjamin,

    I am using the BCDedit.exe and the other utilities that I mentioned for editing & managing the (Vista) boot process on the Vista HDDs as when I try to do it on the XP drives, I am unable to edit with the Vista Boot manager/Utilities/files etc.

    I have the drivers for both cards loaded when I install both operating system,

    FYI: I know it is risky but out of desperation I have tried leaving the PCIe SATA RAID card in while installing XP, but don’t have the HDDs pluged into it. Once I am in XP I then I plug the SATA HDDs into the PCIe card then plug the power connector into the SATA HDDs. (Hot PnP) I can then reboot into XP, but then I can’t get into Vista )< 8)

    When I load the drivers for the PCIe during the XP install, I utilize the XP *.Inf file and it recognizes it just fine.
    When I load both of the drivers during teh Vista install, the most recent one is Windows 2003, which is working just fine for the PCIe card.

    The PCIe card is a HighPoint Rocket RAID 2300.
    THe PCI card is a Silicon Image Sil 0680R ATA-133 Medley RAID Controller.

    Thus both RAID cards are recognized and work just fine once I am into both XP & Vista.

    I have what you suggested covered and implemented but alas it doesn’t work.

    Thanks anyway though (< 8)
    DougRH

  • Benjamin Close

    Benjamin Close said,

    By not having the Vista HDD’s plugged in whilst installing XP, XP cannont enumerate those drives at install time – despite the fact you have the drivers loaded. Though Admittedly I’m guessing here.
    http://discussions.hardwarecentral.com/showthread.php?t=167275 seems to indicate that ntldr & ntdetect.com play a role in things not working. Have you tried changing the boot order in bios? It’s possible this will reorder your drives allowing XP to boot.

  • DougRH

    DougRH said,

    Hi Benjamin et all,
    Sorry I didn’t respond sooner, but I couldn’t get onto this site for quite a while for unknown reasons ) OK
    BCDEDIT /set {default} device boot —-> Error
    BCDEDIT /set {default} osdevice boot –> Error

    Thanks for everyone’s suggestions (< 8)

    Regards,
    DougRH

  • DougRH

    DougRH said,

    My above response got butchered and most of it didn’t post so here goes another try:

    I have tried pretty well everything that you suggested Benjamin without success before I read your reply.

    Except for these: Inputting the 3 BSD commands below in a DOS window with administrative privileges within Windows results in the first command being accepted OK, but I get an error message for the second and third ones and it doesn’t accept them.

    BCDEDIT /set {bootmgr} device boot —-> OK
    BCDEDIT /set {default} device boot —-> Error
    BCDEDIT /set {default} osdevice boot –> Error

    Thanks again,
    DougRH

  • Benjamin Close

    Benjamin Close said,

    Hi DougRH,
    Sorry I’m out of ideas, if you do manage to work it out, please let me know as I’m interested in a working solution.

Add A Comment