TOC
First, pick a distro. It needs comprehensive and up-to-date package repositories, but since I won’t necessarily use it every day, I’d prefer to avoid rolling releases. This time I went with Fedora Workstation 38, then trimmed down GNOME and other services to achieve:
- Idle memory usage under 300MB
- Desktop environment available on demand
Basic Setup
- Enable sshd:
sudo systemctl start sshd
sudo systemctl enable sshd
- Rename home directory folders to English:
export LANG=en_US
xdg-user-dirs-gtk-update
After the conversion, set the system language back to zh_CN, restart, and when prompted at login, choose not to convert and not to ask again.
- Remove unnecessary third-party repositories:
sudo rm /etc/yum.repos.d/_copr\:copr.fedorainfracloud.org\:phracek\:PyCharm.repo
sudo rm /etc/yum.repos.d/rpmfusion-nonfree-steam.repo
- Install Go + nvim development tools:
sudo dnf install vim neovim go gcc-c++
Remove Software Update Services
Right after booting, memory usage was already at 1.5GB, with packagekitd taking up a large chunk.
PackageKit is a generic abstraction layer over package managers like dnf and apt. But since I only use dnf and don’t need “advanced” tools like gnome-software — not to mention its heavy resource consumption — I removed both components:
sudo dnf remove gnome-software PackageKit
This saved 600MB of memory.
Disable GNOME Desktop Environment
Most of the time I connect via SSH, and only use RDP remote desktop on rare occasions. So I disabled gdm (GNOME Display Manager) to save resources (reference):
sudo systemctl stop gdm
sudo systemctl disable gdm
Start it manually when needed:
sudo systemctl start gdm
This saved another 600MB+ of memory.
Remote Desktop
When you need the desktop environment, start gdm first, then connect remotely.
Auto-login + Unlocking Remote Login Password
In this version, remote desktop is built into GNOME and requires an active user session, so you’d need to log in via VNC first.
For convenience, you can set up GNOME auto-login (documentation):
# /etc/gdm/custom.conf
[daemon]
AutomaticLoginEnable=True
AutomaticLogin={{ username }}
However, you’ll find that after each auto-login, the remote desktop password gets reset to a random one. This happens because service passwords on the system are stored encrypted in a keyring. The default keyring’s unlock password is the login password, and it gets unlocked together during a normal login. But with auto-login, no password is entered to unlock it, so GNOME can’t read the encrypted remote login password and generates a new random one instead.
Setting the default keyring password to empty would leave all stored passwords in plaintext, which is insecure.
Following a community solution, create a password-free insecure keyring specifically for storing the RDP password:
- Install the keyring management tool. After installation, you can find the “Passwords and Keys” application:
sudo dnf install seahorse
- In the tool, check the default “Login” keyring. It should already contain a remote desktop password entry named “GNOME Remote Desktop RDP credentials”. Delete this entry.
- Create a new keyring with an empty password, and set it as the default keyring.
- Restart the system to apply the new default keyring.
- Set the remote desktop password. Check the newly created keyring again — it should now contain the “GNOME Remote Desktop RDP credentials” entry. From now on, remote desktop will use this keyring to read and set passwords.
- Restore the default keyring back to the original “Login” keyring, then restart the system.
Note: You need to change the default keyring so that GNOME creates the password entry. Such entries appear as “Password or Key”, whereas manually created password entries show up as “Stored Note” and won’t be used by GNOME.
Using Remote Desktop While Locked
By design, GNOME remote desktop mirrors the local screen — when the local screen is locked, the remote desktop connection is dropped.
This differs from Windows, where connecting via remote desktop automatically locks the local desktop. The GNOME team hasn’t officially responded to this feature request.
For now, I’ve simply disabled the auto-lock screen.