Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I need help please?
I need to run a GUI program in centos 6.4 terminal. It’s written in QT4. I have installed all the qt4 libraries. When I run the program I’m getting this error App: cannot connect to X server. How do I solve this?
Many thanks
Sathees
[...]
App: cannot connect to X server. How do I solve this?
[...]
First, have you tried the obvious solution: start the X-server on you terminal.
Now, if, instead, you meant to ask "How can I run a program that requires a running X-server without a running X-server?" Well, then, I think that the answer should be fairly clear.
There are X-server emulators that can run on "pure" terminals, but I don't think that any of them support QT applications. (I haven't researched that point.)
If you are running a graphical desktop and you are getting that error, it may be that the application is not authenticated to the satisfaction of the xserver.
As user, in a terminal, issue the command: xhost +localhost. Then try to run the application.
Read up on the use of xauth and xhost for more information.
When I try startx command its opening desktop.
What I’m looking for is, I’m trying to build POS (touch screen till) system for my friend. When user turn the till on its have to open POS software automatic in other word the desktop screen have to blank no menus or the panel.
I have to manage to auto start the POS program.
Any advice and guidance will be grade full.
Also can you advice me the best Linux distros for 1GHZ processor?
When I try startx command its opening desktop.
What I’m looking for is, I’m trying to build POS (touch screen till) system for my friend. When user turn the till on its have to open POS software automatic in other word the desktop screen have to blank no menus or the panel.
I have to manage to auto start the POS program.
Any advice and guidance will be grade full.
Also can you advice me the best Linux distros for 1GHZ processor?
Many thanks
Sathees
I'm sorry I still really don't understand your question as well, but you need to have a X Server always running as it sounds. Xorg is the popular one but there are some light X Servers they may work for you.
As for a Distro that runs on a low end system. Debian, Slackware run on low end system with no problem. Both are for more advanced users, but slackware requires deeper depth in knowledge than Debian.
I run Debian on a P3 128MB Ram as a File server and it works out great.
Have you looked at the manual pages? man startx, man Xorg, and man Xinit all discuss methods for having a system boot the X-server and then start a specific program. Usually the "specific program" is a desktop management system, but that's not necessary.
You might also want to look at the Xclients files on you system.
Here's a Fedora default "general purpose" one, as an example of how it's done:
Code:
$ cat /etc/X11/xinit/Xclients
#!/bin/bash
# Copyright (C) 1999 - 2004 Red Hat, Inc. All rights reserved. This
# copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the
# GNU General Public License version 2.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
GSESSION="$(type -p gnome-session)"
STARTKDE="$(type -p startkde)"
# check to see if the user has a preferred desktop
PREFERRED=
if [ -f /etc/sysconfig/desktop ]; then
. /etc/sysconfig/desktop
if [ "$DESKTOP" = "GNOME" ]; then
PREFERRED="$GSESSION"
elif [ "$DESKTOP" = "KDE" ]; then
PREFERRED="$STARTKDE"
fi
fi
if [ -n "$PREFERRED" ]; then
exec "$PREFERRED"
fi
# now if we can reach here, either no desktop file was present,
# or the desktop requested is not installed.
if [ -n "$GSESSION" ]; then
# by default, we run GNOME.
exec "$GSESSION"
elif [ -n "$STARTKDE" ]; then
# if GNOME isn't installed, try KDE.
exec "$STARTKDE"
fi
# We should also support /etc/X11/xinit/Xclients.d scripts
XCLIENTS_D=/etc/X11/xinit/Xclients.d
if [ "$#" -eq 1 ] && [ -x "$XCLIENTS_D/Xclients.$1.sh" ]; then
exec -l $SHELL -c "$SSH_AGENT $XCLIENTS_D/Xclients.$1.sh"
fi
# Failsafe.
# these files are left sitting around by TheNextLevel.
rm -f $HOME/Xrootenv.0
# Argh! Nothing good is installed. Fall back to twm
{
# gosh, neither fvwm95 nor fvwm2 is available;
# fall back to failsafe settings
[ -x /usr/bin/xsetroot ] && /usr/bin/xsetroot -solid '#222E45'
if [ -x /usr/bin/xclock ] ; then
/usr/bin/xclock -geometry 100x100-5+5 &
fi
if [ -x /usr/bin/xterm ] ; then
/usr/bin/xterm -geometry 80x50-50+150 &
fi
if [ -x /usr/bin/firefox -a -f /usr/share/doc/HTML/index.html ]; then
/usr/bin/firefox /usr/share/doc/HTML/index.html &
fi
if [ -x /usr/bin/twm ] ; then
exec /usr/bin/twm
fi
}
Notes:
The stuff after the "Argh! Nothing good is installed." comment is what happens if you boot with no window manager defined. The twm ("Tab Window Manager") is a very light-weight window manager, available on almost every distribution.
The above file is actually obsolete, since current Fedora system use systemd to start the X-server and the window manager.
Note, however, the sequence of program start ups. The default applications are started (if they exist) as detached processes, and then script is suspended and control passed to the window manager (the exec command) so it can "handle" resizing, etc.
It's possible that all you'll need is an xinitrc that does an exec <POS_program_name>.
I wrote a program call Hello World in GUI. When I turn on my computer running centos 6.4 I want to see Hello World program open it self. I don’t want see any of the OS menus or any think in the desktop other than Hello World app open.
At first, X and a desktop environmenment or window manager are not the same. You can run an X server without running a DE/WM and it seems that this is exactly what you want to do.
This is as easy as putting a file named .xinitrc in the home directory of your user with this line in it:
I have managed to do it.
* I install minimum desktop
* Install qt4 libraries (because the program written in QT4)
* Disable auto login in to Desktop (edit /etc/inittab)
* Then auto start up program via /etc/rc.local
That’s it
If any body need more information
I’m happy to help because I’m leaner to
Many thanks
Sathees
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.