Start X at boot
From ArchWiki
| Article summary |
|---|
| Covers the various methods one can use to start an X server during the boot process. |
| Available in languages |
| English |
| Français |
| Italiano |
| Русский |
| Português do Brasil |
| ไทย |
| 简体中文 |
| Related articles |
| Automatic login manager startup |
| Automatically login some user to a virtual console on startup |
| Xinitrc |
The majority of users wishing to start an X server during the boot process will want to install a login manager, and see Automatic login manager startup for details.
This article will outline methods that do not involve a login manager.
~/.bash_profile
An alternative to a login manager is to add the following to the bottom of your ~/.bash_profile (if ~/.bash_profile does not yet exist, you can create it):
if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then startx logout fi
or
if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then xinit logout fi
Utilizing this method, X is automatically started when logging into the shell. Furthermore, the user will be logged out when X is killed using Ctrl+Alt+Backspace.
See also: http://bbs.archlinux.org/viewtopic.php?id=6182
/etc/inittab
Another way of circumventing display managers and booting straight into a preferred window manager or desktop environment involves editing /etc/inittab, changing:
id:3:initdefault: [...] x:5:respawn:/usr/bin/xdm -nodaemon
to:
id:5:initdefault: [...] x:5:once:/bin/su PREFERED_USER -l -c "/bin/bash --login -c /usr/bin/startx >/dev/null 2>&1"
changing PREFERED_USER as necessary.
Additionally, startx may be changed to any desired command or script. For example:
startx -- -nolisten tcp -br -deferglyphs 16
Note that startx will execute ~/.xinitrc, and may be customized to start the window manager of choice as described in the xinitrc article.