Friday, June 12, 2020

Setting up FreeBSD on your PC/Laptop after installation

This guide will show you on how to set up your FreeBSD OS after installation. This step is fairly different than the virtualbox guide so you will require some extra step for that.


1. SETUP xorg PACKAGE
It is best to compile the package from scratch rather than install the pre-built ones. You don't want having yourself scratching up your head due to problematic issues such as video playback not working and etc. 1

If you're not installing ports from the FreeBSD installation setup, run the command below to obtain ports package. 
 
$ portsnap fetch
$ portsnap extract 
Then, you will need to install both components first, llvm and meson.
$ whereis llvm
llvm: /usr/share/ports/devel/llvm
$ whereis meson
meson: /usr/share/ports/devel/meson
Next, go to these direcotries and build these packages. This will take a longer time so be patient.
$ cd /usr/share/ports/devel/llvm
$ make install clean
$ cd /usr/share/ports/devel/meson
$ make install clean 
Then, locate the ports package for xorg
$ whereis xorg
xorg: /usr/share/ports/x11/xorg
After that, go to the xorg ports directory and build it from scratch
$ cd /usr/share/ports/x11/xorg
$ make install clean

2. SETTING UP GRAPHICS DRIVER.
Sometimes, installing a graphic driver could be pretty messy especially with Intel GPUs from which I thought that it's pretty easy to install than the Nvidia or AMD counterparts. 

First, install the pre-built drm-kmod package first, pay attention to the terminal output on the screen:
 $ pkg install drm-kmod
New packages to be INSTALLED:
	drm-kmod: g20181126 [FreeBSD]
	drm-current-kmod: 4.16.g20190305 [FreeBSD]
Message from drm-current-kmod-4.16.g20190305:

The experimental drm-current-kmod port can be enabled for amdgpu (for AMD
GPUs starting with the HD7000 series / Tahiti) or i915kms (for Intel
APUs starting with HD3000 / Sandy Bridge) through kld_list in
/etc/rc.conf. radeonkms for older AMD GPUs can be loaded and there are
some positive reports if EFI boot is NOT enabled (similar to amdgpu).

For amdgpu: kld_list="amdgpu"
For Intel: kld_list="/boot/modules/i915kms.ko"
For radeonkms: kld_list="/boot/modules/radeonkms.ko"

Please ensure that all users requiring graphics are members of the
"video" group.

Older generations are supported by the legacy kms modules (radeonkms / 
i915kms) in base or by installing graphics/drm-legacy-kmod.
Then, add these lines into /etc/rc.conf: For amdgpu (newer AMD GPU cards):
 kld_list="amdgpu"
For Intel GPU:
kld_list="/boot/modules/i915kms.ko"
For radeonkms (older AMD/ATI GPU cards):
kld_list="/boot/modules/radeonkms.ko"
NOTE: If you're using Nvidia GPU cards, you might need to take a look at these guides here. Other guides can be followed through this forum link here and also from the FreeBSD handbook guide here.

NOTE: If you're using Intel GPU and having difficulties while activating GPU even though the drm-kmod is installed and added into /etc/rc.conf correctly without syntax error, you might need to take a look at this forum link here.

For Intel GPU, additional steps needs to be taken in order to activate the hardware acceleration. You will need to add the SNA Acceleration mode in /usr/local/share/X11/xorg.conf.d/driver-intel.conf:
Section "Device"
        Identifier  "Card0"
        Driver "modesetting"
        Option "AccelMethod" "sna"
        Option "TearFree" "true"
EndSection
Finally, add yourself to video and wheel group:
$ pw groupmod video -M [username]
$ pw groupmod wheel -M [username]
3. SETTING UP SOUND CARD 
Setting up the soundcard might be different between the hardware and by default, the soundcard can be enabled by this line here in /boot/loader.conf
 snd_hda_load="YES"
However, sometimes, this line might have some issues either your hardware or your current OS versions which your video fail play. So, in order to enable the soundcard without some issues, add these line on /etc/sysctl.conf below
 
  dev.hdac.0.polling=1
  hw.snd.default_unit=1
If you're still having some issues with soundcard which is video is playable but no sound, just edit the value on the line hw.snd.default_unit to 0

