Dual boot to Windows10 and FreeBSD in UEFI

# install and others reference to install freebsd by zfs, and when we create boot that we follow my method as follows.

mount -t msdosfs /dev/ada0p1 /media # /dev/ada0p1 Windows10's EFI whose size is better 512M

cd /tmp
fetch https://nchc.dl.sourceforge.net/project/refind/0.13.1/refind-bin-0.13.1.zip
unzip refind-bin-0.13.1.zip

cd /media/EFI/Boot
mv bootx64.efi bootx64-windows10.efi
cp /boot/loader.efi bootx64-freebsd.efi
cp -a /tmp/refind-bin-0.13.1/refind/icons .
cp -a /tmp/refind-bin-0.13.1/refind/refind_x64.efi bootx64.efi
cp /tmp/refind-bin-0.13.1/refind/refind.conf-sample refind.conf

# vim refind.conf, append:
menuentry "FreeBSD/amd64 -CURRENT" {
loader \EFI\Boot\bootx64-freebsd.efi
icon \EFI\Boot\icons\os_freebsd.png
}

menuentry "Windows 10 Professional x64" {
loader \EFI\Boot\bootx64-windows10.efi
icon \EFI\Boot\icons\os_win.png
}

# create reFind boot
efibootmgr --create --activate --label "FreeBSD" --loader "/media/EFI/Boot/bootx64.efi"
umount /media
exit
 
Why would anyone want to boot their system with a completely unknown and vague EFI bootmanager which hasn't even left the beta stage? For all I know that thing could do tons of nasty stuff to my setup.

Not to mention that FreeBSD also supports EFI as well as the option to boot other operating systems. ... and the same can be said about the Windows boot manager (see for example programs like 'msconfig').

(edit)

Here, UEFI secure boot: https://freebsdfoundation.org/freebsd-uefi-secure-boot/
 
Why would anyone want to boot their system with a completely unknown and vague EFI bootmanager which hasn't even left the beta stage? For all I know that thing could do tons of nasty stuff to my setup.

Not to mention that FreeBSD also supports EFI as well as the option to boot other operating systems. ... and the same can be said about the Windows boot manager (see for example programs like 'msconfig').

(edit)

Here, UEFI secure boot: https://freebsdfoundation.org/freebsd-uefi-secure-boot/
It's little hard to me. I'm a new studant for FreeBSD. I have made it this far with a lot of effort.?
 
It's little hard to me. I'm a new studant for FreeBSD. I have made it this far with a lot of effort.?
You tried it harder than me. I ended up bought another SSD to install FreeBSD, my current SSD is preserved for Linux and I press F11 each boot to choose the OS I want to boot into ?
 
You tried it harder than me. I ended up bought another SSD to install FreeBSD, my current SSD is preserved for Linux and I press F11 each boot to choose the OS I want to boot into ?
You can try this method, just instead Windows10 with Linux in refind.conf, it should be OK.
 
There's no need to manually create menuentry sections in refind.conf as rEFInd will automatically scan for and detect bootloaders, and in most cases it will even automatically pick an appropriate icon for each one. You can control what drives are scanned for bootloaders by setting up scanfor in refind.conf. Similarly if you want to exclude certain paths from being scanned, you can set up dont_scan_dirs. Just create a directory EFI/FreeBSD and copy /boot/loader.efi to it, and rEFInd will find it automatically. No need to mess with the files in EFI/Boot. If you installed Windows 10, the file EFI/Boot/Bootx64.efi is just a copy of EFI/Microsoft/Boot/bootmgfw.efi, and there's a distinct possibility that Windows updates could eventually replace this file. Instead of replacing EFI/Boot/Bootx64.efi with rEFInd you could set up your UEFI to boot EFI/refind/refind_x64.efi by default.
 
# install and others reference to install freebsd by zfs, and when we create boot that we follow my method as follows.

mount -t msdosfs /dev/ada0p1 /media # /dev/ada0p1 Windows10's EFI whose size is better 512M

