Sometime we might want to login to CLI (Command Line Interface) where Desktop won’t be available and only terminal is accessible. Most of the time the reason we login under CLIs is that it is lightweight so it is running faster than running with Desktop. So how do we boot Centos or Oracle Linux into CLIs?
To switch from Desktop to CLI, execute below command: # sudo systemctl set-default multi-user.target # sudo reboot To switch from CLI back to Desktop, execute below command: # sudo systemctl set-default graphical.target # sudo reboot
Now under CLIs, we do not have Desktop (Windows system) available so how do we launch GUI App (X app) in CLI environment then? Yes we can please follow:
Example, how to we launch GUI App like Google Chrome under CLIs (Desktopless).
We need to use startx to launch it under X session (so-called X windows system or simply Graphical session) you can read more about startx here https://www.x.org/releases/X11R7.5/doc/man/man1/startx.1.html startx [ [ client ] options ... ] [ -- [ server ] [ display ] options ... ] In our case, client is going to be the Google Chrome and please note that startx requires the full path of the client, Google Chrome. To locate the full path of Google Chrome, execute below command: #which google-chrome /usr/bin/google-chrome so now we are ready start it in single X Windows system by execute below command: #/usr/bin/startx /usr/bin/google-chrome https://chanvicheka-ouk.com -- vt1 You might wonder what is -- vt1 for? vt1 means we will display it in x windows system at virtual terminal number 1. Linux in CLI has six virtual terminals total which you can switch between them using ctrl+alt+F# where # is the number of the terminal (1-6)