I need to run GDM on raspberry pi 2 with a fresh arch linux. I installed:


I created a ~/.xinitrc containing:

exec gdm 

But when I use startx I get some text then a black screen.

  • You need to explain in detail what you have already tried. – goldilocks Jan 18 '16 at 15:05
  • i tried install xf86-video-fbdev drivers installing xorg and xorg-xinit and installing gdm then i created file in ~/.xinitrc and type in exec gdm save it but then i type startx and it shows some text and then screen goes black – Haxk20 Jan 18 '16 at 15:09
  • gdm (gnome display manager) is an alternative to lightdm, xdm or kdm (the first is the default for a Raspbian install IIRC). That being the case I'd expect some part of the package handling system to have at least woken up at one point to ask "Do you want to use gdm or <insert current display manager utility here>, dear superuser?" – SlySven Jan 18 '16 at 19:19

GDM is a display manager. As described in that wikipedia article:

In the X Window System, an X display manager is a graphical login manager which starts a session on an X server from the same or another computer.

A display manager presents the user with a login screen. A session starts when a user successfully enters a valid combination of username and password.

Genrally what happens after you log in is the DM then runs your .xinitrc script.

But this is not how you are using it. You are logging in on the console, then trying to start X and run GDM as if it were a desktop environment, which is a very different thing.

If you wish to use GDM as a display manager (i.e., a graphical login), you will have to enable that through systemd, probably:

sudo systemctl set-default graphical.target

Should work, although I am not an arch user and do not know any potential caveats about their configuration.

However, you will still need something other than a display manager listed in your xinitrc.

  • no its not working i tried systemctl start gdm.service but what happen is black screen and nothing else – Haxk20 Jan 18 '16 at 15:43
  • ok i installed xfce4 and some more packages: "pacman -S xorg-utils xorg-xinit dbus xorg-server xorg-utils xorg-server-utils mesa xorg-twm xterm xorg-xclock" and edit /.xinitrc: exec startxfce4 but now its gives me error:"/usr/lib/xorg-server/Xorg: error while loading shared libraries:/usr/lib/libglib-2.0.so.0: invalid ELF header – Haxk20 Jan 18 '16 at 16:30
  • You've broken something and/or installed something from an invalid repository. It sounds as if you are new to both the pi and linux -- I recommend you create a new image using Raspbian, which should make things a easier. – goldilocks Jan 18 '16 at 16:33
  • i tried raspbian too before arch and i dont like it i tried install gdm on raspbian and its runs :) but when i select gnome its shows black screen with cursor – Haxk20 Jan 18 '16 at 16:41
  • im going to reinstall arch install the packages and see what happens but when its will not run i will install raspbian as the last change – Haxk20 Jan 18 '16 at 16:49

According to the ArchWiki article on xinitrc you should have copied the working default in /etc/X11/xinit/xinitrc to your ~/.xinitrc and modified that to meet your requirements because the former has some stuff that you need, specifically:

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
    for f in /etc/X11/xinit/xinitrc.d/?* ; do
        [ -x "$f" ] && . "$f"
    unset f
Further reading of that specific article does look to be very helpful in this area.

  • Ok i will try it – Haxk20 Jan 19 '16 at 15:07

I did it: I installed some packages from xorg and now when I type startx it starts xterm, and in xterm I type

systemctl start gdm.service 

Get black screen, but after 1 minute it shows a screen with gdm finally.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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