Going From Linux CLI to GUI with Dual Monitor Displays

First, we need to download a GUI if we are at the command line :

# yum groupinstall “KDE desktop” /** or “Gnome desktop” if you prefer **/

Change to a different terminal using Ctrl + Alt + F1-F6; run ‘startx’ to bring up the GUI.

Ok, now we need to manually configure XRandR from the CLI (in theory, this should work on any recent Linux distro that has XRandR installed, but I’m using my preferred OS: CentOS 6.2).

Open a terminal window from within the X environment (GUI) and run:

xrandr -q /** Queries the connected monitors and returns screen names, resolutions, refresh rates **/

xrandr –output VGA-0 off /** Disable mirrored monitor if it is currently on; replace VGA-0 with relevant output from xrandr -q **/

xrandr –output VGA-0 –left-of LVDS /** Can be –left-of, –right-of, etc **/

Voila! We now have dual monitors displayed again.

To return back to the CLI environment, press Ctrl + Alt + and F1.

To return to your running starx environment, press Ctl + Alt + F7.

I haven’t figured out how to shutdown the startx session without rebooting the machine; and it is a waste of resources to have it running in the background if you’re not actively using it. Any insight? All ideas are welcomed…