# Can bootmgr or the Standard boot loader boot up Vista on a different slice?



## Allamgir (Dec 30, 2009)

I'm about to install FreeBSD again and finally give it a real chance on my system (I've been giving up way too soon), but I need to dual boot it with Windows Vista *shudder*. Lots of people suggest using the Vista boot loader and configuring it with EasyBCD, but I'd really prefer if I never had to cross any part of Windows to get to FreeBSD. During the FreeBSD install process, it asks me if I want to install Bootmgr, the Standard boot loader, or none. Normally, I choose none so I can use the Vista boot loader, but can bootmgr or the "Standard" boot loader get Vista up? Is it as easy as configuring a bootmgr.conf file or something, or is it not even possible with these tools.

What would you guys recommend to dual boot FreeBSD and Vista but completely circumvent any Windows software (unless I decide to boot Vista myself)?


Thanks,
Allamgir


----------



## blstuart (Jan 4, 2010)

On my HP laptop, I did basically that, but it took some searching before finding the magic incantation.  The trick is to set the Vista boot configuration to not worry about exact UUIDs.  In particular, the commands:


```
bcdedit/set {bootmgr} device boot
bcdedit/set {default} device boot
bcdedit/set {default} osdev boot
```

made it happy being started with the FreeBSD boot loader.  I also have the line:


```
bcdedit/enum
```

in my notes, but I think that just reports and doesn't set anything.  I got the details from a MS kb message:

http://support.microsoft.com/kb/927391

Good luck.


----------



## J65nko (Jan 4, 2010)

Shouldn't too much different from multibooting OpenBSD 4.4 through Vista's boot manager


----------



## Agi93 (Jan 4, 2010)

Hi blstuart! I have the exact same question as allamgir, so it's great to see it's possible. I already have freebsd installed, though, and I can't figure out how to install bootmgr from sysinstall without wiping my system out. Is this possible? I chose to not touch the Mbr, so now I have the same mbr windows put in, but with FreeBSD as the active partition. I was considering making Vista the active partition, then booting it and running those commands, then making Freebsd the active partition, then installing its bootmgr and setting it up to work with Vista. But I still can't find how to install bootmgr from an already installed freebsd system. How do I do this?

Thanks,
Agi93


----------



## aragon (Jan 4, 2010)

Allamgir said:
			
		

> can bootmgr or the "Standard" boot loader get Vista up?


