Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I came along the comment (when you type startx => you won't go to KDM or GDM but directly to your standart desktop= KDE,GNOME,...) at http://www.justlinux.com/forum/showthread.php?t=107342 and would like to know what the difference is if any.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

If your system is configured to automatically start GDM or KDM, you're presented with a graphical login screen, where you log in to your session. When you leave this session, it brings you back to the graphical login.

If, instead, you don't automatically start GDM/KDM, you'll usually have a console login. From there, you can log in, and run the command startx to start an X session. When the session starts, X will take it's configuration setting from your local ~/.xinitrc file, or if that doesn't exist, the global xinitrc file, and you'll usually end up with a standard X desktop.

However, if you want to start a (for example) Gnome session automatically when you startx, you can edit your personal .xinitrc file to read exec /usr/bin/gnome-session. Then when you startx, a Gnome desktop session will start, bypassing the graphical login screen, since you are already logged in. When you exit this session, the desktop session will end, and you'll be returned to your console login.

Sometimes it's handy to not have Gnome/KDE/etc. start automatically, in which case configuring it this way is a good compromise. For example, a live-cd such as grml doesn't really need a graphical environment for most tasks, but it's there if you need it.

share|improve this answer
    
Thanks Joe Internet. If I have several desktop environments, how would startx which environment to launch? Where is the global xinitrc file located? Does the login screen get bypassed only if I edit the .xinitrc file? –  PeanutsMonkey Jul 20 '11 at 23:25
    
If you have multiple desktop environments installed (like Gnome & KDE), you can choose which type of session to start at login, as noted in new123456's comments. If you decide to boot stratight to console, and manually startx after login, you can manually start a session with startx && gnome-session or startx && startkde or startx && whatever_command_you_need_to_start_your_desktop. Or you can edit your local .xinitrc and add exec gnome-session, exec startkde, etc. In the link you posted, the poster was saying that if you are at runlevel 3 and run the command telinit 5, the GDM/KDM... –  Joe Internet Jul 21 '11 at 1:32
    
...login screen will restart, because it's configured to do so for runlevel 5. But if you just type startx or startx && gnome-session, yuo'll start the desktop session without the login. –  Joe Internet Jul 21 '11 at 1:38
    
Thanks Joe Internet. Just so I have understood you. If I have multiple desktop environments, I can use session to choose which desktop I wish to log into.Is that right? Now if I am in the command line and wish to boot into a desktop environment I would just pass the command startx && whatever_command_to_start_desktop. How do I know which command to pass? Now if I edit my local .xinitrc file, can I add multiple exec commands? Are you saying that if I run the command init 5 or telinit 5 I will be presented with GDM or something similar but if I run startx I won't need to login? –  PeanutsMonkey Jul 21 '11 at 20:12
    
Yes, if you have KDE,Gnome,XFCE all installed, you can choose which session is started at the login screen above. if you are at the command line in a console session, you can start a desktop with startx && ..., but you won't need to login again. The command you use depends on the desktop, you would need to look it up. If instead you telinit 5, you'll need to login again. You wouldn't put multiple exec statements in the .xinitrc. I suggest using VirtualBox to create a vm that you can use to test this kind of stuff. It will make more sense if you do it a few times. –  Joe Internet Jul 21 '11 at 20:36
show 2 more comments

GDM is the GNOME Display Manager - it's where you enter your login credentials. It allows you to switch between different desktops (i.e. GNOME, KDE, XFCE, et al). enter image description here

GNOME is the actual desktop - it's where you run graphical applications. It also hosts your toolbar and other such things. enter image description here

share|improve this answer
    
Thanks. So can I assume or state that GDM or the Gnome Display Manager is only used to authenticate users prior to displaying the desktop? Secondly when you say I can switch to KDE, Gone, XFCE, etc is this an option that is presented to the user when logging in or does it simply log the user into the default desktop? –  PeanutsMonkey Jul 19 '11 at 22:31
    
@PeanutsMonkey GDM will log you into the default. To change your session, use the "Session" button. As to your first question, yes, it only does authentication. –  new123456 Jul 19 '11 at 22:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.