45

As from my previous question, I asked what the power off button in the corner does. Then somebody said if you boot into the GUI automatically, it will give you some options.

How do I boot into the GUI at startup?

Peter Mortensen
  • 2,004
  • 2
  • 15
  • 18
horIzoN
  • 664
  • 1
  • 7
  • 11
  • Can you expand on which distribution are you using? – kolin May 02 '13 at 12:33
  • Read this article which explains how to auto login and auto start desktop http://www.opentechguides.com/how-to/article/raspberry-pi/5/raspberry-pi-auto-start.html –  May 10 '13 at 17:50

2 Answers2

61

Assuming that you are using Raspbian, it is actually rather simple to do what you ask. Simply open the terminal, and type in the following:

sudo raspi-config

The following window should show up

Config Screen

Navigate to boot_behaviour and click enter. This should make it so that the GUI interface starts automatically.

xxmbabanexx
  • 3,258
  • 7
  • 35
  • 56
  • Just a detail: My feeb attempts to switch back, from boot-to-gui to boot-to-shell, failed. Maybe I started with an obsolete Raspbian image... – Phlip Jun 16 '15 at 16:11
10

If you are using Arch Linux, please install the X11 server. Follow the steps in Archlinux Beginners Guide first. And install your favorite WM.

  1. Add thise lines to your ~/.xinitrc:

    #!/bin/sh
    #
    # ~/.xinitrc
    #
    # Executed by startx (run your window manager from here)
    
    if [ -d /etc/X11/xinit/xinitrc.d ]; then
       for f in /etc/X11/xinit/xinitrc.d/*; do
        [ -x "$f" ] && . "$f"
       done
       unset f
    fi
    exec openbox-session ## I'm using window manager Openbox (<https://en.wikipedia.org/wiki/Openbox>)
    #exec awesome
    
  2. Start X when logging in. Add the following to the bottom of ~/.bash_profile if you use bash. Or ~/.zprofile if you're are using zsh. See more on the Arch Linux Wiki.

    [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx

Peter Mortensen
  • 2,004
  • 2
  • 15
  • 18
Yuan He
  • 201
  • 1
  • 3
  • Note this works on raspbian as well. xxmbabanexx's answer didn't work for me (I think because I have a .xinitrc?), but I added exec startx to ~/.profile and it's working now. – Cosine Jan 18 '17 at 03:10