FreeBSD Desktop Setup with Nvidia card



FreeBSD is not just for servers anymore. I have been running FreeBSD as a desktop for over 10 years. This article is about how to set up FreeBSD as a desktop. Assumption is that you have followed one of the many many how to install FreeBSD and have it installed and configured so you can log in as root.
  1. Install packages
    You have to install some packages in order to run xwindows on your machine. Here is the list of the packages that I install when I am doing this:
    • xorg -- the base packages for running xorg. Needed by all window managers.
    • vim -- update to vi that I can't live without
    • i3 -- my window manager of choice (gnome, kde, mate, cinnamon, windowmaker, xmonad, dwm are some alternatives)
    • lightdm -- my display manager of choice (gdm, xdm, slim, etc are alternatives)
    • lightdm-gtk-greeter -- required for lightdm to work
    • nvidia-server-470 -- The specific version driver for my card. If you don't get a login when the setup is done try other versions. My card will not run on the latest version, 525.
    • nvidia-settings -- program to allow you to tweak resolutions and multiscreen layouts.
  2. configure /boot/loader.conf
    For the nvidia driver to run you have to put the following line in your /boot/loader.conf file:

    nvidia-modeset_load="YES" once this is in reboot and once you reboot look with kldstatus and make sure nvidia is in the list.
  3. configure /etc/rc.conf
    Once the nvidia driver is loaded now we tell FBSD to turn on xwindows et al. Here are the minimum lines you need:

    hald_enable="YES"
    dbus_enable="YES"
    lightdm_enable="YES"
    linux_enable="YES"

    Once this is fixed reboot your computer. You should see a graphical login for lightdm. If not try a different version of nvidia driver. If you get a blank screen with nothing, then lightdm-gtc-greeter is not installed. Hopefully this shows how quickly you can easily set up FBSD as a desktop.