FreeBSD is an open source operating system derived from the well-known Berkeley Software Distribution (BSD) Software suite. The first version of FreeBSD was released in 1993 and continues to evolve. Around 2007, Lucas Holt wanted to create a branch of FreeBSD using the GnuStep implementation of OpenStep’s (now Cocoa) Objective-C framework, widget toolkit, and application development tools. To that end, he began developing a MidnightBSD desktop distribution.

MidnightBSD (named after Lucas’ cat Midnight) is still being actively (albeit slowly) developed. As of August 2017, the latest stable release (0.8.6) is available. Although the BSD distribution is not what you would call a user-friendly distribution, a hands-on installation is a good way to become familiar with how to handle the Text (Ncurses) installation process and complete the installation from the command line.

This way, you end up with a desktop distribution with a very solid FreeBSD branch. It takes a little effort, but if you’re a Linux user looking to expand your skills… That’s a good place to start.

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

The installation

As I mentioned, this is a text (Ncurses) installation process, so there’s nothing to click on here. Instead, you’ll use your keyboard’s Tab and arrow keys. After you download the latest release, burn it to a CD/DVD or USB drive and start your machine (or create a virtual machine in VirtualBox). The installer will open and give you three options (Figure 1). Use your keyboard’s arrow keys to select “Install” and hit enter.

MidnightBSD installer

Figure 1: starting the MidnightBSD installer.

There are quite a few screens to go through here. Many of these screens are self-explanatory:

  1. Setting non-default keyboard mapping (yes/No)
  2. Setting the Host Name
  3. Add optional system components (documentation, games, 32-bit compatibility, system source code)
  4. Partition the hard Disk
  5. Administrator password
  6. Configuring network Interfaces
  7. Select region (Time zone)
  8. Enabling services (for example, SSH)
  9. Adding a user (Figure 2)
Adding a user

Figure 2: Adding a user to the system.

After you add users to the system, you’ll be taken to a window (Figure 3) where you can handle anything that you might have forgotten to configure or that you’d like to reconfigure. If you do not need to make any changes, select “Exit” and your configuration will be applied.

Applying your configurations

Figure 3: Apply your configuration.

In the next window, when prompted, select “No” and the system will reboot. After the MidnightBSD reboot, you are ready for the next stage of installation.

Post installation stage

When your newly installed NightbSD starts, you will find yourself at the command prompt. At the moment, there is no graphical interface. To install the application, MidnightBSD relies on the MPort tool. Say you want to install an Xfce desktop environment. To do this, log in to MidnightBSD and issue the following command:

sudo mport index
sudo mport install xorg
Copy the code

You have now installed the Xorg window server, which allows you to install the desktop environment. Use the following command to install Xfce:

sudo mport install xfce
Copy the code

Xfce is now installed. However, we must enable it with the command startx. To do this, let’s first install the Nano editor. To issue an order:

sudo mport install nano
Copy the code

With the Nano installed, issue the command:

nano ~/.xinitrc
Copy the code

This file contains only one line:

exec startxfce4
Copy the code

Save and close the file. If you now issue the command startx, the Xfce desktop environment will start. You should feel a little familiar (Figure 4).

Xfce

Figure 4: Xfce desktop interface ready for service.

Because you don’t always want to have to issue the startx command, you want to enable the login daemon. However, it is not installed. To install the subsystem, issue the command:

sudo mport install mlogind
Copy the code

When the installation is complete, enable Mlogind at startup by adding a project to the /etc/rc.conf file. At the bottom of the rc.conf file, add the following:

Mlogind_enable = "YES"Copy the code

Save and close the file. Now, when you start (or restart) the machine, you should see the graphical login screen. At the time of writing this article, I ended up with a blank screen and a pesky X cursor after logging in. Unfortunately, there doesn’t seem to be a solution to this problem. So, to access your desktop environment, you must use the startx command.

Install the application

By default, you won’t find many apps available. If you try to install an application using MPort, you’ll quickly get frustrated because you can only find so few applications. To solve this problem, we need to use the SVNLite command to view the list of available mport software checked out. Go back to the terminal window and issue the command:

svnlite co http://svn.midnightbsd.org/svn/mports/trunk mports
Copy the code

After you’ve done this, you should see a new directory named ~/mports. Use the command CD ~/.mports to change to this directory. Issue the ls command and you should see a number of categories (Figure 5).

applications

Figure 5: Application categories now available to mPort.

Do you want to install Firefox? If you look at the WWW directory, you will see a linux-Firefox list. To issue an order:

sudo mport install linux-firefox
Copy the code

You should now see a Firefox TAB in the Xfce desktop menu. Dig through all the categories and use the mport command to install all the software you need.

A sad warning

A sad little caveat is that the only version of the office suite that MPort can find (via SVNLite) is OpenOffice 3. That’s very old-fashioned. Abiword doesn’t seem to install, although you can find it in the ~/mports/editors directory. Even after OpenOffice 3 is installed, it prints an execution formatting error. In other words, you can’t do much with nightbSD in terms of office productivity. But hey hey, if you happen to have an old Palm Pilot nearby, you can install the Pilot-Link. In other words, there’s not enough software available to make a very useful desktop distribution… At least not for the average user. However, if you want to develop on MidnightBSD, you’ll find plenty of tools available to install (see the ~/mports/devel directory). You can even install Drupal using the following command:

sudo mport install drupal7
Copy the code

Of course, after this, you will need to create a database (MySQL already installed), install Apache (sudo mport install Apache24), and configure the necessary Apache configuration.

Obviously, what is installed and what can be installed is a hodgepodge of applications, systems, and services. But with enough work, you can end up with a release that serves a specific purpose.

Enjoy *BSD excellent

That’s how you get MidnightBSD up and running some kind of useful desktop distribution. It’s not as fast and easy as many other Linux distributions, but if you want a distribution that makes you think, this might be what you’re looking for. While most competitors have plenty of applications ready to install, MidnightBSD is certainly an interesting challenge that Linux enthusiasts or administrators should try.


Via: www.linux.com/learn/intro…

By Jack Wallen (Lujun9972

This article is originally compiled by LCTT and released in Linux China