root user, graphical programs

Michael Powell nightrecon at
Fri May 15 19:12:29 UTC 2009

Pieter Donche wrote:

> FreeBSD 7, KDE 3.5
> To install Matlab (in linux compat mode), one must execute the
> matlab install program as root. The installer is graphical.
> When from a KDE terminal window, I switch to root (# su -)
> and try a graphical program, e.g.  # xpdf, I get Can't open display.
> The FreeBSD handbook (10.5.1) says in that case type setenv HOME ~USER
> (USER the username where the su command was given). This doesn't help
> I still get Can't open display.
> What's wrong and how to solve it?

Since you're using KDE there is an easy way. Type kdesu xpdf at the prompt
in a terminal (konsole for example) and it will pop up a box asking for the
root password. This is the canonical method of starting graphical programs
under KDE as root. It is the same mechanism as setting the property "Start 
as other user" to root when editing an icon's settings. The former is best
suited for ad hoc impromptu one off situations, while the latter would be
for making permanent changes to how clicking an icon behaves.


More information about the freebsd-questions mailing list