Best (and Most Correct) Way to Run FreeBSD for Desktop

I want to give FreeBSD another chance. I've used FreeBSD as a desktop a little bit for about a year. But I am a complete noob and need the help of The FreeBSD Forums once again if I am to use it as my primary desktop.

See these two blog posts I made about how I installed FreeBSD (with the combined help of this forum, the book Absolute FreeBSD, and official documentation from FreeBSD.org):
For the second link, I got a comment from someone saying I'm "missing a number of steps," but other commenters weren't sure what steps were missing. This time around, I am OK installing a different desktop environment. I guess factors in deciding what desktop environment to use would be ease of use (for a noob) and what is popular and most likely to receive help from the FreeBSD community should something go wrong (and, chances are, it will).

As the title of this thread illustrates, I am looking for the best and most correct way to run FreeBSD for desktop. Unfortunately, because I am a noob, I will need all the directions clearly written out. But I am also open to brainstorming, and I will be grateful for all advice received.

Two related questions (I'm sure I will think of more later):
  1. When does one remove the install media (e.g., USB stick) after installing FreeBSD: before, during, or after the computer does its first restart?
  2. Why was I unable to use the command to restart the computer on my last install? I could only power off the computer (via the command line), and then I would have to push the button on the computer to turn it back on.
Thank you so much to the kind people on The FreeBSD Forums for helping me over two years ago! The FreeBSD community is one of the operating system's advantages.
 
Look in the how-to section, there's very detailed how-tos, such as this from Trihexagonal .
There's also the handbook.

But, if you want a similar setup to gnu/linux "distributions" (which are called derivations here), then try GhostBSD, it is FreeBSD with a desktop pre installed for you. On the other hand, if you want to work it all out yourself, then follow the instruction in the handbook and/or how-to and come back here when you have questions.

I'll address some things:
Remove usb: set your bios or uefi to primary boot off the install disk and second to your usb and you'll be fine. Most the time this is the case. If in doubt, leave it in until you see the "sync" message just before the reboot.
Restart: I'm no desktop guru but I believe this depends on the desktop being used. Setting polkit accordingly will fix this. Something like this.
 
question 1:
I typically remove the install media after the shutdown completes but before the reboot starts.
Watch what happens when you "restart" (pick windows, linux, anything really). The system typically goes to a console, does some stuff, says something like "shutdown complete, restarting" and then you wind up at the BIOS/UEFI stage. This is when I pull out the install media.

question 2:
Very hard to say, depends on a number of different things like what user were you, what desktop, were you root, exactly what command did you use.
To restart, I use the following as root, from a command line:
shutdown -r now
If the hardware supports it (most Intel/AMD systems do):
shutdown -p now
will shutdown and power off the system.

I agree with mark_j on the howtos by Trihexagonal and vermaden.
XFCE is a reasonable desktop (my opinion as one that really doesn't like desktop environments); the default install (meta-package) may not install all the little widgets you may want. pkg search xfce | wc -l shows a total of 54 packages, I'm not sure how many get pulled in by doing pkg install xfce.
 
Look in the how-to section, there's very detailed how-tos, such as this from Trihexagonal .
Agreed. For building a working desktop, I'm more in favour of reading step-by-step tutorials than DIY.
For example, I can't remember when, but I used Trihexagonal tutorial to setup my desktop.
Then I follow Minbari instruction (How-to somewhere in the Forums) to switch the desktop to the i3.
When I reached to the DWM, I knew how to it myself, but in the early days, no. I needed a step-by-step tutorial.
 
As the title of this thread illustrates, I am looking for the best and most correct way to run FreeBSD for desktop. Unfortunately, because I am a noob, I will need all the directions clearly written out. But I am also open to brainstorming, and I will be grateful for all advice received.
I think this is mission impossible, in a good sense - there is no single correct way. This forum is full of people, having different desktop setups. My personal advice is:
  1. Select your preffered Window Manager (WM). Several are available and you can install multiple at the same time.
  2. Select your Display (login) Manager (DM). Also several are available. In the end they all do the same work - let you log in and start the WM.
  3. Install DRM or video drivers depending on your GPU;
  4. Install Xorg
  5. Install DM and WM.
Personally I keep Mate, KDE Plasma and Xfce installed at the same time, but this is strictly personal choice.
I have also deskutils/cairo-dock installed.
 
As many times I wrote: I started from DOS - OS2 - Linux and start using FreeBSD from version 6?. I never read any how to make a desktop because it is my personal choice what and how I wanted than my desktop looks like. Yes, I red FreeBSD handbook. All the the time after base installation of FreeBSD I tunep my system - rc.conf, sysctl.conf...firewall... and than I install Xorg and WM or whatever you prefer. I am using Openbox which I like it and I start it with "startx". And the questions is what do you expect from desktop? What I am using and it works all the time is: Claws-Mail, Firefox/Qutebrowser, LibreOffice, MPV, FreeCAD, GIMP, Inkscape, Xpdf, Geeqie,Blender, Texstudio and Stellarium. All other apps came default in the base system as vi for example.
Everything works and I do not have any problem.
 

Attachments

  • screen.jpg
    screen.jpg
    537.3 KB · Views: 1,085
One thing I found a little confusing as a newbie was the /etc/X11/Xorg.conf and the local configs. If you look online these can be a big source of confusion as the X system is used so widely, and different people store things in different places. If you are lucky an Xorg install will just work, giving you a functional but limited window manager known as twm. In my case I had to change one of the configs to use something called scfb, which was the only one video driver that seems to work on my laptop. In some respects FreeBSD is still lagging behind in hardware support, for example that scfb driver does not support suspend/resume or hardware acceleration, but there are drivers for hardware that do.

There is no FreeBSD desktop. FreeBSD does not ship with one and they are all optional components. You can use GNOME, KDE, Xfce, or any number of window managers. Some of these play nicer than others with the underlying OS, a big issue is that most of this software is now designed with Linux in mind. Nonetheless most of it works nicely and these are all currently built on the X system at the minute and have been for decades.

If you are lucky and things just work you can set a desktop up in three commands:

Code:
pkg install xorg
Code:
pkg install *whichever optional window manager here*
Code:
pkg install *whichever optional software here*

If it comes with a display manager (for example the gnome display manager) the package might handle it for you, or you might have to edit the init scripts to launch it, otherwise you can use a local .xinitrc that is loaded when you type startx.
 
"Correct" way to get to desktop is simply what works. As far as basic setup, I can only give what I use, which has worked successfully for all my FreeBSD installs.
In a normal install, just follow the handbook instructions. Only thing to keep in mind is have your main user part of the operator, wheel, and video groups.
For the GUI installation, my simple plan is this:
1. Login, then su to root
2. run pkg install xorg drm-kmod xfce sddm firefox. I include some additional programs for my own purposes, but these are the basics.
3. add the necessary lines to /etc/rc.conf
kld_list="/boot/modules/gpu_driver_here"
sddm_enabled="YES"
dbus_enabled="YES"
4. I go ahead and load the drm driver. On my laptop which is Intel graphics - kldload /boot/modules/i915kms.ko
5. Run as root startx. Once I see that X has started, I immediately exit. I have found this step to be important before running sddm or adding a line to start xfce in the ~/.xinitrc line. If I don't do this, I have found the power buttons in xfce don't work, at least without additional configuration. Doing this seems to let xfce be automatically configured.
6. Reboot with shutdown -r now The system should come up with the sddm graphical login, and go straight to the xfce session, where you can then add more utilities and programs as needed for your workflow.
 
  1. Select your preffered Window Manager (WM). Several are available and you can install multiple at the same time.
  2. Select your Display (login) Manager (DM). Also several are available. In the end they all do the same work - let you log in and start the WM.
  3. Install DRM or video drivers depending on your GPU;
  4. Install Xorg
  5. Install DM and WM.

6. Make it look good, because you will be staring at it a lot.
 
with the caveat that "good" is subjective because some people love flashy spinning animated transparent desktops and others prefer simple and not flashy etc.

Didn't say flashy.
.
Always, 'good' is subjective.

6.1) No need for the cavaeat.
6.2) Absolute need to look good.
 
  • Like
Reactions: mer
Look in the how-to section, there's very detailed how-tos, such as this ...
This is an example of what not to follow, for exemple this part
As root, run nvidia-xconfig. Run ee /ect/rc.conf, edit in linux_enable="YES", save and exit. Run ee /boot/loader.conf. To cover all chips, Edit in:


linux_load="YES"
nvidia_load="YES"
nvidia-modset_load="YES"

Adding non essential kernel module in /boot/loader.conf will simply prevent the boot process with an error like: could not allocate enough memory.

And if you look at the devfs ruleset, it basically allow to everyone with read and write access to raw device like hard drive, what a mess.
 
This is an example of what not to follow, for exemple this part


Adding non essential kernel module in /boot/loader.conf will simply prevent the boot process with an error like: could not allocate enough memory.

And if you look at the devfs ruleset, it basically allow to everyone with read and write access to raw device like hard drive, what a mess.
I went straight with the Handbook for setting up my desktop of choice (KDE). I would think that to start, the important thing is not to skip steps when following a how-to. But after a few successful attempts, the logic pattern becomes clear. Most how-tos generally follow the same logic - but Handbook offers the simplest way to go about setting up a DE. There's a reason why the section on setting up Xorg comes earlier in the Handbook than setting up a DE.
 
… because I am a noob, I will need all the directions clearly written out. …
If you'd like the KDE Plasma desktop environment:
  1. install FreeBSD (other people's advice)
  2. there's a KDE-provided quick start – graphics (hopefully just one package to install) then four simple steps to get Plasma installed and running.
 
One thing I found a little confusing as a newbie was the /etc/X11/Xorg.conf and the local configs. If you look online these can be a big source of confusion as the X system is used so widely, and different people store things in different places. If you are lucky an Xorg install will just work, giving you a functional but limited window manager known as twm. In my case I had to change one of the configs to use something called scfb, which was the only one video driver that seems to work on my laptop. In some respects FreeBSD is still lagging behind in hardware support, for example that scfb driver does not support suspend/resume or hardware acceleration, but there are drivers for hardware that do.

I think a lot of that confusion is because over time the way Xorg is configured has changed. Originally one had to run Xconfigure and then madly edit the config file. Test and re-edit. Rinse and repeat. Now, you just place the customisation options in /usr/local/etc/X11/... for your particular hardware.

I also think the handbook could do with some reviewing on this topic or better still have a handbook JUST for windowing environments; it's a large enough sub-system.

I started writing stuff up a few years ago but I don't use X much these days and certainly not on any exotic bleeding-edge hardware. I love my voodoo card. (only joking).:)
 
Agreed. For building a working desktop, I'm more in favour of reading step-by-step tutorials than DIY.
For example, I can't remember when, but I used Trihexagonal tutorial to setup my desktop.
Then I follow Minbari instruction (How-to somewhere in the Forums) to switch the desktop to the i3.
When I reached to the DWM, I knew how to it myself, but in the early days, no. I needed a step-by-step tutorial.
When I came here after using PC-BSD for 7 years I still had not built a desktop from scratch and used a tutorial someone else here in the forums wrote to do it. This one and documented it then.

I still remember the sense elation and feeling of accomplishment I got from doing it myself the first time and wrote mine with people who are in the same position I was in 2005 so they could benefit from what I struggled to learn.

That the same blood, sweat and tears need only be shed once has always been my goal.
 
  • Thanks
Reactions: a6h
… confusion … /usr/local/etc/X11/… for your particular hardware. …

Or /etc/X11/xorg.confwithout local in the path – if you use a hardware vendor-provided utility to perform the configuration … locally.

Might a newcomer be confused by such things? Certainly. mark_j that's not a dig at you :) it's just the way things are can be with X.Org.

<https://www.freebsd.org/cgi/man.cgi?query=xorg.conf&sektion=5&manpath=Ports>

<https://www.freebsd.org/cgi/man.cgi?query=nvidia-xconfig&sektion=1&manpath=Ports>

… think the handbook could do with some reviewing on this topic

+1

Also, I should expand <https://community.kde.org/FreeBSD/Setup#Graphics_first> a little, to include NVIDIA use cases. A little, not too much; it must remain a quick start.

or better still have a handbook JUST for windowing environments; …

excluding desktop environments.

KDE Plasma is not part of the X Window System; and so on.
 
Thanks for all the responses! I was reading through them all as they were posted and will continue to look over them. To save everyone's time, please read the last paragraph in this message first. Here are some questions (in order) to individual members, though anyone can reply:

1. mark_j: So I can just remove the USB stick when I see the “sync” message just before the reboot? What exactly is this message?

2. mark_j: I’m not talking about being unable to restart via the desktop (which I also couldn’t do) but via the command line. Do you know why shutdown -p now worked, but shutdown -r now did not?

3. mer: So I can remove the USB stick when I see the screen with the Lenovo logo after the computer shuts down and turns back on?

4. mrbeastie0x19: When you say “window manager,” do you mean “desktop environment”? Can you really install a desktop with just two or three commands? This time, if I want to install KDE, for example, should I just follow 5.7.2. KDE in the Handbook <https://docs.freebsd.org/en/books/handbook/x11/#x11-wm>? It looks like there are probably at least 4-6 other things I would want to do to set up KDE, right?

5. jardows: What all would change from your post with step-by-step instructions for installing Xfce if I were to instead install KDE?

6. jardows: By the way, my computer has integrated Intel graphics, so I take it I would add kld_list="/boot/modules/i915kms.ko" to /etc/rc.conf?

7. jardows: In comparing the instructions I posted on my blog <https://www.linuxphoto.com/2019/06/25/how-i-installed-xfce-on-freebsd/> to your instructions, I have some questions.
7.1) Why do you not follow 4.4.1. Getting Started with pkg in the FreeBSD Handbook to bootstrap the system by running the following command: # /usr/sbin/pkg?
7.2) Why do you install sddm?
7.3) Is sddm_enabled="YES" necessary in /etc/rc.conf because you installed sddm?
7.4) Should you have started the /etc/rc.conf lines by entering # service dbus start?
7.5) Should I follow the order of steps you provided, or will the order on my blog work as well?
7.6) Do you think your step 5 would be necessary for KDE? The line in ~/.xinitrc you’re talking about to start Xfce was not in my tutorial, but I see you mention it and it is in the Handbook as well. What is it for, and why was I able to use startx to start Xfce without it? I see the Handbook also says to add a line to that file for KDE.

8. astyle: You were able to set up KDE following only the instructions in the Handbook? I will consider doing the same. Some questions:
8.1) Should I still follow 4.4.1. Getting Started with pkg in the FreeBSD Handbook to bootstrap the system by running the following command: # /usr/sbin/pkg?
8.2) Why doesn’t the Handbook have you run # pkg install drm-kmod (note: it may have been covered in an earlier part of the Handbook)?
8.3) Why doesn’t the Handbook have you enter kld_list="/boot/modules/i915kms.ko" in the file /etc/rc.conf (note: it may have been covered in an earlier part of the Handbook)?
8.4) Why doesn’t the Handbook have you start the /etc/rc.conf lines by entering # service dbus start?
8.5) Why doesn’t the Handbook have you enter # kldload /boot/modules/i915kms.ko?

9) grahamperrin: Do you think I should follow the Handbook or KDE’s official setup <https://community.kde.org/FreeBSD/Setup#Quick_start>?
9.1) If I choose to follow KDE’s official setup do I just do the following:
9.1.1) Follow 4.4.1. Getting Started with pkg in the FreeBSD Handbook to bootstrap the system by running the following command: # /usr/sbin/pkg
9.1.2) Then enter # pkg install drm-kmod
9.1.3) Enter the easy editor to edit the file /etc/rc.conf by entering the following command: # ee /etc/rc.conf
9.1.4) Once in the easy editor, on a new line, enter the following: kld_list="/boot/modules/i915kms.ko"
9.1.5) Then just follow what’s under the heading “KDE and the rest”?
9.1.5.1) pkg install -y kde5 sddm xorg
9.1.5.2) sysrc dbus_enable="YES" && service dbus start
9.1.5.3) sysrc sddm_enable="YES" && service sddm start
9.1.5.4) When logging in, avoid the Plasma (Wayland) … default that's presented by sddm – for Plasma, Wayland is not yet reliable.