cd /tmp
fetch https://nchc.dl.sourceforge.net/project/refind/0.13.1/refind-bin-0.13.1.zip
unzip refind-bin-0.13.1.zip

cd /media/EFI/Boot
mv bootx64.efi bootx64-windows10.efi
cp /boot/loader.efi bootx64-freebsd.efi
cp -a /tmp/refind-bin-0.13.1/refind/icons .
cp -a /tmp/refind-bin-0.13.1/refind/refind_x64.efi bootx64.efi
cp /tmp/refind-bin-0.13.1/refind/refind.conf-sample refind.conf

# vim refind.conf, append:
menuentry "FreeBSD/amd64 -CURRENT" {
loader \EFI\Boot\bootx64-freebsd.efi
icon \EFI\Boot\icons\os_freebsd.png
}

menuentry "Windows 10 Professional x64" {
loader \EFI\Boot\bootx64-windows10.efi
icon \EFI\Boot\icons\os_win.png
}

# create reFind boot
efibootmgr --create --activate --label "FreeBSD" --loader "/media/EFI/Boot/bootx64.efi"
umount /media
exit
It was really helpful for me as a beginner. Thanks a million.
 
Would this be possible in my case as well? As seen I have a big sdd at "/dev/ada0p2". Available: 184gb

I'd like to use 100gb for windows 10. Is that possible? And would I follow the instructions as above?
 

Attachments

  • Screenshot_20250123_152706.png
    Screenshot_20250123_152706.png
    57.2 KB · Views: 92
Any particular reason for that? Dont you loose quite alot of computer power by running in VM compared to utilize the full power by dualbooting?
 
I have about 20 vms each for specialized tasks.

They run on a muscular ESXi host.
Performance has never been a problem.
 
I just setup dual booting on Dell Precision 7530 laptop by installing second NVMe drive.
I installed FreeBSD on that drive keeping Win10 on original drive.
So now in BIOS I have "Windows Boot Manager" and "FreeBSD" for UEFI booting.
With the BIOS you can set which UEFI boot method goes first. So I set "FreeBSD" UEFI entry first then Windows Boot Manager.
That way it boots to FreeBSD but if I want to boot up Windows I have to press F12 Key and specify Windows Boot Manager.
Exactly how I prefer it.

have a big ssd at "/dev/ada0p2"
It gets hairy with a single drive.
 
I played to install FreeBSD and Windows 10 on the same disk (100 GB) on VirtualBox (efi).
First, manual installation of FreeBSD, left about 73 GB for Windows.
Selected to boot on the cd, then installed Windows 10 in the free space.
After that, got Windows to boot on advanced startup in order to start on FreeBSD.
Installed rEFInd, and finally got the dual boot.

That said, as explained above, it's simpler to make the thing on two disks.
And it's complicated to shrink an existing FreeBSD installation (but not impossible).
 
I am pretty sure with single disk you could still use BIOS UEFI menu method.
But hairy as you have to make UEFI menu entries for each EFI file. Windows and FreeBSD.
In Dell BIOS Add UEFI Method> BIOS fs0: drive and navigate to the EFI file for each booting method.(WIN & BSD)
They don't overlap in directory or name so I don't see the problem.
It would be nice if you could force the F12 menu every boot. Some machines this menu is F10,F11.
Most modern machines have this UEFI boot menu.
 
I'm sure this has been answered a million times... I'm just not finding a thread that answers my question.

I want to add a windows 10 dual boot to a running FreeBSD machine on its own 2.5 SSD drive. I'm terrified of running the windows setup and squashing the FreeBSD UEFI boot loader. I have FreeBSD running root from a zpool.

I have a laptop that dual boots but I can't recall the order I install the OS's (FreeBSD and Win10).

Anybody have any advice on if the windows install will destroy my FreeBSD system?
 
Before installing Windows, you can always make a backup of the whole EFI System Partition with dd(1) like this:
Code:
dd if=/dev/gpt/efi of=/home/user/backup-of-efi-partition.img
.