4. MISCELLANEOUS
Turn off unnecessary thing like sendmail function:
 sendmail_enable="NO"
      sendmail_msp_queue_enable="NO"
      sendmail_outbound_enable="NO"
      sendmail_submit_enable="NO"

5. WIFI ISSUES
Just to say that FreeBSD not really friendly at detecting wifi devices compared to Linux OS. For now, you might need a USB wifi travel router that have a client capability to connect the wifi via LAN connection like this below:
                                        

Sunday, June 7, 2020

FreeBSD Guide For NOOBS! [PART 2 - Installing some stuffs]

The part 2 of this guide will covers how you are going to install these packages and also how to set up the desktop environment as well. Please pay full attention at this guide and also the output from the terminal as well because there are some extra steps that every user must be taken in order to complete the installation. 

1. SETTING UP STUFFS 

Log in FreeBSD OS as root account. You are required to set up some stuffs.

Then, run the command below: 
 pkg install sudo nano

Next, you will need to set up sudo file and associate with your username. Run the command below:
 nano /usr/local/etc/sudoers


Uncomment the section of the line like this:
 
%wheel ALL=(ALL) ALL
%wheel ALL=(ALL) NOPASSwD: ALL
%sudo ALL=(ALL) ALL
Then, add username into sudoers file:
 amirzaim ALL=(ALL) ALL
Press Ctrl+O to save the file and then press Ctrl+X to exit.

Next, we are going to set up the desktop environment. Xorg package must be installed first before installing any kind of desktop environment. Run the command below:
 pkg install xorg
Next, enter this line kern.evdev.rcpt_mask=6 on file /etc/sysctl.conf to allow ps/2 mouse especially on virtualbox.

.

Then, install the desktop environment. For KDE, run the command below:
 pkg install kde5
For Gnome, run the command below:
 pkg install gnome3
For XFCE, run the command below (login manager need to installed alongside as well):
 pkg install xfce gdm
Desktop environments needs /proc to be mounted, so you will need to add the line proc /proc procfs rw 0 0 on /etc/fstab

Next, open up file /etc/rc.conf and add two lines first:
 
dbus_enable="YES"
hald_enable="YES"

For Gnome/XFCE, add these lines into /etc/rc.conf file:
gdm_enable="YES"
gnome_enable="YES"
For KDE, just add these lines into /etc/rc.conf file:
sddm_enable="YES"
Then, reboot the virtual machine. If you seeing this logon screen, congratulations!



HELP!!! MY FREEBSD FAIL TO BOOT DUE TO SYNTAX ERROR ON /etc/rc.conf FILE!!!
Don't worry! Just enter these command here below to grant the disk access during abnormal boot:
fsck -y
mount -u /
mount -a -t ufs
swapon -a
NOTE: If you're installing FreeBSD on actual hardware instead of virtualbox, then you will need to configure graphics manually. See this FreeBSD handbook for details. 

 Let's go to part 3 to play it around the FreeBSD interface...

Saturday, June 6, 2020

FreeBSD Guide for Noobs! [PART 1 - FreeBSD Installation]

ENOUGH WITH LINUX BULLSHIT, MIGRATE TO FREEBSD!

Second revision: 8 Sept 2023.

Today, I'm writing here on how to set up FreeBSD for users who want to learn something about operating system that is much different than Linux although looks bit same. Let me tell something about FreeBSD - it is an open-source, unix-like operating system, much like Linux but different than Linux. The major difference between FreeBSD and Linux is you can develop a closed-source version of FreeBDS operating system and you are also have rights to remain your modified source codes hidden from public. On Linux, you can't simply closing-source the code and you shall give up the code to the penguin king and then the penguin king is now starting to bitching about it!

FreeBSD operating system mainly popular on high-end server and networking machines rather being popular at desktop but it is also popular at gaming consoles such as Sony PS3/PS4 consoles and even Nintendo Switch as well due to the nature of BSD license clause that allow the creation of close source version of their operating system. On the other hand, FreeBSD is simply a full-fledged operating system when compared to Linux which is just a kernel and heavily dependent with other stuffs that make up the operating system. If you're already expert on Linux, I'm sure that you're might also able to handle FreeBSD OS as well although it's kinda bit confusing at the moment and the way of installation of FreeBSD is I just say - bit similar to Arch Linux but the difference is FreeBSD provides guided CLI-based installer so you don't have to waste your time writing the command one-by-one like Arch Linux.