I often find myself in a situation where I have an already installed Linux box, and want to add X.org for graphical logins. This may be because I have installed from the Fedora server DVDs (which no longer include graphical logins), or because I am using a discless Fedora machine installed by following these instructions.
During a normal graphical installation process, the installer will probe your hardware and install the correct drivers for your video card, however if you are adding Xorg to an existing installation then you no longer have that option and need to perform some steps manually
- Firstly, use dnf to install Gnome.
dnf groupinstall gnome
On a Fedora 23 basic install, this would install an additional 706 packages.
- We now need to identify the video card.
dnf install pciutils
lspci | grep VGA
- Find the correct driver for your video card, the following will list all drivers in your repo.
dnf list xorg-x11-drv*
Then install the one that looks as if it will match your video card (sometimes you can ignore this step and use the generic VGA drivers, although performance may suffer).
dnf install xorg-x11-drv-vesa
- I found that I had to install a couple of additional packages
dnf install mesa-libGL mesa-dri-drivers xorg-x11-drv-evdev xorg-x11-drv-fbdev
- You should now be able to test your setup by running
When finished, simply log out of the graphical console.
If this does not work, then you will need to look at the logfiles in /var/log/Xorg* for clues as to what has gone wrong.
- You can now start gdm to check whether the login prompt is working
systemctl start gdm
- If the above doesn’t work, sometimes I have found that I need to disable “Wayland”.
This is done by editing
vi /etc/gdm/custom.conf and deleting the ‘#’ at the start of the line
WaylandEnable=false Then try starting gdm again.
- Once this is all working, you can set it to run by default on system boot.
ln -fs /lib/systemd/system/graphical.target /etc/systemd/system/default.target
- You should now be able to reboot and login graphically. Once logged in, setup the monitor arrangement (i.e. if you have multiple monitors, then ensure that they are in the correct order)
- If the monitor order is incorrect at the initial login prompt, then copy your user’s monitor config to the system default.
cp ~/.config/monitors.xml /var/lib/gdm/.config