This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

GNOME/GNOME Without systemd

From Gentoo Wiki (test)
< GNOME
Jump to:navigation Jump to:search
GNOME 3.14 session, under OpenRC (not systemd) init

Brief instructions for using GNOME (3.14 thru 3.30) under OpenRC (rather than systemd) in Gentoo, via Dantrell B.'s patchset, on either the X11 or Wayland platforms.

Introduction

Users of GNOME 3 on Gentoo have, until recently, been required either to use systemd as their init system, or else to use a 'shim' overlay to pull in Funtoo's patched version of GNOME (which supports OpenRC).

Now, however, Dantrell B., the primary author of the Funtoo GNOME patchset, has made his work available for Gentoo users directly.

To be clear, this means that you can now enjoy the full GNOME experience (including session tracking and power management), even on a PC running 'stable branch' (amd64) Gentoo, without systemd.

This brief guide leads you through the steps you need to take to get GNOME up and running under this patchset.

Important
As with any third-party overlay, please be aware that:
  • you may find it more difficult to get support via the normal Gentoo channels (the forums etc.). when using an 'unofficial' patchset such as this one;
  • security fixes etc. may take longer to be released, and the overlays may themselves contain security holes;
  • the patchset's author (Dantrell B.) may cease support for this patchset in the future.

Having said that:

  • the vast majority of the GNOME code is unaffected by the patches;
  • the patchset code itself is largely shared with Funtoo, who use it in their mainline distribution, so you will not be alone;
  • Dantrell B. has stated his intention to support this patchset for Gentoo (at least until either a proper answer for the GNOME/systemd issue is arrived at, he ceases to use GNOME, or the complexity gets out of control).
Note
The "GNOME without Systemd" thread on the Gentoo wiki has been stickied and now doubles as an "official" support forum; accordingly, if you experience problems with this patchset, please post your issue there.

Prerequisites

It is assumed that:

  • having followed the normal "Installing Gentoo" process from the official Handbook, you are currently running a stock amd64 Gentoo system which has working internet access etc. (it is also fine to be on ~amd64)
  • you have at least one 'regular' (non-root) user set up;
  • you have prepared your kernel and /etc/portage/make.conf file for X-server installation (VIDEO_CARDS and INPUT_DEVICES variables set), as described here. You do not have to have actually installed the X-server, however (although since X-related problems are some of the most commonly encountered when installing GNOME, it is recommended that you do);
    Note
    A minimal setup for test purposes, which should run on most systems, can be created by building the kernel using genkernel all, and setting VIDEO_CARDS="vesa fbdev" and INPUT_DEVICES="libinput" in /etc/portage/make.conf; for full functionality and higher screen resolution, you should of course specify the correct video driver and kernel options, per the guide just cited.
    NB, the vesa driver will not work if running as a guest in VirtualBox with EFI emulation turned on; in this case, you should instead use the x11-drivers/xf86-video-virtualbox driver, as selected by VIDEO_CARDS="virtualbox" in /etc/portage/make.conf.
    • if targeting Wayland, you must have an appropriate Direct Rendering Manager ('DRM') kernel driver for your PC's graphics card installed (see e.g. these notes for further details);
  • you have a UTF-8 locale selected (as described here).

Installation

Setting Global USE Flags

First, if you have the bindist USE flag set in your /etc/portage/make.conf file, it is recommended to unset it now, to avoid issues with dev-libs/openssl, net-misc/openssh and dependencies later.

Second, if you wish to deploy GNOME on Wayland (rather than the default X11), then add wayland -ck elogind egl to your global USE flags, in /etc/portage/make.conf (note that you will still be able to log in to an old-school GNOME-on-X11 session at your option, even if you do elect to use Wayland).

Note
Performance notwithstanding, probably the strongest end-user reason to transition to a Wayland-based desktop is security: unlike X11, by default Wayland enforces application isolation at the GUI level. You can read more about X11's vulnerability in this regard (and how to mitigate it, for legacy apps), in the additional mini-guide, here.

Then, ensure everything is up-to-date on your current setup, before proceeding further:

root #emerge --sync

Installing the Overlays

You now have three options: either install Dantrell B.'s overlays under eselect repository, layman, or add them directly (assuming you are using version >= 2.2.16 of sys-apps/portage).

Option 1: Installation under eselect repository

First, ensure app-eselect/eselect-repository and dev-vcs/git are installed:

root #emerge --ask --noreplace app-eselect/eselect-repository dev-vcs/git

