2

Is it possible to kill the GUI and end up with a CLI since the GUI runs on the top of the shell?

I have check the question below How to kill and to start the X server?

Magic keys restarted the GUI and I ended up with the login menu but not a CLI I am using Ubuntu 12.04 , I dont want to use virtual terminal I just want to prove to myself that the GUI runs on top of the shell and I can always exit the GUI to the shell

Thanks

Hinklo
  • 646

2 Answers2

3

To shut down your X session type in the command line:

sudo service lightdm stop

So you will end up in the virtual terminal #7. You then can hit Ctrl+Alt+F1 - Ctrl+Alt+F6 to get a login prompt. For terminal #7 (Ctrl+Alt+F7) there is no tty started because it's meant for the x server.

Edit:

If you want to end of in a shell, then create a file called /etc/init/tty7.conf with content:

# tty7 - getty
#
# This service maintains a getty on tty7 from the point the system is
# started until it is shut down again.

start on runlevel [23] and not-container

stop on runlevel [!23]

respawn
exec /sbin/getty -8 38400 tty7

After creating this file reboot the system, and then when you perform sudo service lightdm stop you will end up in a login shell.

chaos
  • 28,186
0

That solution brings your "GUI" back because you have the lightdm service running. Run sudo stop lightdm. That command will stop your lightdm service, kill X server and bring the console.

Once in the console, if you want to start your X11 session again, run sudo start lightdm.

Jesse
  • 729