TranslateProject/sources/tech/20180511 MidnightBSD Could Be Your Gateway to FreeBSD.md

9.2 KiB
Raw Blame History

MidnightBSD Could Be Your Gateway to FreeBSD

FreeBSD is an open source operating system that descended from the famous Berkeley Software Distribution. The first version of FreeBSD was released in 1993 and is still going strong. Around 2007, Lucas Holt wanted to create a fork of FreeBSD that made use of the GnuStep implementation of the OpenStep (now Cocoa) Objective-C frameworks, widget toolkit, and application development tools. To that end, he began development of the MidnightBSD desktop distribution.

MidnightBSD (named after Lucass cat, Midnight) is still in active (albeit slow) development. The latest stable release (0.8.6) has been available since August, 2017. Although the BSD distributions arent what you might call user-friendly, getting up to speed on their installation is a great way to familiarize yourself with how to deal with an ncurses installation and with finalizing an install via the command line.

In the end, youll wind up with desktop distribution of a very reliable fork of FreeBSD. Itll take a bit of work, but if youre a Linux user looking to stretch your skills… this is a good place to start.

I want to walk you through the process of installing MidnightBSD, how to add a graphical desktop environment, and then how to install applications.

Installation

As I mentioned, this is an ncurses installation process, so there is no point-and-click to be found. Instead, youll be using your keyboard Tab and arrow keys. Once youve downloaded the latest release, burn it to a CD/DVD or USB drive and boot your machine (or create a virtual machine in VirtualBox). The installer will open and give you three options (Figure 1). Select Install (using your keyboard arrow keys) and hit Enter.

MidnightBSD installer

Figure 1: Launching the MidnightBSD installer.

Used with permission

At this point, there are quite a lot of screens to go through. Many of those screens are self-explanatory:

  1. Set non-default key mapping (yes/no)

  2. Set hostname

  3. Add optional system components (documentation, games, 32-bit compatibility, system source code)

  4. Partitioning hard drive

  5. Administrator password

  6. Configure networking interface

  7. Select region (for timezone)

  8. Enable services (such as secure shell)

  9. Add users (Figure 2)

Adding a user

Figure 2: Adding a user to the system.

Used with permission

After youve added the user(s) to the system, you will then be dropped to a window (Figure 3), where you can take care of anything you might have missed or you want to re-configure. If you dont need to make any changes, select Exit, and your configurations will be applied.

In the next window, when prompted, select No, and the system will reboot. Once MidnightBSD reboots, youre ready for the next phase of the installation.

Post install

When your newly installed MidnightBSD boots, youll find yourself at a command prompt. At this point, there is no graphical interface to be found. To install applications, MidnightBSD relies on the mport tool. Lets say you want to install the Xfce desktop environment. To do this, log into MidnightBSD and issue the following commands:

sudo mport index

sudo mport install xorg

You now have the Xorg window server installed, which will allow you to install the desktop environment. Installing Xfce is handled with the command:

sudo mport install xfce

Xfce is now installed. However, we must enable it to run with the command startx. To do this, lets first install the nano editor. Issue the command:

sudo mport install nano

With nano installed, issue the command:

nano ~/.xinitrc

That file need only contain a single line:

exec startxfce4

Save and close that file. If you now issue the command startx, the Xfce desktop environment will start. You should start to feel a bit more at home (Figure 4).

 Xfce

Figure 4: The Xfce desktop interface is ready to serve.

Used with permission

Since you dont want to always have to issue the command startx, youll want to enable the login daemon. However, its not installed. To install this subsystem, issue the command:

sudo mport install mlogind

When the installation completes, enable mlogind at boot by adding an entry to the /etc/rc.conf file. At the bottom of the rc.conf file, add the following:

mlogind_enable=”YES”

Save and close that file. Now, when you boot (or reboot) the machine, you should be greeted by the graphical login screen. At the time of writing, after logging in, I wound up with a blank screen and the dreaded X cursor. Unfortunately, it seems theres no fix for this at the moment. So, to gain access to your desktop environment, you must make use of the startx command.

Installing

Out of the box, you wont find much in the way of applications. If you attempt to install applications (using mport), youll quickly find yourself frustrated, as very few applications can be found. To get around this, we need to check out the list of available mport software, using the svnlite command. Go back to the terminal window and issue the command:

svnlite co http://svn.midnightbsd.org/svn/mports/trunk mports

Once you do that, you should see a new directory named ~/mports. Change into that directory (with the command cd ~/.mports. Issue the ls command and you should see a number of categories (Figure 5).

applications

Figure 5: The categories of applications now available for mport.

Used with permission

Say you want to install Firefox? If you look in the www directory, youll see a listing for linux-firefox. Issue the command:

sudo mport install linux-firefox

You should now see an entry for Firefox in the Xfce desktop menu. Go through all of the categories and install all of the software you need, using the mport command.

A sad caveat

One sad little caveat is that the only version of an office suite to be found for mport (via svnlite) is OpenOffice 3. Thats quite out of date. And although Abiword is found in the ~/mports/editors directory, it seems its not available for installation. Even after installing OpenOffice 3, it errors out with an Exec format error. In other words, you wont be doing much in the way of office productivity with MidnightBSD. But, hey, if you have an old Palm Pilot lying around, you can always install pilot-link. In other words, the available software doesnt make for an incredibly useful desktop distribution… at least not for the average user. However, if you want to develop on MidnightBSD, youll find plenty of available tools, ready to install (check out the ~/mports/devel directory). You could even install Drupal with the command:

sudo mport install drupal7

Of course, after that youll need to create a database (MySQL is already installed), install Apache (sudo mport install apache24) and configure the necessary Apache directives.

Clearly, what is installed and what can be installed is a bit of a hodgepodge of applications, systems, and servers. But with enough work, you could wind up with a distribution that could serve a specific purpose.

Enjoy the *BSD Goodness

And that is how you can get MidnightBSD up and running into a somewhat useful desktop distribution. Its not as quick and easy as many other Linux distributions, but if you want a distribution thatll make you think, this could be exactly what youre looking for. Although much of the competition has quite a bit more available software titles ready for installation, MidnightBSD is certainly an interesting challenge that every Linux enthusiast or admin should try.

Learn more about Linux through the free "Introduction to Linux" course from The Linux Foundation and edX.


via: https://www.linux.com/learn/intro-to-linux/2018/5/midnightbsd-could-be-your-gateway-freebsd

作者:Jack Wallen 选题:lujun9972 译者:译者ID 校对:校对者ID

本文由 LCTT 原创编译,Linux中国 荣誉推出