1. Identifying Your Computer:

 

Determine if your computer has a 32-bit or 64-bit processor. Finding this information will depend on your operating system, so go to the relevant section below:

macOS:

 

Click the Apple symbol at the top left of your display. Select “About This Mac” from the drop-down menu. Take note of the processor information as highlighted above. Running a web search for this processor will take you to the manufacturers website, which should list the processor’s stats as well as whether it is 32-bit or 64-bit.

Windows:

 

Navigate to “Control Panel → System and Security → System” and look for the highlighted information to determine whether your system is 32-bit or 64-bit.

 

2. Installing VirtualBox

 

Visit the VirtualBox downloads website, and in the highlighted area, select the platform package binary that applies to your operating system. VirtualBox is available on Windows, macOS, Linux, and Solaris.

Opening the downloaded file will start the installation walkthrough. Once it finishes, you’ll be able to launch the application.

 

3. Getting the latest FreeBSD release:

     

Downloading FreeBSD

Visit the official FreeBSD releases page. The disk images are listed in order of release date, so the most recent release can be found at the top of the page as highlighted.

  • For 32-bit machines, click on i386
  • For 64-bit machines, click on amd64

 

 

After clicking the link, you will be redirected to a file directory containing multiple formats and versions of the FreeBSD installer.

  • NOTE: Although there is a section on the release page for virtual machines, do not download those options for VirtualBox. VirtualBox cannot read .qcow files like other virtual machines and requires a .iso installer format.

   

Identifying the Correct Disk Image

 

For Virtual Machines, the format you are looking for is the file ending in -disk.iso as highlighted above. Click this file and it will start downloading the installer.

 

4. Configuring and Starting FreeBSD on VirtualBox:

 

Once the FreeBSD installer has been downloaded in the last step, run VirtualBox to start hard disk configuration. Select the “New” button on the top left of the window to open the configuration window. 

Name your operating system as “FreeBSD”, then select FreeBSD from the dropdown menu as well as the version (32 or 64 bit).

 

Screen+Shot+2016-06-09+at+10.30.34+AM

Choose the defaults options for disc setup until you reach the memory allocation section

  • Pick 2-4GB memory (as long as the slider does not move into the red)
  • Hardware drive Option – Recommend 100GB at least 20GB
  • Give the VM some extra processors if your machine can handle it (stay in the green)

After the hard disk has been configured, boot up the operating system with the “Start” button. VirtualBox will start up a virtual machine and ask for a virtual optical disk file. This will be the .iso file that you downloaded through the FreeBSD website. Navigate to this file by clicking the small file symbol next to the drop-down menu. Once selected, the booting process will continue and the FreeBSD installer will start.

 

5. Installing FreeBSD:

 

Screen+Shot+2016-06-02+at+5.24.33+PM

 

The FreeBSD booting system will automatically start once VirtualBox starts the virtual machine. While this how-to will provide a detailed installation guide, the FreeBSD handbook’s installation guide can also be used. When in doubt, use the default options provided, as they can be reconfigured later if necessary.

  1. After the first boot, users will be directed to the welcome menu. Arrow keys can be used to navigate through the options while the Enter key will be used to save the selection and move onto the next menu. To begin installation, select the first [ Install ] option.

  2. This will enter bdsinstall, a program that allows users to install FreeBSD while offering multiple options for customization. For now, default options will be all that’s needed. The options are a great tool for more advanced users wanting a more personalized experience.

  3. First, the installer will display a menu for keymap selection. Highlight the option to continue with the default keymap and press Enter to use the default keyboard layout.

  4. The installer will then allow the user to set a hostname for the system. Type in a hostname that is unique for your network. Hit Enter again to save the new name.

  5. After a hostname is selected and saved, the installer will prompt the user to select components to install. Stick with the default options and hit Enter to continue.

  6. The installer will guide the user through the process of allocating disk space. This will allow FreeBSD to set up a partition scheme.

    • Choose the Auto (UFS) Guided Disk Setup.

    • Confirm your selection.

    • Use the Entire disk (ada0), this will make sure that all allocation disk space will be utilized.

    • Select GPT Partitions when prompted for a partition scheme. To navigate, use the arrow keys and Space to select the GPT option.

  7. When prompted, complete the setup process and create the disk partition by selecting [ Finish ] and [ Commit ]. Once these changes have been saved and committed, bsdinstall will start the FreeBSD installation process. This may take a few minutes.

 

6. Post- Installation Setup

 

While the FreeBSD installation process has been completed, there a few more configuration options that need to be set before booting into the newly installed system.

  1. First, the root password must be set. The root account is a superuser that has access to all files and commands. Characters that are typed during this section will not be displayed on the screen. Type the new root password and then a second time when prompted.
  2. Next, FreeBSD will need to configure the network interfaces found on the computer. Select Enter to continue. The default options should be used.
    • Select [ Yes ] to configure IPv4
    • Select [ Yes ] to use DHCP to configure
    • Select [ Yes ] to configure IPv6
    • Select [ Yes ] to try SLAAC
    • At this point you will be directed to a menu with Resolver Configuration values, hit Enter to continue to the next step.
  3. The next menu is a large list of regions for time zone configuration. Use the arrow keys to navigate to the correct region and hit Enter. Next, navigate to the correct country or region. Finally, identify and choose the correct time zone. Select [ Yes] to confirm.

  4. A menu to set the correct date will be next, while you can navigate through the menu to set date, choose [ Skip ] if the displayed date is already correct. [ Skip ] the next menu as the time zone was set up in the previous configuration menu.

  5. The next two menus will be to configure what system services will be started when the system boots. All services are optional and for now select [ OK ] in both menus to continue with the default configuration.

  6. The next step will be to add a user besides root. Because root has no limits and protection, it is recommended to log in to the system using a user account to limit the damage if a mistake is made (even a typo could be catastrophic).

  7. When prompted to create a user account select [ Yes ]. Bsdinstall will follow with a series of prompts to customize the account. Below is a quick summary of the information to input. For clarity, text in bold notates when the user should input text and not just use the default option:

    • Username – username used to log in. Username is case sensitive and should not contain spaces
    • Full name – The user’s full name
    • Uid – user ID (leave this blank)
    • Login group – The user’s group (leave blank)
    • Invite user into other groups? – Additional groups for the user. Type wheel here, which will give admin access.
    • Login Class – (leave blank)
    • Shell – (leave blank)
    • Home directory – The user’s home directory (leave blank)
    • Home directory permissions – Permissions on the user’s home directory (leave blank)
    • Use password-based authentication? – Prompts user to input password at logic (leave blank)
    • Use an empty password? – Option to use a blank password, though this is insecure (leave blank)
    • Use a random password? – Option for a randomized password (leave blank)
    • Enter password – The password for this user. Characters typed will not show on screen.
    • Enter password again – The password must be typed again for verification.
    • Lock out the account after creation? – Option to lock out use (leave blank)
    • User will be prompted to review the summary. If a mistake was made enter no and try again. If everything is correct, enter yes to finalize and create the new user. The menu will then ask if the user wants to create further user accounts, for now enter no.
  8. Final configuration: Use the arrow keys to navigate to Handbook and press Enter to install the FreeBSD Handbook. Select [ Ok ] to begin installation.
  9. Navigate to Exit and hit Enter to finalize changes. Select [ No ] when asked if further manual configuration is required and [ Reboot ] to complete the FreeBSD installation process.

 

7. Saving Your Configuration:

 

Once FreeBSD has been properly configured a window will appear asking if you would like to reboot to set the changes. Select “yes” and wait until the FreeBSD booting page appears again. Once this happens, close the virtual machine window and select “Power off the machine”.

 

Screen+Shot+2016-06-14+at+1.23.48+PM

 

8. Removing the Installation Disk:

 

On the main VirtualBox application, click the the section (on the lower right side of the window) that says “Storage”. A new window should appear showing the storage options.

Under the main “Controller: IDE” there will be two options. One will be the hard disk that VirtualBox created for the system (it will have a square blue hard drive icon) and the other is the original FreeBSD download (with a light blue disk icon). Right click the sub-storage with the disk icon and select “Remove” from the drop-down menu.

 

Screen+Shot+2016-06-09+at+10.52.13+AM

 

Once it is removed, the window should resemble the one pictured above.

 

9. Final Configurations:

 

Select “OK” to save your changes and return to the main VirtualBox application. Click “Start” again and the FreeBSD virtual machine should now boot in its configured form. You now have FreeBSD installed on your machine!

  1. In order to download packages you need to be logged into, or emulate the root user. Enter the following commands in the terminal:
$ su

      2. Install the VirtualBox guest addition packages:

$ pkg install emulators/virtualbox-ose-additions

       3. Open the startup service configuration file located at /etc/rc.conf using the built in text editor ee:

$ ee /etc/rc.conf

4. To edit the file using ee, navigate using the arrow keys and type the text you need to enter. Once you are happy         with your changes, press “<Esc> + <Enter>” and press “a” when given the option to save changes.)

5. Add these two lines to the bottom of the file and save your changes:

vboxguest_enable=“YES”

vboxservice_enable-=“YES”

 

10. Installing Other Software:

 

Over 30,000 third-party software packages are available to install on FreeBSD!

