Convert Microsoft to LINUX: Latest FreeBSD Install


This section will feature info on the latest FreeBSD UNIX Distribution. It is now at release 9.1 as of April 2013. Note it comes in several off shoots such as NetBSD PC-BSD GHOSTBSD OPENBSD . They are all based on the Berkeley Software Development architecture of the late 1970's. You want to always install these to their own bootable partition preferably at least 11 Gig. Then you may have to reinstall one of your Linux multiboot systems. I usually go for Suse and just use the menu.lst that is mentioned on my Suse page. I also make sure to reinstall the boot loader and overwrite the MBR Master Boot Record to get it back from BSD. The easiest to install was PC-BSD with a beautiful GUI interface. Once installed however, I could not get the video card to be as pretty with my second ACER monitor and Acus EEEPC. However it basically worked ok. There was also a problem getting the sound card to work. My favorite UNIX system of all time is Solaris but this is a very personal thing. Please let me know about other BSD's that you like that I have not mentioned.

FreeBSD is actually open source UNIX not Linux. However, there are enough similarities that it is worth focusing on. Note, FreeBSD uses the UFS2 file system as opposed to Linux which uses the ext3 or ext4 file system . It works with the built in Ubuntu Linux Multiboot GRUB2 program so you can still multiboot. The installation of FreeBSD is pretty straight forward. You will probably want to use a usb stick for your image, you can grab the file called FreeBSD-i386-memstick.img
You can then use the Ubuntu program image-writer to burn it on the USB stick. Note, if you use the built in startup disk creator in Ubuntu it will not work. Reboot into the USB stick and install. Let it go and format a partition (slice in FreeBSD lingo) as UFS2. In this case I chose /dev/sda5. If you already have a Linux on your machine, in my case being Ubuntu, be sure to choose no bootloader and no changing of the MBR (Master Boot Record) You can I then edit the file /etc/grub.d/40_custom on Ubuntu or wherever your bootloader is:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "FreeBSD" {
set root=(hd0,1) # Paritition is the first on the hard drive now.
chainloader +1
}

Note, this is using the new grub2 in Ubuntu which is the default now. The number one here signifies we are using the first partition on the hard drive, you may need to change it appropriately. Note, it is assigned sda1.

You will then need to at the command line on Ubuntu type:
sudo update-grub
sudo grub-install --recheck /dev/sda
It should hopefully report no errors. Note, the file called
/etc/default/grub
has an entry in it saying GRUB_DEFAULT=0
which will boot the first item in the grub2 menu, change it to another number if you want to not boot automatically into the first item. Remember, if you change it to rerun
update-grub

A few notes about the installation:

  1. Be sure to select Network Configuration at the end and pick DHCP.Then it will fill everything in for you.
  2. When you are done, you will only have a shell and no GUI interface . FreeBSD is hard core. I chose to install the xfce4 Desktop Manager with Firefox and Flash. Here are the steps:
  3. Type pkg_add -r xfce4 firefox xorg
    at the command prompt. You must be logged in as root. The sudo you are familiar with in Ubuntu is not built in, so be root for now and be careful!
  4. Edit /boot/loader.conf
    snd_hda_load="YES"
    This will enable the sound on the sound card.
  5. At the command prompt as root type:
    portsnap fetch
    portsnap extract
    Note, if I had ran portsnap extract before, I would have run portsnap update now.
  6. Now you need to enable FreeBSD to use the Linux Binaries (rpm's from Fedora). This is somewhat involved.Here are the steps:
    First we need to set a few configuration options. Add the following line to /etc/rc.conf file.
    linux_load=YES
  7. In order to get the latest version of the linux base (which is required for Flash 10/11) add the following line to /etc/sysctl.conf
    compat.linux.osrelease=2.6.16
  8. Now in order to make this change happen immediately, run the following command:
    /etc/rc.d/sysctl start
  9. Finally we need to add an additional option to /etc/make.conf
    in order to be able to use fedora10 as our linux base.
    OVERRIDE_LINUX_BASE_PORT=f10
  10. Now we can move onto installation:
    cd /usr/ports/emulators/linux_base-f10
    make install clean
  11. In order to start compatibility, use the following command:
    kldload linux.ko
    That will be run automatically everytime you boot with the line we added to rc.conf.
  12. Now add the following line to /etc/fstab
    linprocfs /compat/linux/proc linprocfs rw 0 0
    This will make sure the linux compatibility stuff is loaded at boot time.
  13. Now run the following two commands:
    kldload linprocfs
    mount /compat/linux/proc
    From now on that will be done for you automatically.
  14. cd /usr/ports/www/nspluginwrapper
    make install clean
  15. cd /usr/ports/www/linux-f10-flashplugin10
    make install clean
  16. mkdir /usr/local/lib/browser_plugins/
    Note, you need to be sure the two .so libflashplayer files were created so you can make the symbolic links below.
    ln -s /usr/local/lib/npapi/linux-f10-flashplugin/libflashplayer.so /usr/local/lib/browser_plugins/
    ln -sv /usr/local/lib/browser_plugins/npwrapper.libflashplayer.so /usr/local/lib/firefox3/plugins/npwrapper.libflashplayer.so
    Now type this for each user:
    nspluginwrapper -v -a -i
    You do not have to be logged in as root to do this. This gets all the plugins for that particular user.
  17. Finally to test, create your file to start xorg which launches the XWindow inLinux. In the users directory the file will be called .xinitrc
    You type:
    echo "/usr/local/bin/startxfce4" >> ~/.xinitrc
    To launch type:
    cd ~
    ./.xinitrc
    You should see xfce4 the Xoffice lite Desktop come up. You will probably haveto fill in the applications, such as the properties for Firefox icon to be /usr/local/bin/firefox3
    You should be able to browse for it the way you normally set up your desktop menu icons.

    You probably got an error when you launched xfce4 saying the desktop name could not be found. To correct this edit the localhost 127.0.0.1 line, so it uses the name you have. See this /etc/hosts
    Also make sure your file /etc/rc.conf matches this.
    You may notice that your sound is very quiet. This is easy to fix. On the lower left hand corner of the Xfce4 click on the Mouse Icon and you will see your standard menus, go to multimedia | mixer and click on your standard volume controls. You have to first select volume, pcm, input and output giving it some gain. You should then hear it all loud and clear!

    The Easy way to get a display but no Flash Player

    Ok, for reading this far, now let me show you the simple way. You can get by with plain old Xorg or if you want to be a little fancier Icewm Window Manager . So this will be your install line:

    • Type pkg_add -r icewm firefox xorg
      at the command prompt. You must be logged in as root.
    • Make sure your /etc/rc.conf matches this. After doing this if you type:
      startx
      at the prompt after logging in you should get an Xdisplay manager with a clock and an Xterm. You can go to the Xterm and type:
      /usr/local/lib/firefox3/firefox &
      to launch firefox as a background process. If this is not pretty enough for you, use the Icewm Window Manager instead. In the home directory create a file called .xinitrc do not forget the dot in front of the file name.
      exec icewm-session
    • Now type startx and you should have your Icewm session running. You can launch firefox as you did earlier with the Xorg Display Window Manager or get fancy and add in a menu item under programs. Follow the instructions in the file for how to make a copy of the master menu and then modify it for your individual user.

    Good Luck!