Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 01-28-2004, 11:03 AM   #1
LQ Newbie
Registered: Sep 2002
Distribution: Redhat 7.2
Posts: 23

Rep: Reputation: 15
Question Is it possible to startX on boot without logging in?

I am playing around with an old laptop. It is more of a toy than anything at this point. What I am trying to do is get it to start X windows after booting. Easy enough - the tricky part is I don't want to have to login. I want it to start X, then run a script. I set my script to start on runlevel 4 and then changed the init runlevel to 4, but it can't start X. Or at least it can't the way I started it.

Does anyone know if this is possible or where some references that might help are? I've done a bit of reading about the xdm process, but it isn't clear that there is a way to either autologin or to make logins unnecessary.

Old 01-28-2004, 12:02 PM   #2
Registered: Nov 2002
Posts: 668

Rep: Reputation: 30
I've not heard of that specific situation. However, technically speaking, X is running when you reach the graphical login screen.

Also, I know that there are ways to automatically log in a certain user, without having to enter said user's password. you might want to look into that to see if it would meet your needs.
Old 01-29-2004, 09:40 AM   #3
LQ Newbie
Registered: Sep 2002
Distribution: Redhat 7.2
Posts: 23

Original Poster
Rep: Reputation: 15
Right, X is running if the init runlevel is 5. I had assumed, maybe incorrectly, that it would be easier to use a runlevel 3 or 4 and then start the x server manually. One possibility that I am loathe to try is just installing gdm and booting to runlevel 5. I understand built into gdm is the ability to autologin a particular user. I'm loathe to do it because there is a fair amount of bloat with gdm that will never be used on this toy of a pc and since it is currently pretty bare-bones, it will probably be a pain to install. But I guess it is an option if nothing else works out.

One suggestion was to create a dummy user ("idiot") and run the following command from the rc.local script:
su - idiot -c "startx > /dev/console 2>&1" &

an alternate suggestion was to edit rc.local and idiot's .bash_profile.
echo "Autologin of user idiot."
cd /home/idiot
su - idiot

if [ "`tty`" = "/dev/console" -o "`tty`" = "/dev/tty0" ]

Unfortunately, both fail. Even executing either command from the command line fails. For example, as root, running 'su - idiot -c "startx"' will fail with the following error:

Fatal Server Error:
PAM authentication failed, cannot start X server,
Perhaps you do not have console ownership


That error is the same if either method (which are virtually the same) is run from rc.local . If run at startup, the error is proceeded by "-bash: no job control in this shell".

I have had some success from the command line with:
su - idiot -c "xinit /usr/bin/<program I want to autostart>"

However when I put it into the rc.local script, the same PAM error occurs. I'm going to read up on PAM and 'su'. Does anyone have any insight?

Old 01-29-2004, 02:23 PM   #4
Registered: Jun 2003
Distribution: Fedora Core 5
Posts: 100

Rep: Reputation: 15
I bet it has NOTHING to do with PAM.

check that idiot can write to /tmp, check idiot's home directory, make sure he can write there.

make sure there's enough free space on /tmp and ~idiot.
Old 02-02-2004, 07:42 AM   #5
LQ Newbie
Registered: Sep 2002
Distribution: Redhat 7.2
Posts: 23

Original Poster
Rep: Reputation: 15
I did check on the /tmp var as well as the free space, everything looked normal. In fact startx always worked for 'idiot' from the command line on runlevel three.

It seems I was mistaken about gdm. I was able to install it without install all of the bloat of the Gnome window manager. So I installed gdm to start up X in runlevel 5, then I set the autologin gdm feature to login to the user 'idiot'. Alls working now.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Run 'startx' on boot? Mezza9 Slackware 16 12-02-2005 01:18 AM
Logging Console Boot Messages candyman123 Linux - General 5 06-19-2005 03:38 PM
Boot up logging jerryvb Slackware 10 06-17-2005 07:38 AM
How do I turn off startx a boot up? gw1500se Mandriva 4 03-13-2004 08:32 PM
startx upon boot redhat8.0 bax Linux - Distributions 2 03-17-2003 09:35 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:27 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration