nimdy
Posts: 67
Joined: Sun Mar 04, 2012 2:54 pm

Re: Startx on Boot

Fri Apr 20, 2012 11:05 am

Hi all.

How can I get the Pi to run startx and show me a graphical login when booted? I think it has something to do with rc.local, but i'm not sure the exact command to write.

Thanks.

User avatar
Tass
Posts: 535
Joined: Sat Jan 21, 2012 11:15 am

Re: Startx on Boot

Fri Apr 20, 2012 11:13 am

nimdy said:


Hi all.

How can I get the Pi to run startx and show me a graphical login when booted? I think it has something to do with rc.local, but i'm not sure the exact command to write.

Thanks.



Can you provide us with a but more information?  What distro are your running?  When you start it up, when do you see?

nimdy
Posts: 67
Joined: Sun Mar 04, 2012 2:54 pm

Re: Startx on Boot

Fri Apr 20, 2012 12:36 pm

Sorry, I was typing that as someont was talking in my ear!

I'm using the newest Debian image. With all my confix.txt tweaks I've been making for the display (see troubleshooting board), i've been running startx from the command line to see how the display behaves.

What I would like is to be able to turn the Pi on and automatically start startx and present me with a graphical login screen (rather than wating for the login prompt, typing pi/raspberry, and typing startx).

naicheben
Posts: 344
Joined: Sat Jan 28, 2012 12:28 pm
Contact: Website

Re: Startx on Boot

Fri Apr 20, 2012 1:29 pm

Usually you install mingetty and then in the inittab (all way down) change the line starting with "1:"

into1:2345:respawn:/sbin/mingetty --autologin pi --noclear tty1

And then you have to start X via the command "startx" in a place like .bash_profile (if it exists)
I dont know if it works. Maybe someone can help out were to put the startx.
EDIT: aaaah, sorry, Loginscreen ... I was thinking of autologin.

PS: could you post your config.txt and brand/model of your TV set please (for the wiki)

Chris.Rowland
Posts: 239
Joined: Thu Jan 12, 2012 5:45 pm

Re: Startx on Boot

Fri Apr 20, 2012 1:36 pm

There's another thread that's got some useful info: http://www.raspberrypi.org/for.....lly#p67197

I tried editing /etc/rc.local by adding the line:

startx

just before the last line in the file.

The result seems superficially to be just what's wanted, it goes into LXDE instantly; it just seems a bit too enthusiastic because it doesn't ask for a user or password.  If you log out it asks for these.

So it looks as if it's into LXDE before logging on.  That doesn't seem right.

nimdy
Posts: 67
Joined: Sun Mar 04, 2012 2:54 pm

Re: Startx on Boot

Fri Apr 20, 2012 1:49 pm

I'll be able to post my config.txt when i've done a little more tweaking on it

I've been doing some googling, and I believe I need to install a login manager and change the runlevel to get the results i'm looking for. The problem is though, all search results are from 2005-07, so I dont know if all this config is still nessecary/valid in Debian 6 Squeeze.

It does seem odd that you are able to log straight into LXDE without giving credentials. Does it behave as it should (able to launch programs etc)? Or does it ask for login details when you attempt to launch anything from LXDE?

User avatar
RaTTuS
Posts: 10558
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Startx on Boot

Fri Apr 20, 2012 2:05 pm

you probably need to set Runlevel 5

try

sudo telinit 5

YMMV I dont have one to test
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Startx on Boot

Fri Apr 20, 2012 2:07 pm

The thing is - you're talking about two different things here.  There's a difference between automating the process of logging in and running "startx" and that of running the "graphical login screen", aka XDM.

If you want the former, I have some suggestions (having done various versions ofthis over the years).  If you want the later, I'm not going to be of much help, because I've never seen the point in it (*).

(*) Because if I want Windows, I know where to find it...
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

naicheben
Posts: 344
Joined: Sat Jan 28, 2012 12:28 pm
Contact: Website

Re: Startx on Boot

Fri Apr 20, 2012 4:30 pm

Maybe you canjust install lxdm via apt:

apt-get install lxdm

http://blog.lxde.org/?p=531

Chris.Rowland
Posts: 239
Joined: Thu Jan 12, 2012 5:45 pm

Re: Startx on Boot

Fri Apr 20, 2012 5:04 pm

nimdy said:

I've been doing some googling, and I believe I need to install a login manager and change the runlevel to get the results i'm looking for. The problem is though, all search results are from 2005-07, so I dont know if all this config is still nessecary/valid in Debian 6 Squeeze.

It does seem odd that you are able to log straight into LXDE without giving credentials. Does it behave as it should (able to launch programs etc)? Or does it ask for login details when you attempt to launch anything from LXDE?


It seems to run everything but I suspect that it's running as root rather than as an official user.

I had also googled; the results gave me the impression that there were two ways to start an ide, the runlevel method and by running startx. Using startx seems to require a run manager and one rdm (or something like that) seems to be installed. The instructions I found - which were to edit files or set configuration options - were rather cryptic, the sort that only make sense if you already know what to do.

I'm hoping that my half baked solution will help the experts to come up with a good solution.

All the same, running lxde as root solves a lot of permissions problems when getting things set up.

Bluemerlin
Posts: 57
Joined: Tue Dec 20, 2011 3:41 pm

Re: Startx on Boot

Fri Apr 20, 2012 6:38 pm

I'm not a debian guy myself but to you have an rc.conf in /etc?

If so there will be all sorts of options in there for start up, it may give you the option to set the window manager. if you have installed lxdm you may just be able to enter lxdm in there in the appropriate section.

If it is there and you still aren't sure what to put in, please paste it here and I'll help with the changes.

User avatar
bob_binz
Posts: 441
Joined: Thu Feb 02, 2012 7:58 pm
Location: Stockport, UK

Re: Startx on Boot

Sat Apr 21, 2012 10:28 pm

Maybe I'm missing the point here, but does editing the runlevel in /etc/inittab not give what's being asked for?

i.e. change

# The default runlevel.
id:2:initdefault:

to
# The default runlevel.
id:5:initdefault:

chaz05
Posts: 1
Joined: Wed Jun 27, 2012 1:51 pm

Re: Startx on Boot

Wed Jun 27, 2012 1:54 pm

For anybody else coming along to see how to do this,
bob_binz is correct, I just did it with the debian img
bob_binz wrote:Maybe I'm missing the point here, but does editing the runlevel in /etc/inittab not give what's being asked for?

i.e. change

# The default runlevel.
id:2:initdefault:

to
# The default runlevel.
id:5:initdefault:
for those that need a little more help,

sudo nano /etc/inittab

change id:2:initdefault to id:5:initdefault


This will bring you to a login screen the next time you reboot your RPi

User avatar
bob_binz
Posts: 441
Joined: Thu Feb 02, 2012 7:58 pm
Location: Stockport, UK

Re: Startx on Boot

Wed Jun 27, 2012 3:50 pm

Incidentally, there is a post here:

http://www.raspberrypi.org/phpBB3/viewt ... lly#p90397

where it seems it is frowned upon to use run-level 5 in inittab

Return to “Beginners”