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

Here, without editing the file:
I have installed

Code:
pkg install plasma5-sddm-kcm
pkg install sddm-freebsd-black-theme

I tried to change the sddm theme through the graphical menu
1634752329981.png

After restarting the session, the theme of the sddm invitation has not changed.

(That's why I asked how to determine what is applicable on freebsd when viewing information on resources like https://userbase.kde.org/Welcome_to_KDE_UserBase or https://docs.kde.org/. For now, as an option, create a separate snapshot of the virtual machine called "Settings Game” and periodically check any controversial options on it)

Then I did the following in the Kate editor –

sudo sddm --example-config > /usr/local/etc/sddm.conf

Got a message - Permission denied Why?

I did the same thing only through su -

# sddm --example-config > /usr/local/etc/sddm.conf

Now I got the file /usr/local/etc/sddm.conf. In it I changed the

Code:
[Theme]
# Current theme name
Current=breeze

On

Code:
[Theme]
# Current theme name
Current=sddm-freebsd-black-theme

After restarting the session, I got a black eran. If you click on it in the upper part of the mouse, the login window appears, but after clicking in the password field, the black screen appears again. However, if you enter the user's password (blindly), then KDE loads. Strange behavior.

What was the default works fine.

… doesn't belong in a guide to installing KDE Plasma ;-)
Maybe so. But given the context and the name of this topic, which concerns not only KDE but the desktop in general, a reminder is necessary for the purpose of its further use.
I'm a little confused by fdesc. Judging by the name, this is related to floppy disk drives. Does anyone use floppy disks now? My motherboard doesn't even have an interface to connect them.
 
Looks like VNC is the drop-in replacement for Xorg in your case.
Absolutely. But that is why the KDE package doesn't have a hard dependency on Xorg. Because there are a number of different Xservers a user might want to use instead.
Edit: Even without Xorg installed on localhost, KDE cannot run without X11 forwarding on SSH, either. :p
KDE pulls in Qt which pulls in libX11 which is generally all that is needed for X11/SSH forwarding. Possibly it needs the xauth package too but I already have that from the VNC server dependency (I find VNC works a little faster than SSH/X11 for heavy UI toolkits).
 
GVitaliy : it takes root access to change the SDDM theme via the KCM module. On FreeBSD, I found kdesu it to be an unreliable proposition. I decided not to bother with SDDM themes as a result.

It also takes root access to edit the system-wide config files for SDDM. The ones in user home directory have no effect on the theme that you see once booted up.
 
And don’t sddm (and other login managers) run as root? I thought that was one of the arguments against them, from a security perspective anyway.
I make sure to tell tell people to create their ~/.xinitrc file from their usr account so they're not running x11-wm/fluxbox as root.
 
After a short break, I've reread the first three chapters of Absolute FreeBSD and the first two chapters of the Handbook. Now, I'll just dive right into some questions I have before I attempt to install KDE. After looking at my questions, please look at my instructions that follow, looking for any errors.

--------------------
Questions:

Q1. According to this reply from jardows, I need to have my “main user part of the operator, wheel, and video groups.” Do you know why this is? I think in my first install my main user was just part of the wheel group, as suggested in the book Absolute FreeBSD. If I need to have the main user part of the other two groups, what is the syntax for entering multiple groups? When setting up a user during the install, do I just type operator wheel video (note that there aren’t commas)?

Q2. In the same reply (see above link), I’m told to run as root startx before running sddm or adding a line to start Xfce in the file ~/.xinitrc. Once one sees X has started, one is supposed to immediately exit. This step supposedly automatically configures Xfce; if it’s not followed, the power buttons supposedly won’t work without additional configuration. In a follow-up post, the same user clarifies that he runs into problems with reboot and shutdown options not working if he doesn’t startx before running the Xfce environment. While I’m not planning on using sddm anymore (I’ll just start Xorg with startx)--and I am planning on using KDE not Xfce--should I still follow this step?

Q3. In two replies (here and here), mer says to mount /dev/fd and /proc by adding the following two lines to /etc/fstab:
fdesc /dev/fd fdescfs rw 0 0 proc /proc procfs rw 0 0
In the Handbook, I see /proc should be mounted, but I don’t see anything about /dev/fd. Does anyone know what this second file is and if I should mount it as well? According to GVitaliy, judging by the name, fdesc concerns floppy disks. If this is the case, I take it most people don’t need the first line. Please confirm.

Q4. Related to the last question, I’m just not sure how I should type out the above two lines. According to mer in another post, typically Tab characters are used, but a single space between each field will also work. So can I just press Tab after entering each field?

Q5. Sevendogsbsd mentioned I should get Xorg running first without a login manager or desktop environment. This sentiment was echoed by kpedersen. While I am no longer using a login manager, I am using a desktop environment. How would following this advice change my instructions below, if at all?

Q6. Because of questions raised by GVitaliy in addition to security concerns raised by Sevendogsbsd here, I think I am going to go without sddm and instead use startx. Will this really simplify the installation process and add security?

Q7. Trihexagonal says to create the file ~/.xinitrc from your usr account so you’re not running x11-wm/fluxbox as root. Does this apply to my instructions below? If so, what should I change?

--------------------

Instructions for Installing KDE on FreeBSD (Rough Draft #2)

In this second rough draft of instructions, I will show you how to install KDE that will be started with the command startx. My first rough draft of instructions shows you how to install KDE that is started by sddm.

I1. Enter the superuser/root account by entering % su and the password for the root account. Note that the command prompt on the shell (%, $, #, etc.) is dependent on what user is currently logged in. Therefore, the % should not actually be typed out. Once in the root account, the command prompt will be #.

I2. Run # pkg install xorg

I3. Run # pkg install kde5 drm-kmod firefox

I4. Enter the easy editor to edit the file /etc/fstab by entering the following command: # ee /etc/fstab

I5. Once in the easy editor, on new lines, enter the following two lines (you can push the Tab key or spacebar after entering each field):
fdesc /dev/fd fdescfs rw 0 0 proc /proc procfs rw 0 0
(See post #33. There is debate on whether this instruction should be included; I am including it because it may be beneficial for those who want to run applications such as LibreOffice.)

I6. Make sure to hit Enter so the file starts on a new line after saving.

I7. Save and exit the easy editor by pushing Esc and following the prompts to save and exit.

I8. Run # mount /dev/fd

I9. Run # mount /proc

I10. Enter the easy editor to edit the file /etc/rc.conf by entering the following command: # ee /etc/rc.conf

I11. Once in the easy editor, on a new line, enter the following line:
Code:
kld_list="/boot/modules/i915kms.ko"

I12. Make sure to hit Enter so the file starts on a new line after saving.

I13. Save and exit the easy editor by pushing Esc and following the prompts to save and exit. The KMS driver should now be set up.

I14. Go ahead and load the drm driver. Run # kldload /boot/modules/i915kms.ko

I15. Enter the easy editor to edit the file /etc/rc.conf by entering the following command: # ee /etc/rc.conf

I16. Once in the easy editor, on a new line, enter the following line:
Code:
dbus_enable="YES"

I17. Make sure to hit Enter so the file starts on a new line after saving.

I18. Save and exit the easy editor by pushing Esc and following the prompts to save and exit.

I19. Run # service dbus start

I20. Enter the easy editor to edit the file ~/.xinitrc by entering the following command: # ee ~/.xinitrc

I21. Once in the easy editor, on a new line, enter the following line:
Code:
exec ck-launch-session startplasma-x11

I22. Make sure to hit Enter so the file starts on a new line after saving.

I23. Save and exit the easy editor by pushing Esc and following the prompts to save and exit.

I24. Reboot by running # shutdown -r now

I25. If you chose not to reboot, enter # exit to leave the superuser account.

I26. If everything worked, you should see the KDE desktop after running % startx as a regular account.

--------------------

Thanks again to everyone who contributed to this thread. Your help has allowed me to write this rough draft of instructions and (I hope) get a proper FreeBSD desktop. One thing I can say honestly is that reading through all these messages (multiple times) has helped me understand what each of these instructions do. It no longer seems like a bunch of gobbledygook. I will attempt to install FreeBSD and KDE soon once I get all of these kinks (the questions) figured out.
 
Last edited:
man -k fdescfs
fdescfs(5) - file-descriptor file system

man fdescfs
The file-descriptor file system, or fdescfs, provides access to the per-
process file descriptor namespace in the global file system namespace.
The conventional mount point is /dev/fd.


Not Floppy Disk, fd is File Descriptor.

It exposes file descriptors (the value returned from an open/fopen call) via the standard /dev interface.
 
Scribner if you include instructions that are not necessary for KDE, please make clear that they're not necessary. This will help to avoid future confusion when people read contradictory information.
 
Q1. just type operator wheel video (note that there aren’t commas)
Just follow the Handbook for this one. See my post earlier in this thread (#23) for more information.
Just follow the Handbook on this one. Same KDE Setup section.
Yes
Those two (Sevendogsbsd and kpedersen ) are grizzled UNIX gurus with their own ideas about how things SHOULD be run. Those ideas are based on sound security fundamentals. Unfortunately, those ideas are not suitable for a beginner audience (users who need to get a system up and running first, and THEN worry about security).
No, that won't simplify the install process. You either simplify OR add security, but not both at the same time.
That doesn't apply. SDDM doesn't need .xinitrc. Just follow the Handbook's instructions, the same KDE setup section I keep pointing you to.
 
Q5. Sevendogsbsd mentioned I should get Xorg running first without a login manager or desktop environment. This sentiment was echoed by kpedersen. While I am no longer using a login manager, I am using a desktop environment. How would following this advice change my instructions below, if at all?
This advice was mainly to get things working first. If there are issues, a login manager will just keep flickering, failing to start and not give you nearly as useful feedback to the console (it then makes it hard to get help on forums if you can't give the useful information hidden by the failing login manager).

Once you have Xorg working, there is nothing wrong with a login manager if you like that from now on.
 
man -k fdescfs
fdescfs(5) - file-descriptor file system

man fdescfs
The file-descriptor file system, or fdescfs, provides access to the per-
process file descriptor namespace in the global file system namespace.
The conventional mount point is /dev/fd.


Not Floppy Disk, fd is File Descriptor.

It exposes file descriptors (the value returned from an open/fopen call) via the standard /dev interface.
Thank you for clarifying. It sounds like /dev/fd is something I want to mount then. Would you be able to share where you were told to mount /dev/fd?

Scribner if you include instructions that are not necessary for KDE, please make clear that they're not necessary. This will help to avoid future confusion when people read contradictory information.
Thanks. I take it you're talking about mounting /dev/fd and /proc again. That is why I made sure to include this note under the instructions for this part: "There is debate on whether this instruction should be included; I am including it because it may be beneficial for those who want to run applications such as LibreOffice." I think saying there's a "debate" about these instructions implies they are not necessary.

Just follow the Handbook for this one. See my post earlier in this thread (#23) for more information.
This is your response regarding my questions Q1 and Q2. Regarding Q1, before I install FreeBSD I need to know if my main user should also be a part of just the wheel group, of if it should be a part of the operator, wheel, and video groups, as @jardows suggests. The Handbook, like the book Absolute FreeBSD, just has the main user also be a part of the wheel group. But I'm not sure if the other groups are needed for running a desktop environment or some other reason. I hope someone can answer this question.

Regarding Q2, I don't see anything in the Handbook about running # startx as root before entering Xfce to get the power and restart buttons to work. Also, I will be using KDE, not Xfce. I hope jardows or someone else can answer this question.

I believe what you're talking about in your earlier post (#23) is just to use the Handbook in addition to outside information. That is good advice. And that is what I am doing--using the Handbook and seeking outside information in the book Absolute FreeBSD and these forums.
Just follow the Handbook on this one. Same KDE Setup section.
Regarding Q3, the Handbook says to mount /proc, but it doesn't say anything about mounting /dev/fd. Because mer says to mount /dev/fd (see above in this reply), I think I will do it. If anyone can say why I should not do this, I am certainly open to changing my mind.

Regarding Q4, I suspected the Tab key will work in addition to the spacebar. Thanks for confirming.

Those two (Sevendogsbsd and kpedersen ) are grizzled UNIX gurus with their own ideas about how things SHOULD be run. Those ideas are based on sound security fundamentals. Unfortunately, those ideas are not suitable for a beginner audience (users who need to get a system up and running first, and THEN worry about security).
Regarding Q5, thanks for the info. It sounds like I don't need to worry about this step. In these instructions, I did make sure to run # pkg install xorg first before installing KDE and the other packages because I thought that was something that would be beneficial. I'm not sure if it makes any difference, but that is how my instructions currently look.

No, that won't simplify the install process. You either simplify OR add security, but not both at the same time.
Regarding Q6, so are you saying doing without SDDM and instead starting KDE with startx will add security?

That doesn't apply. SDDM doesn't need .xinitrc. Just follow the Handbook's instructions, the same KDE setup section I keep pointing you to.
Regarding Q7, please read my post/instructions again. I am no longer using SDDM, but starting KDE with startx. Therefore, I still need to know if I should create the ~/.xinitrc file from my usr account rather than root. If someone could confirm, that would be great.

Thanks for all your help.

This advice was mainly to get things working first. If there are issues, a login manager will just keep flickering, failing to start and not give you nearly as useful feedback to the console (it then makes it hard to get help on forums if you can't give the useful information hidden by the failing login manager).

Once you have Xorg working, there is nothing wrong with a login manager if you like that from now on.
Thanks for your reply. So did your advice mostly pertain to the use of login managers like SDDM? I am no longer using SDDM--instead, I'm planning on starting KDE with startx--so can I disregard your advice?
 
Thank you for clarifying. It sounds like /dev/fd is something I want to mount then. Would you be able to share where you were told to mount /dev/fd?
I can't point to it specifically, but it was in a package message after I pkg installed something. "what" I don't recall but the procfs was mentioned in the same message.
 
I do recommend SDDM, it will make your life easier if you get it to work.
This is your response regarding my questions Q1 and Q2. Regarding Q1, before I install FreeBSD I need to know if my main user should also be a part of just the wheel group, of if it should be a part of the operator, wheel, and video groups, as @jardows suggests. The Handbook, like the book Absolute FreeBSD, just has the main user also be a part of the wheel group. But I'm not sure if the other groups are needed for running a desktop environment or some other reason. I hope someone can answer this question.
Yes, you do need to have the regular user be a member of operator, wheel, and video. Simplest way to do it is to add the user to those groups at install, as suggested earlier in the thread. But if you missed that, it's not a complete deal-breaker, but you will have to study pw(8) manual page to put together the proper command to add the regular user to those groups. I can give (a rather incomplete) rundown of why each and every one of those groups is important:
  • wheel. Only members of the wheel group are allowed to run % su root. On your own system, this is kind of essential to have, but not on by default. This is the very minimum you have to have, which is why Handbook actually mentions it. The other two can be added later, but it's easier to add them at the same step, this will save you the headaches later on.
  • operator. This allows you access to the /dev part of the filesystem. This is for mounting USB sticks, CD/DVDs, and to use the sound. I think parts of the graphics stack also require such access.
  • video. This is really important for starting and running Xorg. Without it, you can install the GPU driver, and enable it in rc.conf, but you still won't be able to load it. This directly will lead to Xorg not starting.
 
video. This is really important for starting and running Xorg. Without it, you can install the GPU driver, and enable it in rc.conf, but you still won't be able to load it. This directly will lead to Xorg not starting.
I believe you only need to be in the video group if you want to use hardware accelerated graphics. If you use a video driver with software rendering (e.g. scfb), you don't need to be in that group.

I could be wrong, though.
 
I can't point to it specifically, but it was in a package message after I pkg installed something. "what" I don't recall but the procfs was mentioned in the same message.
I recall seeing both /proc and /dev/fd in a libreoffice message, but not in any kde5 messages. /proc was previously indicated in kde5 messages for older versions, but not in the more recent versions.
 
FWIW, the Handbook actually mentions the importance of operator and video groups:
Section 5.4.1, Quick Start, step 2 actually mentions how you can add regular user to those two groups in one go.
---
Xorg setup comes before KDE setup in the Handbook. This is what I mean by "Follow the Handbook".
 
Q1. According to this reply from jardows, I need to have my “main user part of the operator, wheel, and video groups.” Do you know why this is? I think in my first install my main user was just part of the wheel group, as suggested in the book Absolute FreeBSD. If I need to have the main user part of the other two groups, what is the syntax for entering multiple groups? When setting up a user during the install, do I just type operator wheel video (note that there aren’t commas)?

Q2. In the same reply (see above link), I’m told to run as root startx before running sddm or adding a line to start Xfce in the file ~/.xinitrc. Once one sees X has started, one is supposed to immediately exit. This step supposedly automatically configures Xfce; if it’s not followed, the power buttons supposedly won’t work without additional configuration. In a follow-up post, the same user clarifies that he runs into problems with reboot and shutdown options not working if he doesn’t startx before running the Xfce environment. While I’m not planning on using sddm anymore (I’ll just start Xorg with startx)--and I am planning on using KDE not Xfce--should I still follow this step?
For Q1: The syntax you used is correct. The other part of the question was well answered by astyle

For Q2: I haven't installed KDE for so long, I don't really know if it applies there. If I get a chance, I'll spin up a VM and try it to confirm.
 
Regarding Q6, so are you saying doing without SDDM and instead starting KDE with startx will add security?
I'd suggest not worrying about 'security' for now. There is an idea of 'security by obscurity', which is what swapping SDDM for startx will accomplish. There are a few helpful ways to think about computer security - such as protecting users from their own mistakes, or not allowing devices from outside your home network to connect to your web server. It takes connecting the dots between such ideas and tools available in FreeBSD to accomplish those ideas. For now, I'd suggest getting stuff to line up so that you get Xorg to work.
 
I am no longer using SDDM--instead, I'm planning on starting KDE with startx--so can I disregard your advice?
Cool, I do it the same way (via startx). So yes, just make sure you have a .xinitrc file in your $HOME directory. This is the one that startx (actually xinit behind it) runs. The .xsession is not needed if you do startx.
 
Regarding Q5, thanks for the info. It sounds like I don't need to worry about this step. In these instructions, I did make sure to run # pkg install xorg first before installing KDE and the other packages because I thought that was something that would be beneficial. I'm not sure if it makes any difference, but that is how my instructions currently look.
It does make a difference to install Xorg before installing KDE. That is not explicitly specified in KDE's packages for a reason (Trying to move from Xorg to Wayland), but it doesn't change the fact that without Xorg, KDE (Or most other desktops) won't run.
 
It does make a difference to install Xorg before installing KDE.
It can be after too. The whole point of a package system is that it will drag in the dependencies it needs. However to see KDE, you will ultimately need some sort of display system (Xorg, Xvnc, SSH/X11 or Wayland, etc).
That is not explicitly specified in KDE's packages for a reason (Trying to move from Xorg to Wayland)
That is not entirely the reason. The reason is because there are many different type of display systems that can render KDE. It would be incorrect to dictate a specific one and hard-code it into the package dependencies.
 
Back
Top