How to stop X server on Gentoo?
Solution 1
Just stop (as root) the process that respawns the X server:
# /etc/init.d/xdm stop
(yes, this is xdm even though you might be using something totally different)
Solution 2
Press Ctrl+Alt+F1 to get to the tty where the X server is running from and then Ctrl+C to kill the server.
Alternately, if X started an xterm for you, run top and find the PID of the process named "X". Then press k, enter the PID, press enter, press 2 and then enter at the "Kill with signal" prompt, and there you go. This will also work if your keyboard drivers are not set up correctly and therefore no input is accepted, you just have to use ssh to login over then network.
Alternately, press Ctrl+Alt+Backspace (this will only work with some configurations).
Solution 3
If you're booting with Grub, you can reboot & enter just the number 3 as a boot option, and it should boot into init level 3. I'm sure you can do this with the other boot loaders, but I haven't used anything but Grub in a while.
Related videos on Youtube
Admin
Updated on September 17, 2022Comments
-
Admin over 1 year
I tried to stop X so I could install graphics drivers. First I tried with
killall -9 X
but X server just restarted. Then I triedinit 3
but that didn't closed X. How do I close it? -
Babu Srinivasan over 14 yearsI used killall on X processes and then X just restarted, won't kill do the same?
-
marcusw over 14 yearsIt may, and if it does, you can go to another tty (for examply tty2 with Ctrl+Alt+F2) and install the drivers from there, and then restart X using killall.
-
quack quixote about 14 yearssorry about introducing the mistake. i think i went in to fix the code block formatting and got distracted.
-
Noah Passalacqua over 8 yearswas stuck on the log in screen and couldnt figure out how to get out.
Ctrl+Alt+F1
did the trick