Installing FreeBSD 11.3 & Xorg on Dell Optiplex 5040

Model: Dell Optiplex 5040
CPU: Intel(R) Core(TM) i5-6500 @ 3.2GHz
Memory: 8 GB
Video: Integrated Video Card (Intel HD530)
FreeBSD Version: FreeBSD 11.3-Release
— Versioon 12.1 caused the trouble of infinite rebooting when “i915kms.ko” module is loading during the boot process as of 03/05/2020 -> Bug Forum Link

  1. Downloaded FreeBSD 11.3 ISO Image from FreeBSD.org
  2. Made the installation USB flesh drive with the image ( Refus 3.9 was used)
  3. Installed FreeBSD on the PC by the USB flesh drive (UEFI mode used).
  4. Performed the common configuration such as Keyboard layout, Timezone, IP4 Network Interface, root password and adding common user accounts.
  5. After completion of FreeBSD Installation, rebooted the PC and signed in to the system with the root account for further process.
  6. Installed necessary ports by pkg (not compiling ports from source codes but downloading the pre-compiled binaries to save the time)
    1. pkg install xorg
    2. pkg install sudo
      1. Enable wheel group as sudo by using visudo
        1. Remove # in front of “# %wheel ALL=(ALL) ALL” line
        2. save and exit from visudo (ZZ as shortcut)
    1. installing windows manager of your choice such as lumina, gnome, kde, xfce, etc.
    2. pkg install firefox
    3. Optional ports: filezilla, libreoffice, gimp, inkscape, scribus (currently scribus-devel-1.5.5_6) , openjdk, netbeans, wordpress, php, python3.7 for the possible productive/development related ports if necessary
Added dbus_enable="YES" in /etc/rc.conf  
(You can use the below command at the shell prompt without editing rc.conf file directly if you want. I love "vi"!!!)
sysrc dbus_enable=YES
Used below command line to add DBUS UUID and started its service 
dbus-uuidgen > /etc/machine-id
service dbus start

Enabling the Integrated Intel HD 530 for Xorg https://wiki.freebsd.org/Graphics#Intel_Integrated_Graphics_.28aka_HD_Graphics.29 )

  1. Installed Intel HD 530 Graphic modules for Xorg with the root account
    • pkg install drm-kmod
  2. added below line in /etc/rc.conf
    • kld_list=”/boot/modules/i915kms.ko”
  3. Added User Group for Accelerated Video ( https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x-config.html )
    • pw group mode video -m USERID || pw groupmod wheel -m USERID
  4. Added (actually created the file) below line to /boot/loader.conf to enable vt(4)
    • kern.vty=vt

Enabling Desktop Environment (Enabled only Lumina at this moment)

  1. Lumina Desktop Environment
    1. Installed Lumina Desktop Environment
      • pkg install lumina
    2. After installation, added below line in .xinitrc for starting its Desktop Environment
      • exec start-lumina-desktop
  2. GNOME Desktop Environment (for your reference. I haven’t done it yet)
    1. Install GNOME Desktop Environment
      • pkg install gnome3
    2. Add below line to /etc/fstab
      • proc /proc procfs rw 0 0
    3. Add below lines in /etc/rc.conf
      • dbus_enable=”YES” –> If you didn’t do this early
      • hald_enable=”YES”
    4. Add below line in .xinitrc
      • exec /usr/local/bin/gnome-session (or use shell command as echo “exec /usr/local/bin/gnome-session” > ~/.xinitrc )

Finally,entering startx at the shell, BOOM!