The efibootmgr(8) tool is used for configuring the boot process on UEFI systems. I highly recommend reading its man page and learning how to use it. Comparing the output of efibootmgr -v and the contents of /boot/efi between a system with Windows installed and one without can teach you about how booting Windows works.
 
Anybody have any advice on if the windows install will destroy my FreeBSD system?
If you have any doubts just unhook the FreeBSD drive and install Windows on 2.5" drive. You are using two different EFI directories so nothing to worry about.
May have to rebuild BIOS EFFI menu after installing Windows. It may clear all other EFI boot items. You can get it back easy. Running efibootmgr from USB installer or using BIOS.

Where you might get into trouble is adding second drive back can change drive letters. Disk Labels or my preferred method- serial number in device.hints to lock in drive assignment.
I also had to insert my NVMe's in different slots until I worked it out. BIOS tends to dictate primary device from slot used.
 
You can use efibootmgr to grab the GUID of the FreeBSD EFI partition before you install Windows if you want to do this live.
That will ease rebuilding if needed.

Code:
 Boot0001* FreeBSD HD(1,GPT,7a3bdc82-db3c-11ef-b1ba-3448ed3f87a2,0x28,0x82000)/File(\efi\freebsd\loader.efi)
 Boot0000* Windows Boot Manager HD(1,GPT,38f15ab6-8fb2-4a03-8028-24b63a4dac7f,0x800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)
                                   nda1p1:/EFI/Microsoft/Boot/bootmgfw.efi (null)

This will be used for the BIOS setting for menu (for my machine yours will be different):
1,GPT,7a3bdc82-db3c-11ef-b1ba-3448ed3f87a2,0x28,0x82000)/File(\efi\freebsd\loader.efi

Usually the bios give you the ability to pick filesystem, like: fs:0 but when you have two EFI partitions you will see fs:0 and fs:1 and you need to determine what is what.
Looking at file structure can help. But knowing the GUID will show you the light. Write it down. You may need it.
 
If you have any doubts just unhook the FreeBSD drive and install Windows on 2.5" drive. You are using two different EFI directories so nothing to worry about.
May have to rebuild BIOS EFFI menu after installing Windows. It may clear all other EFI boot items. You can get it back easy. Running efibootmgr from USB installer or using BIOS.

Where you might get into trouble is adding second drive back can change drive letters. Disk Labels or my preferred method- serial number in device.hints to lock in drive assignment.
I also had to insert my NVMe's in different slots until I worked it out. BIOS tends to dictate primary device from slot used.
I'm a Ubuntu install I just did I mounted by id but I'm not using zfs. It's the fact I'm using ( and root is ) zpools worries me since I'm still just a script kiddie.
 
You can use efibootmgr to grab the GUID of the FreeBSD EFI partition before you install Windows if you want to do this live.
That will ease rebuilding if needed.

Code:
 Boot0001* FreeBSD HD(1,GPT,7a3bdc82-db3c-11ef-b1ba-3448ed3f87a2,0x28,0x82000)/File(\efi\freebsd\loader.efi)
 Boot0000* Windows Boot Manager HD(1,GPT,38f15ab6-8fb2-4a03-8028-24b63a4dac7f,0x800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)
                                   nda1p1:/EFI/Microsoft/Boot/bootmgfw.efi (null)

This will be used for the BIOS setting for menu (for my machine yours will be different):
1,GPT,7a3bdc82-db3c-11ef-b1ba-3448ed3f87a2,0x28,0x82000)/File(\efi\freebsd\loader.efi

Usually the bios give you the ability to pick filesystem, like: fs:0 but when you have two EFI partitions you will see fs:0 and fs:1 and you need to determine what is what.
Looking at file structure can help. But knowing the GUID will show you the light. Write it down. You may need it.
I will record my efi info

Maybe I should wipe my laptop and do a practice run. It only has one ssd though. It has separate efi's in the same partition but I can't remember if I did window first.
 
Back
Top