The boot manager (called boot0) should do what you want.  The standard MBR will not. (it's functionally the same as the windows MBR that is already on your drive)



			
				Allamgir said:
			
		

> Is it as easy as configuring a bootmgr.conf file or something


It's as easy as having your OSes in primary partitions.  boot0 gets most of its configuration from your drive's partition table.  Minor tweaks can be setup with boot0cfg(8) after installation.


----------



## aragon (Jan 4, 2010)

Agi93 said:
			
		

> But I still can't find how to install bootmgr from an already installed freebsd system. How do I do this?


boot0cfg(8)


```
boot0cfg -B <disk>
```


----------



## Agi93 (Jan 5, 2010)

Beautiful! It all worked perfectly! Now I have bootmgr offering to boot Windows or FreeBSD with the F keys and defaulting on FreeBSD after 40 ticks (a little more than 2 seconds)

Here's what I did:

First, if you left your MBR untouched during FreeBSD install and now have a simple MBR booting into FreeBSD, you need to get the GParted Live CD, make one, and boot it. Then, find your Windows Vista slice, right click it, click "Manage Flags" or similar, and select the checkbox "boot". Click OK and it should be good. Reboot, and Windows Vista should come up nice and happy. Log in as the administrator and run cmd.exe as Administrator (by searching cmd in the start menu, then right clicking it and clicking "Run as Administrator").

Run the following commands:


```
bcdedit/set {bootmgr} device boot
bcdedit/set {default} device boot
bcdedit/set {default} osdevice boot
```
Notice that I changed blstuart's "osdev" to "osdevice". This is how it worked on my system.


Then, reboot with the GParted Live CD again, and mark the FreeBSD slice with the boot flag. Reboot (the disc will come out), and you should boot into FreeBSD. Now, log in as root and run the command to install boot0. This is the command I ran, but please check the boot0cfg man page to set the options to your liking.

[cmd=]boot0cfg -Bv -s 3 -t 40 -m 6 ad4[/cmd]

boot0cfg -Bv installs the bootloader. I wanted slice 3 (my FreeBSD slice) to boot as the default, so I put -s 3. -t 40 sets the delay to 40 ticks (one second is about 18.2 ticks), and -m 6 only makes slices 2 and 3 active (I had to do some googling on how this worked. See http://www.mail-archive.com/freebsd-questions@freebsd.org/msg223349.html). ad4 is _my_ disk's name, so substitute that with your disk.

That should complete in about a tenth of a second.

Reboot. You should now have a very plain menu that looks something (maybe not exactly) like:


```
F2: Win
F3: FreeBSD

F6: PX6 [i]or something like that[/i]
```

Enjoy!



Should I post something like this in the HOWTO/FAQ section of the forums? I've been searching for this answer for a while and it may help someone else.


----------



## DutchDaemon (Jan 5, 2010)

If you can manage to write it up in a way that 'the average user' would understand, be my guest! See the Sticky in the HowTo forum.


----------



## blstuart (Jan 5, 2010)

Agi93 said:
			
		

> Run the following commands:
> 
> 
> ```
> ...



I went back and checked my notes.  One place I had it written down as osdev and another as osdevice.  I suspect the latter is correct and my earlier post was in error.

Glad to hear you've got it working.


----------



## desnudopenguino (Jan 6, 2010)

I tried this with windows 7.  For some reason it didn't work for me. It boots fine into FreeBSD (8.0), and it tries to boot into windows when I select it, but it says that the boot loader can't be found (the windows one that is).  Any ideas?


----------



## Agi93 (Jan 7, 2010)

Then Microsoft must have changed the windows 7 bootloader. I know it's at something like \windows\winload.exe (although I'm not even 100% sure of that). You should probably just go with blstuart's method of checking the Microsoft knowledge base for the solution to that error, and that might point you in the right direction. 


Good luck! I hope you find out how to do this on windows 7. Post back if you find a solution.


----------



## aragon (Jan 7, 2010)

desnudopenguino said:
			
		

> I tried this with windows 7.  For some reason it didn't work for me. It boots fine into FreeBSD (8.0), and it tries to boot into windows when I select it, but it says that the boot loader can't be found (the windows one that is).  Any ideas?


I'm curious to know where that error message is emanating.  Can you paste it verbatim please?


----------



## desnudopenguino (Jan 7, 2010)

```
BOOTMGR is missing
Press Ctrl+Alt+Del to restart
```

Any ideas of what might be the problem?  I tried EasyBCD, GAG, and Boot0, all with the same results (well with EasyBCD windows didn't like trying to boot to bsd for some reason, but it's not supported by Windows 7 so that's probably why it's being buggy).


----------



## aragon (Jan 7, 2010)

That error message is not from boot0, that's for sure.  Looks like it's not an uncommon problem either.  Have you tried google?

http://www.howtogeek.com/howto/wind...ing-error-while-trying-to-boot-windows-vista/
http://www.howtogeek.com/forum/topic/windows-7-bootmgr-missing


----------



## desnudopenguino (Jan 7, 2010)

hmm true, I shall consult the google since i'm now sure it's not a BSD issue.  I'll get back with the results for any future references.


----------



## desnudopenguino (Jan 8, 2010)

Okay... Here's what I've found.  

1. Install Windows 7
2. Install FreeBSD 8.0 with the bsdloader
3. It worked
4. boot0cfg -m 5 (for f1 win and f3 bsd)

I'm thinking all my other experiments to get dual booting just messed everything up in the mbr.  

It's all working fine now, and without any confusing 3rd party stuff floating around.  Hooray FreeBSD!


----------