What applications do you typically use each day?

  • Word
  • Excel
  • Internet Browser
  • Mail app

Let’s install an Internet Browser and an Open Source equivalent to Office!

First, let’s find out whether the software is available on FreeBSD using the following commands:

$ pkg search firefox
$ pkg search libreoffice

 

11. GUI (Desktop) Prep

 

 

Before installing a desktop environment, a graphical user interface (GUI) is needed. The X Window System is an open source GUI that supports FreeBSD and offers a ton of customization and user tools.

  1. To install the Xorg binary package and configure the X Window System:
$ pkg install -y xorg
$ startx
$ ee /boot/loader.conf

2. Add the following line to the end:

kern.vty=vt

$ ee /usr/local/etc/X11/xorg.conf.d/driver-vboxvideo.conf

and add the following content to the new file:

Section “Device”

           Identifier “Card0”

           Driver     “vboxvideo”

EndSection

2. Enter the following commands:

$ sysrc dbus_enable=YES 
$ dbus-uuidgen > /etc/machine-id 
$ pkg install -y sudo 
$ visudo

(we will use the vi editor this time to edit sudo )

3. Within the sudo config type /wheel press Enter and uncomment the line below to allow all members of the wheel group to use sudo (in vi you can type the following to accomplish this task: j0xxZZ) ( pressing j moves down, 0 moves to the beginning of a line, x deletes one character, ZZ is saves and quits)

$ reboot

(you can also type init 6 to reboot)

13. Installing and Configuring a GUI (Lumina Desktop Environment)

 

 

  1. As regular user run the following:
$ sudo pkg install -y lumina
$ vi .xinitrc

2. Within the .xinitrc file type i to enter insert mode then add the following line:

exec start-lumina-desktop

3. To exit and save changes type ESC then type two capital Z’s or you can also type :wq

$ startx

4. Right click on desktop, Mouse over Preferences, Click on All Desktop Settings, click on General Options, in the Time Format field type the following

h:mm:ss A

This will change the clock to 12-hour format. If you don’t want the seconds displayed remove the :ss

5. Next, set up a media server: Open a terminal (alt-F1) and run: 

$ sudo pkg install -y plexmediaserver
$ sudo sysrc plexmediaserver_enable=YES
$ sudo service plexmediaserver start

 

14. Installing Applications

 

  1. First, install Firefox:
$ sudo pkg install -y firefox

2. Click on the Lumina icon in the bottom left either type firefox + Enter or mouse over applications > Internet > click on Firefox

3. Open firefox to http://localhost:32400/web

4. Sign up with either a Google, Facebook, or Email account

5. Follow the wizard and give your new media server a name, uncheck the box ‘Allow me to access my media from outside my home’, click Next, we can organize media later click Next, click Done.

6. The next step is to install and configure libreoffice:

$ pkg install -y libreoffice

7. Open libreoffice in Lumina

8. Open up a new document and start editing

9. Now you can use the “+ Add Library” button to add media libraries. For example, if I wanted to add a music library I could put some awesome music in my home directory (~/Music) then click the  “+ Add Library” link, select the type Music, name it Music click Next, click “Browse For Media Folder” button and select the Music folder

 

You Did It! 

 

You now have a desktop environment on your device! the start-lumina-desktop command will launch the desktop environment from the FreeBSD shell. Each environment has its own settings but offer a console app to use for command line use. Quitting the environment will also allow the user to access the FreeBSD shell. 

 

Some Additional Useful Commands:

Avoiding Issues

Terminate current command:

$ ^C (Ctrl-C)

Clear to start of line:

$ ^U (Ctrl-U)

Finding Information:

Manual page for the “cmd” command, replace with any other command to access its manual page:

$ man cmd

Rebooting / Shutting Down

Power Down:

$sudo shutdown –p now

Reboot:

$ sudo shutdown –r now

Log Out:

$ exit
$ logout

Directory Navigation

Display present work directory:

$ pwd

List contents of current directory:

$ ls

Files

Create file if it does not exist:

$ touch filename

Delete file:

$ rm filename

Rename a file:

$ mv oldname newname

Search for a file: (full filename is not needed)

$ locate filename

File editing

$ vi filename
$ ee filename

Change to your home directory

$cd
$cd ~

Change to parent directory

$ cd ..

Change to previous directory

$ cd -

 

Additional Resources: 

Website: www.freebsd.org

FreeBSD Foundation: www.freebsdfoundation.org

GitHub: github.com/freebsd  

Mailing Lists: https://lists.freebsd.org/mailman/listinfo

Forums: https://forums.freebsd.org

FreeBSD Handbook: https://www.freebsd.org/doc/handbook/