# Windows 7 and FreeBSD 9 Dual Boot



## markfisher (Jan 21, 2012)

Hi
I have 2 hard drive installed on my machine. I installed Windows 7 on one hard drive and FreeBSD 9 on the other. I used GPT for my FreeBSD. My question is how can I install boot manager so that I can dual boot (In FreeBSD 8, sysinstall asks for boot manager but bsdinstall doesn't)?

Thanks
Mark


----------



## SR_Ind (Jan 23, 2012)

FreeBSD 9 will not dual boot with Windows Vista/7/2008. 

If you start with FreeBSD, then later Windows Vista/7/2008 complains that no drive is present.

If you start with Windows Vista/7/2008, then the FreeBSD later complains that drive cannot be GPT partitioned.

Try setting up a dual boot system consisting Windows Vista/7/2008 and FreeBSD 8.2 and then try to update FreeBSD while booted inside FreeBSD 8.2.


----------



## kpa (Jan 23, 2012)

SR_Ind said:
			
		

> FreeBSD 9 will not dual boot with Windows Vista/7/2008.



What are you basing this on? I have successfully set up dual boot with Win7 on the first disk (MBR) and FreeBSD 9 on the 2nd disk (GPT). I used the /boot/boot0 bootloader on the first disk that is installed with boot0cfg(8):

`# boot0cfg -B /dev/ada0`

In my case /dev/ada0 was the first disk as seen from FreeBSD.


----------



## wblock@ (Jan 23, 2012)

SR_Ind said:
			
		

> FreeBSD 9 will not dual boot with Windows Vista/7/2008.



I'm reasonably sure that it will, but will require a third-party GPT boot loader if the Windows 7 disk uses GPT.  Or maybe the Windows 7 loader can do it.  (I don't have Windows 7 currently, and will not be buying it in the foreseeable future.  If someone wants to provide me with a (legal) Windows 7 install package, I will write an article on dual-booting with Windows 7 and GPT.)

If the Windows 7 disk uses MBR, then install FreeBSD in an unused primary partition.  At the end of the install, go into the shell and use boot0cfg(8) to install the multi-boot loader.

Incidentally, in some ways multi-booting is the worst of all possible worlds.  Consider the alternative of installing just the primary operating system and running others in VMs.


----------



## SR_Ind (Jan 23, 2012)

@kpa

@wblock@

I'm a dual boot user. I did precisely that. The FreeBSD 9 bootloader fails to locate any OS on the first partition (i.e. Windows 2008).

On my laptop the combination tried was Windows 2008 + FreeBSD 9 and I finally settled on Windows 2008 + FreeBSD 8.2.

The combination of Windows 7 + FreeBSD 9 failed on my old desktop. Although I suspect there are some BIOS issues in the desktop's ASUS motherboard.


----------



## wblock@ (Jan 23, 2012)

I started to mention (but got distracted by something shiny) an example of a third-party boot loader, like sysutils/grub2.


----------



## SPlissken (Jan 24, 2012)

wblock@ said:
			
		

> Incidentally, in some ways multi-booting is the worst of all possible worlds.  Consider the alternative of installing just the primary operating system and running others in VMs.



I don't think the same, but that s not the question.
I m facing the same issue as markfisher on a new laptop with Window 7.
I want to keep Window 7, it could be usefull one day.
I think i will apply the solution given by SR_Ind, install first 8.2 that should let me decide where to install the bootloader then update to FreeBSD 9.
Then install GAG (http://gag.sourceforge.net/) which i already use on my previous laptop to boot WinXP, Debian and FreeBSD 8.2.

I will keep you inform if it works.


----------



## markfisher (Jan 24, 2012)

@wblock@
I installed windows 7 first (MBR) on the first hard drive.
Then I installed FreeBSD (GPT) on the second hard drive.
In my case since I'm using 2 separate hard drives I can use motherboard boot menu to choose from which hard drive I want to boot. I will give your boot0cfg a shot to see if it's going to work. 

Thanks
Mark


----------



## wblock@ (Jan 24, 2012)

I haven't tested boot0 (the multi-boot loader) with GPT.  It might work (because of the GPT's protective MBR).  It might not work to install it on a GPT disk.  Or it might not work at all.  Multiple drives is less complicated than one drive with multiple partitions.

Using the BIOS boot menu is safer.  If that's working for you, stick with it.  If not, please make full backups, including MBR and partition tables, before trying other configurations.


----------



## SPlissken (Jan 29, 2012)

Finally I used PCBSD to install a basic FreeBSD 9 release, then install GAG and now I can boot Win7, LinuxMint and FreeBSD on my new laptop.
Have to install all the stuff for FreeBSD.


