The command in a root terminal is dbus-launch kwrite
I've just made an interesting discovery.
The problem I reported occurred when using a 'Terminal - Super User Mode' session, and "dbus-launch..." also fails there!
On the other hand, if I use a normal user Konsole session, I can 'su - root' then 'kwrite /etc/fstab' with no problem.
So all I have to do is stop using 'Terminal - Super User Mode' (an icon I found in PC/More Applications/Terminals)...
Many thanks for everyone's help in here. Much appreciated!
a) user terminal: 'su - ' and then 'kwrite /etc/fstab' works fine. You do not need to specify 'su - root' because 'su - ' without a user name specified defaults to user "root". However, it is good practice to use the hyphen after 'su' in order to start the users login shell
. Some more info on this can be googled or is found in wikipedia
b) The 'Terminal - Super User Mode' provides a root terminal without
the server access control program for X. The xhost program is used to add and delete host (computer) names or user names to the list of machines and users that are allowed to make connections to the X server. If X-server access is not granted then the new user can not start any
GUI-application. Finally, enabling X-server access (allow: +
or prohibit: -
(default)) must of course be done by the session-owner of the current session, which when you are logged into you user-account, is you, the user. For example, if you are logged into your user-account, then open the 'Terminal - Super User Mode', provide your root-pwd, and then enter in this root-terminal "kwrite", it will not work. Next, open a normal konsole and enter "xhost +", then go back to your root-konsole and enter again "kwrite" (or "dbus-launch kwrite") which will now work because you have now given X-server access to the user "root" and hence root can start any GUI-application on your (the user's) X-server.
Ok, that was a bit long-winded but hopefully nevertheless helpful