MidnightBSD 4.0: A Fresh Take on BSD Excellence

MidnightBSD 4.0: A Fresh Take on BSD Excellence

MidnightBSD 4.0: A Fresh Take on BSD Excellence

Table of contents:-
What's New

Installation Guide

Advanced Features

Bonus: Setting Up Your Graphical Desktop

Hello, fellow tech enthusiasts! If you're dipping your toes into the world of open-source operating systems or you're a seasoned BSD aficionado looking for the next evolution, MidnightBSD 4.0 might just pique your interest. This release builds on the solid foundations of its predecessors, blending reliability with modern enhancements that make it a joy to explore. Today, we're diving into a comprehensive overview, keeping things friendly and educational as we unpack what makes this version tick. Whether you're curious about kernel tweaks, userland improvements, or how to get it running on your machine, we've got you covered—all drawn from the official wellsprings of knowledge to ensure accuracy and depth.


Now, let's roll up our sleeves and get into the heart of it. MidnightBSD has always carved out a niche as a desktop-friendly BSD derivative, drawing heavily from FreeBSD while adding its own flair. Version 4.0, available for amd64 and i386 architectures, represents a significant step forward, incorporating a slew of updates from FreeBSD 13.x branches. It's not just about bug fixes—though there are plenty of those—but about refining the system for better performance, security, and usability. Imagine a OS that's stable enough for servers yet approachable for everyday computing; that's the vibe here.


One of the standout aspects is the upgrade to third-party libraries, which brings fresh capabilities but might require a bit of housekeeping if you're coming from older versions. Compatibility could be an issue with legacy mports or packages, so it's wise to plan your migration carefully. On the package front, both mports and Ravenports are supported on amd64, giving you flexibility in how you manage software. This release also packs in security updates and a host of improvements that make the system feel more polished and responsive.


What's New

Diving deeper, the kernel in MidnightBSD 4.0 has seen some exciting overhauls. For starters, there's better support for enforcing a W^X memory mapping policy for user processes, which is a fancy way of saying it helps prevent certain types of exploits by separating writable and executable memory pages. It's not enabled by default, but you can tweak it via sysctls like kern.elf32.allow_wx and kern.elf64.allow_wx—set them to zero for stricter enforcement. If you have binaries that need an exemption, tools like elfctl come to the rescue with a wxneeded feature. This is particularly educational for those interested in system security; it underscores how BSD systems prioritise robust protections without overwhelming the user.


On the networking side, there's a lot to cheer about. The TCP stack now includes Proportional Rate Reduction, aligned with RFC 6937, which improves congestion control during packet loss recovery. It's on by default, but if you're tinkering, you can disable it with net.inet.tcp.do_prr. There's also a conservative variant via another sysctl, making it adaptable to different network scenarios. SCTP has been modularised into sctp.ko, no longer baked into the GENERIC kernel, which slims things down for those who don't need it. IPv4 and IPv6 handling has been refined, with fixes for route expiration, duplicate alias routes, and even stacked VLAN support for 802.1ad. If you're into high-performance networking, the addition of custom route lookup algorithms, including those based on DPDK librte for large tables, could be a game-changer.


Hardware support has leveled up too. New drivers like axp for AMD EPYC 10G Ethernet controllers and iwlwifi for newer Intel wireless chipsets mean broader compatibility out of the box. Intel Speed Shift joins the cpufreq family, optimising power and performance on supported CPUs. For storage enthusiasts, NFS advancements are plentiful: full support for NFSv4.2 and Extended Attributes per RFCs 7862 and 8276, plus options for multiple TCP connections with the nconnect mount flag—up to 16 for better throughput. The NFS server can now handle more than 16 groups in exports, and there's even NFS over TLS for encrypted transfers, though it requires specific build options like WITH_OPENSSL_KTLS.


Virtualisation fans will appreciate updates to bhyve, MidnightBSD's hypervisor. It now supports additional serial ports (COM3 and COM4), VirtIO-9p for file sharing, and even VM snapshots in a developmental stage. Reliability with VNC clients has improved, and you can push beyond 16 vCPUs with hw.vmm.maxcpu tweaks. On the filesystem front, ZFS comes courtesy of OpenZFS, ensuring top-tier data integrity and features like auto-decryption via the new zfskeys service. The fusefs has been bumped to version 7.28, adding support for operations like FUSE_COPY_FILE_RANGE and FUSE_LSEEK, which enhance file handling efficiency.


