3

It is my second day in *nix world and search didn't help me to solve my issue. This question here is not relevant either.
I installed FreeBSD 11 and I installed KDE.

pgk install kde

I tried to run it like

startkde

but turns out that I also need X server to run a UI. Ok. So I installed it like

 pgk install xorg

Now I'm running X with "startx" and then I'm running KDE with "startkde" and I'm getting

Could not start d-bus. can you call qdbus?

enter image description here

How I can call qdbus? What's that?

Update 1

As was suggested I edited rc.config and added

dbus_enable=YES

result is the same enter image description here

Update 2

I followed §5.7.2 of a handbook and /proc was mounted by adding this line to /etc/fstab:

proc           /proc       procfs  rw  0   0

/etc/rc.conf was edited and now has three lines:

dbus_enable="YES"
hald_enable="YES"
kdm4_enable="YES"

Now if I'm running startkde I'm getting error:

"display is not set or cannot connect to x server" 

I found somewhere that I need to execute

type plasma-desktop #kde4

to check if plasma-desktop is installed, and looks like it is fine. Not sure about kde. Here it is:

enter image description here

Pavel Kovalev
  • 133
  • 1
  • 6
  • Have you added `dbus_enable=YES` to `rc.conf`? – Richard Smith Oct 03 '17 at 20:58
  • @RichardSmith I did it as you suggested, no luck yet (I updated my answer) – Pavel Kovalev Oct 03 '17 at 21:44
  • I'm not sure you can start KDE from inside TWM. Take a look at [section 5.7.2 of the handbook](https://www.freebsd.org/doc/en/books/handbook/x11-wm.html). – Richard Smith Oct 03 '17 at 21:55
  • @RichardSmith I followed 5.7.2 of the handbook. If I'm executing startkde I'm getting "display is not set or cannot connect to x server" – Pavel Kovalev Oct 03 '17 at 22:51
  • The `/etc/machine-id` part will be a separate question, and I actually addressed this as part of an answer at https://unix.stackexchange.com/a/395460/5132 . – JdeBP Oct 04 '17 at 01:40
  • @JdeBP How is machine-id relates to qdbus? Do I need to re-generate it or smth? – Pavel Kovalev Oct 04 '17 at 02:14
  • If you have `kdm4_enable="YES"`, then X server should start with system boots. If it doesn't there is a problem with it, check `/var/log/Xorg.0.log` – arrowd Oct 04 '17 at 05:06

2 Answers2

0
Failed to open "/etc/machine-id": No such file or directory
Option `--autolaunch' requires an argument.
Abort trap (core dumped)
startkde: Could not start D-Bus. Can you call qdbus?

Really, if the error message asks you whether you can run the qdbus tool, you should be asking a question that tells the world what happened when you ran the qdbus tool. This question in the error message is there for a reason.

That said, there is enough here to know what is going on, and running qdbus manually will largely only confirm what this already tells us.

You do not have an /etc/machine-id file. As I said in question comments, that is a separate question all in itself. See "Missing /etc/machine-id on FreeBSD/TrueOS/DragonFly BSD et al" and its further reading.

The problem here is that the fallback behaviour of D-Bus is malfunctioning. It is not falling back to non-systemd mechanisms at all.

There are two Desktop Bus brokers in a system running a desktop environment like GNOME or KDE. You have started the system-wide one that runs as the superuser with the dbus_enable="YES" setting in /etc/rc.conf. But you also need another per-user or per-session one that runs as the logged-in user, for these desktop environments to work. They contact the per-user or per-session broker, not the system-wide broker. They do this by being invoked with the location of that per-user or per-session broker passed to them as an environment variable.

startkde is trying to run dbus-launch to achieve this, expecting it to run a Desktop Bus broker whose location startkde can pass along to the desktop environment. It also attempts to run qdbus itself, which if a broker has not yet been launched will also attempt to run dbus-launch, passing it the --autolaunch option. As you can see from the dbus-launch manual page, this option takes a machine ID as a mandatory option argument. qdbus is trying to obtain this machine ID and pass it as that argument.

You can probably now guess what is happening.

Because qdbus has not managed to obtain a machine ID, because it is only looking in the non-existent /etc/machine-id, it is passing the --autolaunch option with an empty machine ID string to dbus-launch, which is crashing that program, which means that no per-session Desktop Bus broker is started and neither is your desktop environment attached to that broker.

To fix this, simply make /etc/machine-id be a copy of the D-Bus machine ID, using the setup-machine-id tool or move-and-symbolic-link options in the answer to "Missing /etc/machine-id on FreeBSD/TrueOS/DragonFly BSD et al".

You'll be glad to hear that KDE developer Lubos Lunak declared KDE's Desktop Bus broker autostart mechanism to be broken ten years ago, and no-one has since come along with a fix.

Further reading

JdeBP
  • 66,967
  • 12
  • 159
  • 343
0

Generate an xorg.conf configuration file then copy it to your /etc/X11/xorg.conf :

 Xorg -configure

To test it run

Xorg -config xorg.conf.new

To exit press Ctrl+Alt+ Backspace then run:

cp xorg.conf.new /etc/X11/xorg.conf

Also you should have the following line under ~/.xinitrc file:

exec /usr/local/bin/startkde

Make it executable chmod +x .xinitrc

Run startx

GAD3R
  • 63,407
  • 31
  • 131
  • 192