I think what I am looking for is complete instructions for setting up KDE after installing FreeBSD. Basically, I am looking for the same instructions I have on my blog <https://www.linuxphoto.com/2019/06/25/how-i-installed-xfce-on-freebsd/> (assuming they are correct) but this time for KDE. Again, any help is much appreciated. I must apologize for needing every step spelled out, but I am a veritable noob!
 
/usr/sbin/pkg

You can skip that step. Bootstrapping will occur when, for example, you pkg install drm-kmod

The formatting of the page is beyond my control (there's insufficient distinction between heading levels) but essentially, the quick start ends with step 4 of KDE and the rest.
 
1. mark_j: So I can just remove the USB stick when I see the “sync” message just before the reboot? What exactly is this message?
I'm sorry but I don't know the exact message.
The same time it took me to reboot a VM with FreeBSD could have been taken by you to see what the message is.
I'm all for helping, but...

Anyway, it's something like "Syncing disks".


BUT, as I said, just set your USB as the secondary boot device and this is a non-issue. Also, regardless, just pulling the USB out when you type reboot/shutdown-r is fine, it's read-only anyway.


2. mark_j: I’m not talking about being unable to restart via the desktop (which I also couldn’t do) but via the command line. Do you know why shutdown -p now worked, but shutdown -r now did not?

You obviously typed something wrong. They both work as expected.
 
8. astyle: You were able to set up KDE following only the instructions in the Handbook? I will consider doing the same. Some questions:
8.1) Should I still follow 4.4.1. Getting Started with pkg in the FreeBSD Handbook to bootstrap the system by running the following command: # /usr/sbin/pkg?
8.2) Why doesn’t the Handbook have you run # pkg install drm-kmod (note: it may have been covered in an earlier part of the Handbook)?
8.3) Why doesn’t the Handbook have you enter kld_list="/boot/modules/i915kms.ko" in the file /etc/rc.conf (note: it may have been covered in an earlier part of the Handbook)?
8.4) Why doesn’t the Handbook have you start the /etc/rc.conf lines by entering # service dbus start?
8.5) Why doesn’t the Handbook have you enter # kldload /boot/modules/i915kms.ko?
To answer your questions:
8.1) That depends on whether you plan to go with packages or ports. In your case, I would recommend going with packages for best results. To 'bootstrap the # /usr/sbin/pkg', all you need to do is run pkg install first-package, where first-package can be anything (I recommend editors/nano). The bootstrapping of pkg happens automatically.
8.2) and 8.3) Handbook's section 5.4.5 do provide some hints about recent GPU's, but I have to admit, Handbook is the place to start reading. Don't expect very complete information when it comes to hardware support. I stumbled on the wiki by accident, just googling around back in 2017. Doing your homework on FreeBSD hardware support does take some skill in connecting the dots, and please feel free to ask here on the forums for additional help!
8.4) It does, in Section 5.7 Desktop Environments. But, you enter not # service dbus start into /etc/rc.conf, but dbus_enable="YES". Paying attention to details like that is a difference-maker.
8.5) There's no need to run # kldload /boot/modules/i915kms.ko if you have the kldlist line in /etc/rc.conf as per the wiki.

Hope this helps. :)
 
Back
Top