Userland changes are equally lively. The mport package manager hits version 2.7.3 with enhancements like better terminal colour handling—and fixes for segmentation faults in commands like mport add. The verify command now checks single ports and can repair checksums with a -r flag, which is handy for spotting tampered files or manager glitches. Installation behaviour has shifted: mport install now pulls in dependencies automatically, while mport_install_single retains the old manual approach. Upgrades detect packages with matching origins, and user messages have been spruced up for clarity. Small memory leaks? Squashed. These tweaks make managing software feel more intuitive and less error-prone.


Elsewhere in userland, tools like calendar now handle nested C pre-processor conditionals and C++ comments, printing dates in your locale for that personal touch. Daemon supports a -H flag for reopening output files on SIGHUP, perfect for log rotation with newsyslog. Devd reports kernel events on system resume, and diskinfo shows physical device names if available. Gone are outdated bits like libdispatch from base, a.out executable support on i386, and the old GNU debugger—modern GDB from mports takes its place. BSD grep is the default, ditching the GNU variant, and amd automount daemon has been replaced by autofs for better integration.


System calls have expanded too: copy_file_range for efficient file copies, even leveraging NFSv4.2 server-side magic, and aio_readv/aio_writev for vectored asynchronous I/O. Regex handling in libraries like regex no longer tolerates redundant escapes, which might affect scripts in sed or grep— a good reminder to review your code. Processes in jails now rebase their CPU sets properly, and superusers can widen masks as needed. The kernel's Safe Memory Reclamation (SMR) boosts scalability on multi-core beasts, particularly in VM and VFS subsystems.


For those into debugging and monitoring, netgdb allows network-based kernel debugging, and backlight support joins the fray. VirtIO drivers align with the V1 spec, and pvscsi caters to VMware para-virtualised SCSI. The mbuf type for unmapped pages optimises sendfile, reducing overhead in data transfers. Ping has merged with ping6 for unified IPv4/IPv6 handling, and it supports QoS markings like DSCP and PCP—useful for prioritising traffic in mixed environments.


Security gets a thorough refresh. The crypto framework has been overhauled, ditching deprecated algorithms in Kerberos, GSS, and IPsec. Aesni is now in GENERIC for hardware-accelerated encryption, and KTLS extends to TLS 1.0 through 1.3 for offloaded crypto. Certificate authorities have been updated, and Heimdal Kerberos fixes bolster authentication. New daemons like rpc.tlsclntd and rpc.tlsservd handle NFS-over-TLS, with optional X.509 cert verification.


Third-party software updates round out the picture: libarchive to 3.8.1 for better archiving, xz to 5.8.1 for compression prowess, and LLVM to 19.1 for compiling muscle. Deprecations include OPIE authentication, certain serial drivers, and tools like mergemaster—etcupdate is the way forward. Libtacplus has been refined with POSIX shell syntax in tacplus.conf, potentially requiring config tweaks if secrets weren't quoted.


All these changes make MidnightBSD 4.0 feel vibrant and forward-looking, balancing tradition with innovation. It's educational to see how each tweak addresses real-world needs, from scalability in high-core systems to efficient networking in virtualised setups.


Installation Guide

Getting MidnightBSD 4.0 up and running is an adventure in itself, especially if you're new to BSD installations. It's geared towards users with some NIX experience, but don't worry—we'll walk through it step by step in a way that's approachable and fun. First things first: preparation is key. Head to the official FTP server or mirrors to grab the ISO or USB image—disk 1 is essential. You'll need a few gigabytes of free space, but aim for at least 15GB if you're planning a desktop setup with lots of software. Hardware-wise, an Intel Pentium or equivalent does the trick, with at least 96MB of RAM for the install process. Support for older 486 chips is possible but requires custom compilation.


