星期六, 三月 14, 2009

[SOLVED] Cannot connect to X Server

在debian下,准备编译内核,在linux源码目录下面输入:

# make xconfig
scripts/kconfig/qconf arch/x86/Kconfig
qconf: cannot connect to X server
make[1]: *** [xconfig] 错误 1
make: *** [xconfig] 错误 2

因为是使用非root用户登录的X Window,所以使用该用户在term下输入:

$ xhost +
access control disabled, clients can connect from any host

su - 到root用户,再次 make xconfig:

# make xconfig
scripts/kconfig/qconf arch/x86/Kconfig
qconf: cannot connect to X server
make[1]: *** [xconfig] 错误 1
make: *** [xconfig] 错误 2

这是因为DISPLAY输出未设定:

# export DISPLAY=:0.0

再次运行即可看到正确的图形界面了!