Article Overview#
This is Part 2 of the Gentoo Linux Installation Guide series: Desktop Configuration.
Series Navigation:
- Basic Installation: Installing Gentoo base system from scratch
- Desktop Configuration (This Article): Graphics drivers, desktop environment, input methods
- Advanced Optimization: make.conf optimization, LTO, system maintenance
Previous: Basic Installation
12. Post-Reboot Configuration#
Congratulations! You have completed the basic Gentoo installation and successfully entered the new system (TTY interface).
The following sections are optional configurations. You can selectively configure and install based on your needs (server, desktop, gaming, etc.).
Important: Check Profile and Update System
Before starting configuration, please confirm the Profile settings are correct and ensure the system is up to date:
eselect profile list # List all available profiles
eselect profile set <number> # Set selected profile (e.g., desktop/plasma/systemd)
emerge -avuDN @world # Update systemNow let's configure the graphical interface and multimedia features.
12.0 Network Check [Required]#
After logging in, ensure network connectivity is working.
- Wired network: Usually auto-connects.
- Wireless network: Use
nmtui(NetworkManager) oriwctl(iwd) to connect to Wi-Fi.
12.1 Global Configuration (make.conf) [Required]#
Reference: make.conf
/etc/portage/make.conf is Gentoo's global configuration file. At this stage, we only need to configure GPU, input devices, and localization options. Detailed compilation optimization will be covered in Section 13.0.
vim /etc/portage/make.confAdd or modify the following:
# Graphics driver (choose based on your hardware)
VIDEO_CARDS="nvidia" # NVIDIA
# VIDEO_CARDS="amdgpu radeonsi" # AMD
# VIDEO_CARDS="intel i965 iris" # Intel
# Input devices
INPUT_DEVICES="libinput"
# Localization
L10N="en en-US"
LINGUAS="en en_US"
# Desktop environment support
USE="${USE} wayland X pipewire pulseaudio alsa"12.2 Apply Configuration and Update System [Required]#
Apply new USE flags:
emerge --ask --newuse --deep @world12.3 Graphics Drivers [Required]#
Reference: NVIDIA/nvidia-drivers · AMDGPU · Intel
- NVIDIA proprietary drivers:
emerge --ask x11-drivers/nvidia-drivers - AMD: Set
VIDEO_CARDS="amdgpu radeonsi" - Intel: Set
VIDEO_CARDS="intel i965 iris"
Configure VAAPI Video Acceleration
Reference: VAAPI · nvidia-vaapi-driver
Enable VAAPI globally: Add
vaapito theUSEflags in/etc/portage/make.conf.# Rebuild affected packages emerge --ask --changed-use --deep @worldInstall drivers and tools:
emerge --ask media-video/libva-utils # Install vainfo for verificationNVIDIA users - additional step:
emerge --ask media-libs/nvidia-vaapi-driver
Note
nvidia-vaapi-driver may be unstable under Wayland (CUDA/OpenGL interop issues).
See: NVIDIA Forums
NVIDIA users also need to enable DRM KMS in kernel parameters:
Edit /etc/default/grub, add nvidia_drm.modeset=1 to GRUB_CMDLINE_LINUX_DEFAULT.
grub-mkconfig -o /boot/grub/grub.cfgIntel/AMD users: Usually supported directly after installing the graphics driver.
- Verify:
Run
vainfo— if it shows no errors and displays supported profiles, it's working.
NVIDIA Chromium Hardware Acceleration Configuration (No VAAPI needed) (Click to Expand)
The following configuration applies to Chromium, Chrome, Edge, and Electron apps (e.g., VSCode).
Method 1: Flags configuration file (recommended)
This approach does not require modifying .desktop files, and the browser can be correctly recognized as the default browser.
1. Environment variables
Create ~/.config/environment.d/chromium-nvidia.conf:
# NVIDIA environment variables
__GLX_VENDOR_LIBRARY_NAME=nvidia
__VK_LAYER_NV_optimus=NVIDIA_only
GBM_BACKEND=nvidia-drm2. Chromium/Chrome Flags configuration
Create the corresponding flags file:
- Chrome Stable:
~/.config/chrome-flags.conf - Chromium:
~/.config/chromium-flags.conf - Edge Beta:
~/.config/microsoft-edge-beta-flags.conf
Contents:
# Vulkan video acceleration (NVIDIA hardware acceleration)
--enable-features=Vulkan,DefaultANGLEVulkan,VulkanFromANGLE
--enable-unsafe-webgpu
--ozone-platform=x11Note: If you see
'--ozone-platform=wayland' is not compatible with Vulkan, use--ozone-platform=x11instead.
3. Apply
Re-login to apply.
Verify: Visit
chrome://gpu/oredge://gpu/, check if Vulkan showsEnabled.
12.4 Audio and Bluetooth [Optional]#
# Install PipeWire audio system and WirePlumber session manager
emerge --ask media-video/pipewire media-video/wireplumber
# Install Bluetooth stack, tools, and GUI manager (Blueman)
emerge --ask net-wireless/bluez net-wireless/bluez-tools net-wireless/bluemanEnable services (OpenRC)
rc-update add bluetooth default
/etc/init.d/bluetooth startEnable services (systemd)
# Enable Bluetooth (system level):
sudo systemctl enable --now bluetooth
# Enable PipeWire core and PulseAudio compatibility layer
systemctl --user enable --now pipewire pipewire-pulse
# Enable WirePlumber session manager
systemctl --user enable --now wireplumber12.5 Desktop Environment and Display Manager [Optional]#
KDE Plasma (Wayland)#
Reference: KDE
# Add Wayland support
echo "kde-plasma/plasma-meta wayland" >> /etc/portage/package.use/plasma
# Install Plasma desktop
emerge --ask kde-plasma/plasma-meta
# (Optional) Install full KDE applications
emerge --ask kde-apps/kde-apps-meta
# Install SDDM display manager
emerge --ask x11-misc/sddmOpenRC configuration
# Install generic display manager init script
emerge --ask gui-libs/display-manager-init
# Configure SDDM
sed -i 's/^DISPLAYMANAGER=.*/DISPLAYMANAGER="sddm"/' /etc/conf.d/display-manager
sed -i 's/^CHECKVT=.*/CHECKVT=7/' /etc/conf.d/display-manager
# Enable SDDM
rc-update add display-manager default
rc-service display-manager startsystemd configuration
systemctl enable sddm
systemctl start sddmGNOME#
Reference: GNOME
emerge --ask gnome-base/gnome # Install GNOME core
emerge --ask gnome-base/gdm # Install GDM display manager
rc-update add gdm default # OpenRC
systemctl enable gdm # Enable GDM (systemd)Hyprland (Wayland Dynamic Tiling Window Manager)#
Reference: Hyprland
emerge --ask gui-wm/hyprlandHyprland requires newer graphics driver support. It is recommended to read the Wiki for detailed configuration.
Other Options#
For a lightweight desktop:
- Xfce:
emerge --ask xfce-base/xfce4-meta(Wiki) - LXQt:
emerge --ask lxqt-base/lxqt-meta(Wiki) - Budgie:
emerge --ask gnome-extra/budgie-desktop(Wiki)
More options
See Desktop environment for other desktop environments.
12.6 Localization and Fonts [Optional]#
Reference: Localization/Guide · Fonts
Install fonts for your languages of choice:
# Noto CJK (Chinese/Japanese/Korean)
emerge --ask media-fonts/noto-cjk
# Emoji fonts
emerge --ask media-fonts/noto-emoji
# WenQuanYi (Chinese)
emerge --ask media-fonts/wqy-microhei
# Noto fonts (covers many languages including Arabic, Hebrew, Cyrillic, Indian scripts, Thai)
emerge --ask media-fonts/noto
# Coding fonts
emerge --ask media-fonts/jetbrains-mono
# DejaVu (widely used for Hebrew, Arabic, Cyrillic)
emerge --ask media-fonts/dejavuRefresh font cache:
fc-cache -fv12.7 Input Method Configuration (Fcitx5 & Rime) [Optional]#
Rime is a powerful universal input engine supporting Chinese, Japanese, Korean, Vietnamese, and many more languages through installable schemas. For the best Wayland experience, configure environment variables as shown below.
Option A: Fcitx5 + Rime (Recommended for KDE/General)
Suitable for KDE Plasma, Hyprland, and similar environments.
Install
emerge --ask app-i18n/fcitx app-i18n/fcitx-rime app-i18n/fcitx-configtoolConfigure environment variables (Wayland)
Reference: Using Fcitx 5 on Wayland
Edit /etc/environment:
vim /etc/environmentAdd:
# Force XWayland apps to use Fcitx5
XMODIFIERS=@im=fcitx
# (Optional) for non-KDE environments or specific apps
GTK_IM_MODULE=fcitx
QT_IM_MODULE=fcitxKDE Users Tip
In KDE Plasma 5.27+, it's recommended to select Fcitx 5 directly in "System Settings" → "Keyboard" → "Virtual Keyboard", rather than manually setting the above env vars (except XMODIFIERS).
Startup
- KDE/GNOME usually auto-starts Fcitx5.
- Hyprland/Sway: add
exec-once = fcitx5 -dto your config file.
Option B: IBus + Rime (Recommended for GNOME)
Reference: IBus
GNOME integrates best with IBus. Use this if you're on GNOME.
Install
emerge --ask app-i18n/ibus-rimeEnable
Go to GNOME Settings → Keyboard → Add Input Source → Other → search for "Rime" (may appear as "Chinese (Rime)" in the selector, but supports all languages via schemas).
Rime Configuration Tips
- Switch scheme: Press
F4. - Supported languages and schemes: Chinese (Pinyin, Bopomofo, Cangjie), Japanese (Hiragana), Vietnamese, Cantonese, and many more — installable via the Rime schema repository.
- User config directory:
~/.local/share/fcitx5/rime(Fcitx5) or~/.config/ibus/rime(IBus).
12.8 Secure Boot [Optional]#
Reference: Secure Boot
If you need Secure Boot, Gentoo recommends using sbctl to simplify the process.
- Install sbctl:
emerge --ask app-crypt/sbctl - Enter BIOS settings: Reboot into BIOS, set Secure Boot mode to "Setup Mode" (clears existing keys) and enable Secure Boot.
- Create and enroll keys:
After booting:
sbctl create-keys sbctl enroll-keys -m # -m includes Microsoft keys (recommended, otherwise may fail to boot Windows or some firmware) - Sign kernel and bootloader:
# Auto-find and sign all known files (kernel, systemd-boot, etc.) sbctl sign-all # Or manually sign (e.g., GRUB): # sbctl sign -s /efi/EFI/Gentoo/grubx64.efi - Verify:
sbctl verify
12.9 Portage Git Sync & Overlay [Optional]#
Why is this step needed?
The default rsync sync is slow. Git sync is faster and easier to manage.
1. Install Git
emerge --ask dev-vcs/git2. Configure Git Sync
mkdir -p /etc/portage/repos.conf
cp /usr/share/portage/config/repos.conf /etc/portage/repos.conf/gentoo.confEdit /etc/portage/repos.conf/gentoo.conf:
[DEFAULT]
main-repo = gentoo
[gentoo]
location = /var/db/repos/gentoo
sync-type = git
sync-uri = https://github.com/gentoo-mirror/gentoo.git
auto-sync = yes3. Run Sync
emerge --sync12.10 Flatpak Support [Optional]#
Reference: Flatpak
If you need Flatpak or want a software center with Flatpak support:
Install Flatpak
emerge --ask sys-apps/flatpakEnable software center support
GNOME users: Add to
/etc/portage/package.use/gnome:gnome-extra/gnome-software flatpakKDE users: Add to
/etc/portage/package.use/kde:kde-plasma/discover flatpakUpdate software center
# GNOME emerge --ask --newuse gnome-extra/gnome-software # KDE emerge --ask --newuse kde-plasma/discover
Usage Tips
Flatpak is great for installing proprietary software and sandboxed applications. Add the Flathub remote:
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak search <app-name>
flatpak install <app-id>12.11 System Maintenance (SSD TRIM & Power Management) [Optional]#
1. SSD TRIM (Extends SSD Lifespan)
Reference: SSD
Running TRIM regularly maintains SSD performance.
Check support
Run lsblk --discard. If the DISC-GRAN column is non-zero, TRIM is supported.
systemd users:
systemctl enable --now fstrim.timerOpenRC users:
Run
fstrim -avweekly manually, or configure a cron job.
2. Power Management (Recommended for laptops)
Reference: Power management/Guide
Choose one of the following (do not install both):
Option A: TLP (Recommended, best battery savings)
Automatically optimizes battery life, suitable for most users.
emerge --ask sys-power/tlp
# OpenRC
rc-update add tlp default
/etc/init.d/tlp start
# systemd
systemctl enable --now tlpConfiguration Tip
TLP's default configuration is already excellent. For fine-tuning, the config file is at /etc/tlp.conf. Run tlp start after modifying.
Option B: power-profiles-daemon (Desktop integration)
For GNOME/KDE users, switch between "Performance/Balanced/Power Saver" modes from the system menu.
emerge --ask sys-power/power-profiles-daemon
# OpenRC
rc-update add power-profiles-daemon default
/etc/init.d/power-profiles-daemon start
# systemd
systemctl enable --now power-profiles-daemon3. Zram (Memory Compression)
Recommended
Zram creates a compressed memory swap partition, effectively preventing out-of-memory (OOM) errors when compiling large software.
OpenRC users:
emerge --ask sys-block/zram-init
rc-update add zram-init defaultConfiguration at /etc/conf.d/zram-init
systemd users:
Use zram-generator:
emerge --ask sys-apps/zram-generator
# Create default config (auto uses 50% of memory as swap)
echo '[zram0]' > /etc/systemd/zram-generator.conf
systemctl daemon-reload
systemctl start dev-zram0.swapNext step: Advanced Optimization