Then configure and sync the repository:

root #eselect repository add dantrell-gnome git https://github.com/dantrell/gentoo-overlay-dantrell-gnome.git
root #emerge --sync dantrell-gnome

Finally, add the desired GNOME 'version' overlay(s); if using the 'stable' (amd64) branch, it is probably best to use the one which matches the current stable gnome-base/gnome in Gentoo (version 3.24, at the time of writing).

For version nn of GNOME 3, issue:

root #eselect repository add dantrell-gnome-3-nn https://github.com/dantrell/gentoo-overlay-dantrell-gnome-3-nn.git
root #emerge --sync dantrell-gnome-3-nn

Substitute for nn in the above, with one of 14 thru 30: as a concrete example, for GNOME 3.24, you'd actually need to issue:

root #eselect repository add dantrell-gnome-3-24 https://github.com/dantrell/gentoo-overlay-dantrell-gnome-3-24.git
root #emerge --sync dantrell-gnome-3-24
Note
It is fine to add multiple version overlays here (e.g., 3-24, 3-26 etc.), as the profile — which we will select shortly — will decide which takes precedence.

Option 2: Installation under layman

To install the overlays, first emerge and configure layman, as detailed here, with the git USE flag enabled (it is by default).

Then, edit the overlays stanza of /etc/layman/layman.cfg so it reads:

FILE /etc/layman/layman.cfgMake dantrell overlays visible to layman
overlays  : https://api.gentoo.org/overlays/repositories.xml
            https://raw.githubusercontent.com/dantrell/gentoo-overlay-dantrell-gnome/master/repositories.xml

Sync the overlay metadata, and add the 'generic' GNOME overlay:

root #layman --sync-all
root #layman -a dantrell-gnome

Next, add the desired GNOME 'version' overlay(s); if using the 'stable' (amd64) branch, it is probably best to use the one which matches the current stable gnome-base/gnome in Gentoo (version 3.24, at the time of writing).

Note
It's OK to add more than one (you can even safely add all nine of dantrell-gnome-3-14, dantrell-gnome-3-16, ... dantrell-gnome-3-30) — your profile (which we will set below) will determine which takes precedence.

For version nn of GNOME 3, issue:

root #layman -a dantrell-gnome-3-nn

Substitute for nn in the above, with one of 14 thru 30: as a concrete example, for GNOME 3.24, you'd actually need to issue:

root #layman -a dantrell-gnome-3-24

Note that it is fine to add multiple version overlays here (e.g., 3-24, 3-26 etc.), as the profile — which we will select shortly — will decide which takes precedence.

Option 3: Direct Installation

Under modern (>= 2.2.16) versions of portage, it isn't necessary to use layman - you can add the overlays directly if you like.

Note
The following will assume you are using the 'subdirectory' approach for /etc/portage/<...> settings files, as this is more convenient, and furthermore is what is now used on the Gentoo "minimal install" images).

Begin by ensuring the that you have a /etc/portage/repos.conf directory in place:

root #mkdir -pv /etc/portage/repos.conf

Check you have a /etc/portage/repos.conf/gentoo.conf file; if not, create it following the pattern below (adapt the sync-uri appropriately for your location):

FILE /etc/portage/repos.conf/gentoo.confConfiguration for the Gentoo repo
[DEFAULT]
main-repo = gentoo

[gentoo]
location = /usr/portage
sync-type = rsync
auto-sync = yes

sync-uri = rsync://rsync.uk.gentoo.org/gentoo-portage

Next, we need to create configuration files for Dantrell B.'s external ebuild repositories (aka, overlays). At the time of writing there are seven such repos: a 'common' one, and one for each of GNOME 3.14, 3.16, ... 3.30. Create the following file for the 'common' overlay:

FILE /etc/portage/repos.conf/dantrell-gnome.confConfiguration for dantrell-gnome repo
[dantrell-gnome]

# Dantrell B.'s Gentoo Overlay for GNOME (generic)
# Maintainer: Dantrell B. (email: see CONTRIBUTING.md in main GitHub project)
# Homepage: https://github.com/dantrell/gentoo-project-gnome-without-systemd

location = /usr/local/portage/dantrell-gnome
sync-type = git
sync-uri = https://github.com/dantrell/gentoo-overlay-dantrell-gnome.git
priority = 150
auto-sync = yes

