Installing and dual-booting Debian GNU/kFreeBSD

Now that Debian GNU/kFreeBSD is an official part of Debian, it is time to play around with the new toy. But in order to do such feat there are several issues that have to be resolved on the path to success. Assuming you use Debian GNU/Linux with GRUB2 (as seen in testing and unstable these days) and have a spare partition or two you can try it out on live hardware instead of an emulator.

Installing Debian GNU/kFreeBSD

  1. Use the Debian-Installer (D-I) monolithic images available at, and make a network install.
  2. The installer image uses GRUB2 instead of syslinux (for obvious reasons), thus you cannot set debconf priority before booting into D-I.
  3. Because Debian GNU/kFreeBSD is broken in testing as of this writing, you’ll need necessarily to set debconf priority to medium in D-I in order to install unstable a.k.a. Sid.
  4. Setting debconf priority is easy. The first installer prompt will ask for the language you want to use for installation. Don’t select a language, instead tab to the “Go Back” button, exit to D-I’s main menu, set debconf priority to medium and start again from the top.
  5. When selecting a mirror, select unstable as the distribution to install.
  6. When partitioning, you may create or use an already existing primary or logical partition, but the FreeBSD kernel will be happier if you use a primary partition.
  7. Do not, I repeat, do not install software. Skip this step. Aptitude is foobar today and perhaps for sometime yet. Read the report to learn how a bug report is written. Use apt-get by hand instead.
  8. Finish the install without installing GRUB2, The package in Sid is somewhat broken (or bug fixed, whichever you choose to believe) and refuses to install on UFS filesystems and will insist on installing on the MBR. Skip it. We will be using the GUB2 installed in the MBR by our Debian GNU/Linux install.

Dual booting Debian GNU/kFreeBSD

This is where all the advice on creating a boot entry for GRUB2 out there in the intarwebs is wrong. Why? Because kFreeBSD has been repackaged to match the packaging of Linux. So in order to boot Debian GNU/kFreeBSD from our main GRUB2 install, we need to add the following to /etc/grub.d/40_custom:

menuentry "Debian GNU/kFreeBSD" {
    insmod ufs2
    set root=(hd0,3)
    kfreebsd /boot/kfreebsd-8-0-1-686.gz
    #kfreebsd_module_elf /lib/modules/8.0-1-686/acpi.ko #not necessary, statically linked
    set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ad0s3
    set kFreeBSD.vfs.root.mountfrom.options=rw


And run update-grub. Obviously that’s the set up in my box and it won’t work as is in yours. If you can’t find that information on your own, oh well.