For hardware compatibility, MidnightBSD shines on a variety of systems. Think AMD Ryzen 7900 setups with MSI B650 boards, where SATA and NVMe work seamlessly, though wired LAN might need a driver from mports. Intel 14700K with Asus ROG Strix Z790? Expect solid SATA, NVMe, and wired LAN support, with Wi-Fi joining the party in 4.0. Servers like HPE DL360 Gen9 handle basic functions well, albeit without power management due to BIOS quirks. Laptops such as the Framework 13 (11th or 12th gen) offer partial support—framebuffer graphics work, Wi-Fi is operational, but trackpads and power management have room for improvement; try hwpstate for better efficiency.


Lenovo ThinkPad A485 users will find sound, trackpad, and NIC reliable, with AMD graphics acceleration via mports firmware in 4.0. HP Victus gaming laptops with i7 and RTX 3060 get partial nods, though Wi-Fi and trackpad issues persist without tweaks. Older rigs like HP Z420 or Dell Precision workstations hum along nicely, especially with NVIDIA drivers from mports for cards like 710GT or 1080ti. Virtualisation is a breeze on VMWare, VirtualBox, qemu, or Parallels, with some caveats like CDROM handling in older versions.


Dual-booting? For UEFI, it plays nice with Windows or Linux using GRUB 2, Windows' manager (with customisation), or rEFInd for elegance. On legacy BIOS, GRUB from Linux or Windows XP/Vista managers work, or third-party options like GAG. Burning the media: Use tools like LiquidCD on Mac, InfraRecorder on Windows, or dd for USB flashes—sudo dd if=imagefilename of=/dev/yourusbdev gets it done.


Now, the installation proper. Boot from your CD or USB—tap into BIOS if needed (F2, Del, or boot keys like F12). You'll see a red and blue screen post-text; if it hangs, it might be a bug or incompatibility worth reporting. The installer is bsdinstall, a text-based user interface (TUI) that's straightforward once you get the hang of it.


TUI Installation and Using mports

The TUI installation is where the magic happens—it's a text-based affair that's efficient and educational, teaching you about partitioning and configuration without graphical fluff. Launch bsdinstall, and you'll navigate menus with arrow keys and Enter. Start by selecting your keymap and hostname. Then, partitioning: Choose auto for simplicity or manual for custom setups. It supports various disk names, and if you pick DEFAULT or skip, it auto-selects. For UEFI, ensure an EFI partition; the installer handles ESP mounting as MS-DOS and copies boot files like bootx64.efi.


Next, set your root password and add users—strong passwords are a must! Network configuration follows: Pick interfaces, configure IPv4/IPv6, or DHCP for ease. Time zone selection ensures your clocks tick right. Services to enable: SSH for remote access, NTP for time sync, and perhaps dumpdev for crash dumps. The installer pulls packages if connected, but you can skip to post-install tweaks.

Boot Menu (Live System)

Welcome Menu

Keymap Selection

Set Hostname

Distribution Select

Partitioning

ZFS Configuration (1)

ZFS Configuration (2)

ZFS Configuration (3)

ZFS Configuration (4)

Archive Extraction

New Root Password

Network Configuration (1)

Network Configuration (2)

Network Configuration (3)

Network Configuration (4)

Network Configuration (5)

Time Zone Selection

Countries in Europe (Selection)

Countries in Europe (Confirmation)

Time & Date

System Configuration

System Hardening

To Add User(s)

Added User

Final Configuration

Manual Configuration

VirtualBox VM Shutdown (`shutdown -p now`)

Once installed, reboot, run the MidnightBSD FirstBoot Configuration utility and log in.

Reboot

The MidnightBSD FirstBoot Configuration utility (1)

The MidnightBSD FirstBoot Configuration utility (2)

Now, enter mports, MidnightBSD's package powerhouse for software management. It's integrated and user-friendly. To fetch the index: `mport index`. Install a package: `mport install packagename`—it now grabs dependencies automatically for hassle-free setup. For single installs without deps, use mport_install_single. Upgrading? `mport upgrade` handles everything, detecting origin matches and improving messages. Verify integrity with `mport verify`, or repair with -r if checksums are off—great for security checks.