Next, create the desired GNOME 'version' overlay configuration file(s), as shown below; if using the 'stable' (amd64) branch, you should create at least the one which matches the current stable gnome-base/gnome in Gentoo (version 3.24, at the time of writing).

For GNOME 3.14, create the following file:

FILE /etc/portage/repos.conf/dantrell-gnome-3-14.confConfiguration for dantrell-gnome-3-14 repo
[dantrell-gnome-3-14]

# Dantrell B.'s Gentoo Overlay for GNOME (3.14)
# Maintainer: Dantrell B. (email: see CONTRIBUTING.md in main GitHub project)
# Homepage: https://github.com/dantrell/gentoo-project-gnome-without-systemd

location = /usr/local/portage/dantrell-gnome-3-14
sync-type = git
sync-uri = https://github.com/dantrell/gentoo-overlay-dantrell-gnome-3-14.git
priority = 100
auto-sync = yes

We can use this file as a basis for the other (3.16 → 3.30) variants, rather than entering them manually. To do so, issue: {{RootCmd |for ((R=16;R<=30;R+=2)); do cp -v /etc/portage/repos.conf/dantrell-gnome-3-{14,${R}}.conf; sed -e "s/14/${R}/g" -i /etc/portage/repos.conf/dantrell-gnome-3-${R}.conf; done |prompt=(chroot) livecd / # }}

Note
This assumes that your current shell is bash; if it is not, adapt the given command accordingly, or set up the files manually.

Note that it is fine to have multiple versions installed, as the profile — which we will select shortly — will decide which takes precedence.

Next, if you haven't already got it on your system, install git:

root #emerge --ask --verbose --noreplace dev-vcs/git

Then sync everything:

root #emaint sync --auto

Setting the Profile, and Updating

Dantrell's overlays provide a bundled set of profiles. By using one of these, you can conveniently set appropriate USE flags, masks etc., to ensure that installation proceeds smoothly. For any of the GNOME releases (3.14, 3.16, ... 3.30) you can choose a 'standard' or 'extended' profile (and, at the time of writing, a 13.0 or 17.0 profile for each of those, giving a total of four profiles per GNOME version). The 'extended' variants have more USE flags enabled by default, to yield a similar experience to the familiar desktop/gnome profiles in Gentoo.

Note
Not all of the default USE flags from the Gentoo GNOME profiles are mirrored, even in the 'extended' variants, and indeed some USE flags notable by their absence in Gentoo are enforced. For example:
  • qt3support and qt4 are enabled by default in Gentoo, but not in any of Dantrell's profiles. Per Dantrell: "The former isn't something that should be enabled upstream, especially since things have moved to qt4 and qt5. Users should decide for themsleves if they want qt3 support. As for the latter, it shouldn't be enabled globally at all in a GNOME environment, especially if gtkstyle is not enforced (and gtkstyle should be enforced regardless)."
  • Following neatly on from that, gtkstyle is enforced by the Dantrell profiles (but not in Gentoo's).
  • gtk is also enabled by default in Gentoo, but not in Dantrell's profiles. Per Dantrell: "this is handled by default and on packages where it's not enabled it likely refers to optional GTK+-related support that does not enable a GUI".

Select an appropriate profile now (at the time of writing, users on the "stable" (amd64) branch are probably safest sticking to one of the 3.14 - 3.24 profiles (although, for reference, 3.30 will build under amd64); ~amd64 users may use whichever they choose):

root #eselect profile list
  [1]   default/linux/amd64/13.0 (stable)
  [2]   default/linux/amd64/13.0/selinux (dev)
... additional output suppressed ...
  [12]  default/linux/amd64/17.0 (stable) *
... additional output suppressed ...
  [57]  dantrell-gnome:default/linux/amd64/13.0/desktop/gnome+plasma (stable)
  [58]  dantrell-gnome:default/linux/amd64/17.0/desktop/gnome+plasma (stable)
  [59]  dantrell-gnome-3-14:default/linux/amd64/13.0/desktop/gnome/3.14 (stable)
  [60]  dantrell-gnome-3-14:default/linux/amd64/13.0/desktop/gnome/3.14/extended (stable)
  [61]  dantrell-gnome-3-14:default/linux/amd64/17.0/desktop/gnome/3.14 (stable)
  [62]  dantrell-gnome-3-14:default/linux/amd64/17.0/desktop/gnome/3.14/extended (stable)
  [63]  dantrell-gnome-3-16:default/linux/amd64/13.0/desktop/gnome/3.16 (stable)
  [64]  dantrell-gnome-3-16:default/linux/amd64/13.0/desktop/gnome/3.16/extended (stable)
  [65]  dantrell-gnome-3-16:default/linux/amd64/17.0/desktop/gnome/3.16 (stable)
  [66]  dantrell-gnome-3-16:default/linux/amd64/17.0/desktop/gnome/3.16/extended (stable)
... additional output suppressed ...
  [87]  dantrell-gnome-3-28:default/linux/amd64/13.0/desktop/gnome/3.28 (stable)
  [88]  dantrell-gnome-3-28:default/linux/amd64/13.0/desktop/gnome/3.28/extended (stable)
  [89]  dantrell-gnome-3-28:default/linux/amd64/17.0/desktop/gnome/3.28 (stable)
  [90]  dantrell-gnome-3-28:default/linux/amd64/17.0/desktop/gnome/3.28/extended (stable)
  [91]  dantrell-gnome-3-30:default/linux/amd64/13.0/desktop/gnome/3.30 (stable)
  [92]  dantrell-gnome-3-30:default/linux/amd64/13.0/desktop/gnome/3.30/extended (stable)
  [93]  dantrell-gnome-3-30:default/linux/amd64/17.0/desktop/gnome/3.30 (stable)
  [94]  dantrell-gnome-3-30:default/linux/amd64/17.0/desktop/gnome/3.30/extended (stable)

(The numbering etc. on the list you see may well differ from the above, and of course you will only see dantrell-gnome-... profiles corresponding to overlays you have installed.)

root #eselect profile set "dantrell-gnome-3-24:default/linux/amd64/17.0/desktop/gnome/3.24/extended"
root #eselect profile show
Current /etc/portage/make.profile symlink:
  dantrell-gnome-3-24:default/linux/amd64/17.0/desktop/gnome/3.24/extended
Note
You may wish to take note of the 'grading' status of the available GNOME versions on Dantrell's page here, when making your choice.

With your desired profile set, re-emerge @world, to pick up the new USE flags, default packages etc.

root #emerge --deep --with-bdeps=y --changed-use --update --ask --verbose @world
Important
Please do not skip this step - the subsequent GNOME emerge will probably fail if you do.

The various dependencies for GNOME without systemd are now installed automatically, either as part of the above @world update under the custom profile (e.g., sys-apps/dbus and sys-auth/consolekit (for <= GNOME 3.22) / sys-auth/elogind (for >= GNOME 3.24)) or during the gnome-base/gnome emerge to follow shortly (e.g., sys-power/pm-utils and sys-power/acpid); nothing further needs to be emerged at this stage.

Preparing USE Flags Prior to GNOME Emerge

If there are any additional applications you would like installed as part of the GNOME emerge, set their USE flags now, as follows:

USE flag Default Description
anjuta Install the dev-util/anjuta IDE
bijiben Yes Install the app-misc/bijiben note editor
boxes Install the gnome-extra/gnome-boxes remote and virtual system manager
builder Install the gnome-extra/gnome-builder IDE (only in GNOME 3.16 or greater)
california Install the gnome-extra/california calendar
empathy Install the net-im/empathy chat client
epiphany Install the www-client/epiphany web browser
evolution Yes Install the mail-client/evolution mail client
flashback Install the gnome-base/gnome-flashback (aka fallback mode; work-in-progress)
fonts Yes Install media-fonts/{noto,symbola,unifont}
games Yes Install Gnome Games
geary Install the mail-client/geary mail client
gnote Install the app-misc/gnote note editor
latexila Install the app-editors/latexila integrated LaTeX environment
multi-writer Install the gnome-extra/gnome-multi-writer USB device writer (only in GNOME 3.16 or greater)
recipes Yes Install the gnome-extra/gnome-recipes live cookbook (only in GNOME 3.22 or greater)
share Yes Install the gnome-extra/gnome-user-share personal file sharing tool
shotwell Yes Install the media-gfx/shotwell photo manager
simple-scan Install the media-gfx/simple-scan document scanning utility
todo Yes Install the gnome-extra/gnome-builder task manager (only in GNOME 3.18 or greater)
tracker Yes Install the app-misc/tracker indexer and the GNOME packages that require it
usage Yes Install the gnome-extra/gnome-usage system resources monitor (only in GNOME 3.28 or greater)

For example, to add the epiphany browser to the default set of installed applications, do:

root #mkdir -pv /etc/portage/package.use
root #echo "gnome-base/gnome-extra-apps epiphany" >> /etc/portage/package.use/gnome-extra-apps
Note
The above assumes that /etc/portage/package.use is a directory, which is now the default on the Gentoo minimal install image. If using a single file instead, simply append to /etc/portage/package.use instead of /etc/portage/package.use/gnome-extra-apps in the above.

There are some additional GNOME 'quality of life' improvements in Dantrell's patchset (background resolution etc.), which are controlled by USE flags on certain packages. The defaults will probably be suitable for most users, but for more details please see here.

Emerging GNOME

Right, we are now ready to emerge GNOME! To do so, issue:

root #emerge --ask --verbose --keep-going gnome-base/gnome
Important
If you are using any MAKEOPTS and/or EMERGE_DEFAULT_OPTS build parallelism, it is quite possible that one or more elements of this large emerge will fail. If that occurs, in the first instance, simply issue the
root #emerge --ask --verbose --keep-going gnome-base/gnome
again. You may need to repeat this step multiple times to get GNOME emerged successfully (I have found three or four iterations may be necessary). As long as the 'packages to be installed' count keeps falling, keep trying ^-^
Note
If desired, you can emerge gnome-base/gnome-light instead, and then add applications later.

Assuming that completes successfully, you should still check that the necessary X11 drivers have been properly emerged: often, they will not have been, particularly if you had to run the emerge step more than once (due to build parallelism errors). To make sure, issue:

root #emerge --ask --verbose --oneshot x11-base/xorg-drivers
Note
If you are using VirtualBox, please note that you may need to upgrade your version of sys-devel/gcc (to a 'non-stable' variant, possibly) in order to compile x11-drivers/xf86-video-virtualbox. If the above emerge of x11-base/xorg-drivers failed, give this a shot.
As suggested earlier, you can also try using VIDEO_CARDS="vesa" just to get things going initially.

Configuring and Running GNOME

Once GNOME is emerged, you need to change the DISPLAYMANGER value in the xdm configuration file (/etc/conf.d/xdm), so that the gdm display manager is used:

FILE /etc/conf.d/xdmSpecify the GNOME display manager, as follows
# What display manager do you use ?  [ xdm | gdm | kdm | gpe | entrance ]
# NOTE: If this is set in /etc/rc.conf, that setting will override this one.
DISPLAYMANAGER="gdm"

Then set dbus, xdm, NetworkManager and openrc-settingsd to come up on boot, and disable dhcpcd if you are using it:

root #rc-update add dbus default
root #rc-update add xdm default
root #rc-update add NetworkManager default
root #rc-update del dhcpcd default

If targeting X11 (rather than Wayland) and using < GNOME 3.24, issue:

root #rc-update add acpid default
root #rc-update add consolekit default

Otherwise, if you are targeting Wayland, or using >= GNOME 3.24 issue:

root #rc-update add elogind boot

Next, check if your machine has a plugdev group, and, if it does, add any regular users to it:

root #getent group plugdev && gpasswd -a <yourusername> plugdev

If you wish to allow your regular users to play the GNOME games (assuming you installed them):

root #getent group games && gpasswd -a <yourusername> games

Start up GNOME!

root #openrc

You should now have a GNOME login screen visible (and this will also come up automatically on boot). On some machines, you may need to move the mouse or press a key, for the login screen to appear.

Tip
Even if you have installed over Wayland, you can still elect to use GNOME over X11 for a given session if you want (this may be useful if you need to use applications that do not yet work correctly under Wayland). To do so, simply click on the "cogwheel" icon when logging in, and select GNOME on Xorg from the drop-down menu. To log into a Wayland session instead, use the GNOME "cogwheel" menu item — the setting is persistent between logins. Incidentally, you can double-check which graphical platform (X11 or Wayland) is in use when logged in, by issuing (in a graphical terminal):
user $echo "${XDG_SESSION_TYPE}"
Note
When using a Wayland GNOME session, unported applications (such as www-client/firefox, at the time of writing) will be hosted in a shared, rootless X11 server (the so-called "XWayland" approach). This generally works well, but may not be sufficient for all legacy apps (such as some games and virtualisation environments). For such cases, remember that you always have the ability to login to a 'old-school' GNOME-on-X11 session, should your workflow require.

Have fun!

Using GNOME

For more information about the GNOME interface (which is generally self-explanatory), see https://gnome.org. Some additional useful setup tips about GNOME may also be found here.

See also

External resources