Optimizing Debian 12/13 for Work: Post-Installation and Performance Tweaks

In this post, I will show you the configurations I use to optimize my work PC running Debian.

After a minimal Gnome installation, it’s time for the fine-tuning.

Post-Installation Setup

Whether on Debian 12 (Bookworm) or 13 (Trixie), the first thing I do is install the Gnome desktop with the bare minimum of packages.

Then, I install these essential tools:

sudo apt install neofetch \
virt-manager libvirt-daemon-system qemu-system bridge-utils \
gnome-settings-daemon htop iotop unattended-upgrades \
cups cups-client cups-filters system-config-printer \
gparted vim dbus-x11 libnotify-bin --no-install-recommends \

The Flatpak Choice: Since I downgraded to Debian 12 for stability, I opted to use more applications via Flatpak instead of native packages.

While on Debian 13 I had installed Evolution, Remmina, and Gnome-Boxes as .deb files, on version 12 I run all of them (including Google Chrome and Brave) via Flatpak.

I also use Flatseal to manage permissions easily.


Update: I’ve just published the second part of this guide! Check out for advanced performance settings


Optimizing Debian for Productivity

My goal is to achieve a faster boot, improve access to my backup drive, and optimize RAM management for Virtual Machines and daily tasks.

1. Switching from Wayland to Xorg

To fix compatibility issues, I disable Wayland in the GDM configuration:

sudo nano /etc/gdm3/daemon.conf

Uncomment the line WaylandEnable=false.

Once that’s done, save the file. Before rebooting the machine, let’s adjust some permissions that I only realized were missing after a year:

sudo mkdir -p /var/lib/gdm3/.config/mutter/sessions
sudo chown Debian-gdm:Debian-gdm /var/lib/gdm3/.config/mutter
sudo chown Debian-gdm:Debian-gdm /var/lib/gdm3/.config/mutter/sessions
sudo chmod 700 /var/lib/gdm3/.config/mutter/sessions

Attention: In Debian 12, the GDM user is named Debian-gdm, not gdm or gdm3. Verify it with:

getent passwd | grep -i gdm

Save and reboot.

“Just a reminder: I’m using Xorg instead of Wayland due to my old GPU.”

2. Network Manager Adjustments

To manage the network directly through the GUI without conflicts, I disable the systemd networking service:

  1. sudo systemctl disable networking
  2. sudo rm /etc/network/interfaces

3. Preload

To speed up application launch times, I use Preload:

sudo apt install preload 

Edit the config (sudo nano /etc/preload.conf) and adjust the model:

  • cycle = 30
  • memfree = 10
  • memcached = 70

Restart with sudo systemctl restart preload.

4. Swap and Sysctl Tweaks

I created an 8GB swap file and optimized the kernel parameters for better responsiveness:

First:

sudo fallocate -l 8G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

Now add it to /etc/fstab:

echo "/swapfile none swap sw 0 0" | sudo tee -a /etc/fstab

In /etc/sysctl.conf, I added:

  • vm.swappiness=1 (Avoids unnecessary swap usage)
  • vm.vfs_cache_pressure=50
  • net.core.somaxconn=65535 (Improves network connections)

5. Zram and Tmpfs

To make the most of my 16GB RAM, I use Zram with zstd compression:

sudo apt install zram-tools

In /etc/default/zramswap, I set ALGO=zstd and SIZE=4096.

I also moved temporary files to RAM by adding these to /etc/fstab:

Optimizing debian 12/13 for work
tmpfs /tmp tmpfs defaults,noatime,mode=1777,size=1G 0 0
tmpfs /var/tmp tmpfs defaults,noatime,mode=1777,size=512M 0 0
tmpfs /run/libvirt tmpfs defaults,noatime,mode=0755,uid=libvirt-qemu,gid=libvirt-qemu,size=256M 0 0

6. Virtualization and NFS

Since I work in a Microsoft environment, I need a Windows VM.

I use nfs-common to mount network folders at boot via /etc/fstab and configure Virt-Manager to point to my VM storage directory.

For the Bridge Network, I use nmcli to create br0 and link it to my physical interface (e.g., enp4s0).

Make sure to set managed=true in /etc/NetworkManager/NetworkManager.conf.

You can see here How to enable bridge mode on Gnome Boxes

7. Avoiding System Freezes with EarlyOOM

To prevent the system from locking up during high memory usage:

sudo apt install earlyoom && sudo systemctl enable --now earlyoom

Once your system is ready, you might need to help others or manage different OS environments.

If you ever need to create a Windows installation media from your Linux desktop, check out this guide on How to Create a Windows Bootable USB on Linux.

8. Gnome “Wait or Force Quit” Timeout

If Gnome is too impatient with slow-loading apps, run this in the terminal to give them more time (20 seconds):

gsettings set org.gnome.mutter check-alive-timeout 20000

9. Improving performance for very old Nvidia cards (GT 210)

Installing proprietary drivers for very old Nvidia cards is a problem that is best avoided.

For cards running on the 340 Legacy driver, it’s better to use the nouveau driver. Although it is very limited, it won’t break during kernel updates.

However, using nouveau out of the box isn’t the best option. It’s usable, but you can improve it by extracting firmwares from the proprietary Nvidia driver that nouveau doesn’t include.

# Script execution and Nvidia driver storage location
mkdir /tmp/nouveau && cd /tmp/nouveau

# Extraction script

wget https://raw.githubusercontent.com/envytools/firmware/master/extract_firmware.py

# Legacy Nvidia driver that supports the GT210 (340 series)

wget https://download.nvidia.com/XFree86/Linux-x86_64/340.108/NVIDIA-Linux-x86_64-340.108.run

# Extract without installing

sh NVIDIA-Linux-x86_64-340.108.run --extract-only

# Run the firmware extraction script

python3 extract_firmware.py

# Copy to the correct location

sudo mkdir -p /lib/firmware/nouveau
sudo cp -d nv* vuc-* /lib/firmware/nouveau/

sudo update-initramfs -u
sudo reboot

Leave a Comment