Login As Normal User

`mport` Manual Pages

Running `doas mport install bsdfetch`

Running `bsdfetch`

Running `zpool status`, `zpool list` and `zfs list`

Running `top`

Updating the OS core? Use `svnlite` (in base since 0.6) to checkout the stable branch: svnlite checkout https://svn.midnightbsd.org/svn/midnightbsd/stable/4.0 /usr/src. Then build: make buildworld buildkernel, installkernel, reboot, then installworld. Merge configs with etcupdate. For packages, `mport clean` and upgrade keep things fresh. Firmware for hardware like AMD graphics or NVIDIA drivers? Search mports—e.g., for Radeon HD 7450 acceleration, it's right there.


This TUI and mports combo makes installation and maintenance lively and empowering, turning what could be a chore into a learning experience.


Post-install, explore system administration. Tools like camcontrol now use realpath for symlinks, and md5sum offers Linux-compatible -r options. Kdump decodes Linux syscalls, and killall targets pts processes with -t. ASLR is on for 64-bit executables, bolstering security—disable if needed with proccontrol. For jails, NFS in vnet works with allow.nfsd. Zfsd faults slow disks, and pf can filter local packets optionally.


Advanced Features

Venturing further, MidnightBSD 4.0's advanced bits are a treasure trove for tinkerers. Linux compatibility shines with 64-bit ABI saving FP states on signals and near-complete vDSO support. Sysdecode and kdump handle Linux-style tracing, and pthread aligns with Linux semantics—ideal for running binaries without fuss.


Boot loader enhancements make starting up smoother: efibootmgr supports new flags like -b for bootnum, and UEFI detection is more robust. Performance boosts and teken colour fixes add polish. Crash dumps now work on SD/eMMC via dwmmc and sdhci with MMCCAM. For developers, netlink for RFC 3549 config and radix tables in ipfw offer fine-grained control.


Removed features like nand framework, GEOM_SCHED, and ctm streamline the system—replacements are in mports. Deprecations signal progress: VINUM gives way to modern storage, and legacy sound drivers fade out. Libcapsicum caches time zones for speed, and ng_ipfw supports 32-bit cookies.


In virtual environments, mgb driver for Microchip LAN7430 Ethernet and iovec fixes in bhyve enhance guest performance. PCI HDAudio and NVMe 1.4 support broaden hardware options. Kernel workarounds for Intel page invalidations on UFS/MSDOSFS prevent hiccups on Alder/Raptor Lake chips.


Networking refinements include increased ARP/NDP queues to 16 packets, and interface fib checks for proxyarp. Net.fibs dynamically adjusts fib count, and net.add_addr_allfibs defaults to zero for efficiency. IPv6 routes are RTF_PINNED, and rtsol adds -i by default.


Tools like chroot support unprivileged -n operation, and bsdinstall's scripted editor handles variant disks. Mpsutil shows adapter info and controls NCQ, while pciconf decodes ACS capabilities. Procstat prints advisory locks, and uuidgen generates random v4 with -r.


Security periodic output is trimmed, controllable via rc.conf. Service umasks are settable, and head/tail handle SI suffixes consistently. Tftpd allows chroot writes on non-writable files with -S. Syskrb5 enables Kerberized NFS without TGTs.


All this weaves into a system that's not just functional but inspiring, encouraging experimentation while maintaining BSD's rock-solid ethos.


Bonus: Setting Up Your Graphical Desktop

If you've got MidnightBSD 4.0 installed and humming along in text mode, you might be itching to add a splash of graphical flair to your setup. Fear not—transforming your system into a proper desktop environment is straightforward and rewarding, especially with tools like Xorg for the underlying display server, mlogind as your login manager, and WindowMaker as a lightweight, elegant window manager. This combination keeps things nimble yet functional, perfect for users who appreciate BSD's efficiency without the bloat of heavier desktops. We'll walk through the installation and configuration steps, drawing on official guidance to ensure everything runs smoothly. Remember, these packages come via mports, so make sure your package index is up to date with `mport index` before diving in.