----------



## cuq (Jan 30, 2012)

Hi, just wanted to say that boot0cfg(8) dual boot worked fine in my configuration: 

I installed Windows 7 Pro, liberated space with GParted on the disk, installed FreeBSD 9 on the slice created with GParted (ada0s4) and, after the instalation completed, I run *boot0cfg -B /dev/ada0*. Then reboot and now I can boot on W7Pro or FreeBSD without any issues.

Cheers and thank you,
cuq


----------



## router54g (Mar 1, 2012)

boot0 seems to work just fine with MBR partitions, cuq. The problem is using GPT. If your Win7 is already installed with GPT, it seems like the only easy way to get it working is to reinstall using legacy BIOS (MBR) and then install FreeBSD with MBR slices. boot0 works just fine in this case.


----------



## wblock@ (Mar 2, 2012)

boot0 only works with MBR; it's from the era before GPT.  sysutils/grub2 will do it.  The process needs to be thoroughly documented.


----------



## user1 (Nov 8, 2012)

I was searching google for dual boot threads and came across this one.

To dual boot Windows 7 and FreeBSD9 install FreeBSD first then install Windows.  Windows will remove FreeBSD from the MBR when it installs.  To get FreeBSD back on the MBR download/install EasyBCD from download.com (its free) and add FreeBSD back to the MBR.




Now if you install Windows first and FreeBSD second (or ruin your dual boot by reformatting the FreeBSD partition like I did) its not as easy of a solution.  I'm trying to figure out how to fix it now.  I think I can burn EasyBCD onto a cd and boot from it but I'm trying to figure out the command that the handbook suggested ( http://www5.us.freebsd.org/doc/handbook/boot-blocks.html )


----------



## user1 (Nov 8, 2012)

Just wanted to the add that FreeBSD is located on ad0 partition 1 partition 2 is windows system reserved(100mb) and partition 3 the main windows partition.

I tried using the windows 7 bootdisk to repair the windows MBR.  My thought was I'd use their restore feature then add an entry with EasyBCD but without an entry the boot disk doesn't recognize that windows is installed.


----------



## zspider (Nov 8, 2012)

I didn't even do any of that recently. I installed FreeBSD with MBR partitions(Windows 7 would not let me install to a GPT partitioned drive) and left half the space unallocated, I then installed Windows in the other half. Then I put the FreeBSD DVD back in and dropped into a console and re-installed FreeBSD's boot manager. When I rebooted I have both Windows and FreeBSD as options and they both work.


----------



## SirDice (Nov 9, 2012)

zspider said:
			
		

> (Windows 7 would not let me install to a GPT partitioned drive)


It can. But you *must* use UEFI boot to boot the Windows 7 installer.


----------



## user1 (Nov 9, 2012)

To resolve this I ended up removing the windows partition and reinstalling it then adding FreeBSD to the MBR with EasyBCD.  Have it working now.  Thanks.


----------



## kpa (Nov 17, 2012)

Please provide some more details to back up your claim. I have set up numerous machines to dual boot with win 7 and FreeBSD 9. It's true that dual boot on a GPT partitioned disk is much harder to set up but it's not impossible either. Then there's always the option of reverting to MBR partitioning which makes dual booting a piece of cake.


----------



## nakal (Nov 17, 2012)

Of course it will boot. The only problem is that if you don't use its original boot record, Windows seems not to be able to find it's own partition anymore (it stops with a BSOD in this case with some obscure numbers). This can be fixed by BCDEDIT or EASYBCD.

Just because you could not manage to get it to work, it does not necessarily mean that it is impossible.


----------



## rojiru (Aug 26, 2013)

*Windows 7 repair worked*

I am just now getting around to getting FreeBSD installed again. I had Windows 7 dual booting with Slackware using LILO for boot manager, which worked fine. Unfortunately I have to keep Windows 7 for work requirement, and a VM won't cut it for me right now. Possibly I can work something out in the future using a virtual environment. When I can get my hands on a powerful enough computer to run a virtual environment. :e 

I installed FreeBSD 9, and the installer never did install a boot manager like times past. A reboot only gets me into Windows with LILO. I reboot to the FreeBSD DVD, and run `bootconfig` to set up the boot manager. After a reboot, I can boot FreeBSD, but not Windows. I found this thread during the search. To fix the problem I just ran a repair from the Windows 7 DVD. This fixed the problem, and did not cause any others. Windows 7 boots, FreeBSD 9 boots. All is good. Now on to updating and installing packages/ports.

Thanks!


----------