Start with Xorg, the backbone of your graphical interface. As root or using doas for privilege escalation, simply run `doas mport install xorg`. This pulls in the X Window System essentials, including servers, libraries, and fonts. If you prefer building from source for customisation, navigate to `/usr/mports/x11/xorg` and execute `doas make install clean`. Once installed, you can test it from the console with `startx`—if you're using tcsh as your shell, run `rehash` first to refresh your command cache. To gracefully exit Xorg sessions, enable the classic Ctrl+Alt+Backspace kill switch by opening an xterm within X and typing `setxkbmap -option terminate:ctrl_alt_bksp`. This setup provides a solid foundation, handling display rendering and input devices with aplomb.


Next up is mlogind, MidnightBSD's default graphical login manager since version 2.1, which is a customised fork of the slim login manager. It's lightweight and gets you from boot to desktop without fuss. Install it with `doas mport install mlogind`, or if building manually, head to `/usr/mports/x11/mlogind` and run `doas make install clean`. To have it start automatically on boot, edit your `/etc/rc.conf` file (as root) and add the line `mlogind_enable="YES"`. Save the changes, then reboot your system or start the service manually with `service mlogind start`. Upon restart, you'll be greeted by mlogind's login screen, where you can enter your credentials and select a session. It's a seamless way to bypass manual `startx` invocations, making your machine feel more like a ready-to-use desktop.


For the window manager itself, WindowMaker offers a nostalgic yet efficient NeXTSTEP-inspired interface that's easy on resources. Install the core package via `doas mport install windowmaker`. If you'd like extras like the wdm display manager and additional apps, opt for `doas mport install windowmaker-desktop` instead—or build it from `/usr/mports/x11/windowmaker-desktop` with `doas make install clean`. WindowMaker integrates nicely; on MidnightBSD versions 2.1 and later (including 4.0), new user accounts automatically receive a default `.xinitrc` file in their home directory that launches WindowMaker if it's installed. If you need to set this up manually, create or edit `~/.xinitrc` and add `exec wmaker` at the end. This tells Xorg to start WindowMaker upon login. For even more polish, consider adding GNUstep with `doas mport install gnustep` and optionally `doas mport install gnustep-app` for a suite of compatible applications.


A handy tip: if you're fresh from installation, MidnightBSD's firstboot script might pop up on your initial boot, offering to set up a graphical desktop. Simply answer yes when prompted, and it'll handle much of the heavy lifting, including package installation. If you've already passed that stage or want to rerun it, delete `/etc/fbreciept` and trigger it with `service firstboot start`.

Running `firstboot script` (1)

Running `firstboot script` (2)

Login (Normal User)

Otherwise if that fails, the manual route we've outlined gives you full control.

Manual Route (1)

Manual Route (2)

Manual Route (3)

Once everything's in place, reboot, log in via mlogind, and enjoy your new graphical realm—tweak themes in WindowMaker's preferences for that personal touch, and explore mports for browsers, editors, and more to round out your setup. This graphical layer unlocks MidnightBSD's potential as a versatile desktop OS, blending stability with visual appeal in true BSD fashion.

mlogind (normal username)

mlogind (normal user password)

WindowMaker (Menu)

WindowMaker (`doas mport install neofetch` - xterm)

WindowMaker (`neofetch` - xterm)

WindowMaker (Information)

WindowMaker (`top` - xterm)

WindowMaker (`doas mport install lynx` - xterm)

WindowMaker (`lynx` - xterm)

In conclusion, MidnightBSD 4.0 stands as a testament to thoughtful evolution in the open-source realm. It refines the BSD experience with modern touches, making it accessible yet powerful for desktops and beyond. Whether you're upgrading or trying it fresh, the blend of stability, features, and community-driven polish is sure to delight.


Disclaimer: All trade names and trademarks mentioned, including MidnightBSD and associated entities, are acknowledged as the property of their respective owners. At The Distrowrite Project, we strive for utmost accuracy in our content, drawing solely from official sources. We strongly advise backing up important data before any system changes and encourage responsible, legal use of open-source software to foster a positive ecosystem.


References:  

- MidnightBSD 4.0 Release Notes  

- MidnightBSD Documentation  


😺

Comments

Popular Posts