How to stop x server linux

How does one exit the X server?

The command sudo service gdm stop would successfully disable the X server in Ubuntu 11.04 temporarily. However, this same command no longer works in Ubuntu 11.10, because «gdm» is an «unrecognized service» according to Terminal. How, then, do I disable the X server in Ubuntu 11.10?

if you just want to restart x server just log in and out, otherwise ctr+alt+backspace normally does it to. perhaps that shortcut needs to be enabled under keyboard preferences

The question should be «how to stop the session manager» but as many people thinks that gdm is an «X server» this should stay like this.

7 Answers 7

GDM was switched out for LightDM, so:

Or in your service parlance:

sudo service lightdm stop 

For future reference, all these upstart services (that can be run with initctl’s service command and shortcuts) are .conf files in /etc/init/

The question is about exiting X server, but I believe lightdm is X server client ? No ? and the command in your answer will only stop the client and not the server ?

@Ahmed «DM» — desktop manager; yes gdm and lightdm are X clients, but they assume special responsibilities — managing other client window decorations, stacking order, drag-n-drop, cut-n-paste, etc.

The reason that doesn’t work is because Ubuntu 11.10 has switched from GDM to LightDM.

sudo service lightdm stop 

You can also use the keyboard shortcut:

A bit of a long winded keyboard shortcut, maybe too many people were pressing Ctrl+Alt+Backspace so they changed it to this.

I can confirm this as working from 10.04 through to 11.10.

@Oli pretty much nailed it, but I wanted to note that this probably won’t help you out much if you need to do something from the command line without X.

For that, you should press Ctrl + Alt + F1 , then log in from the console. Afterwards, you can kill and restart the lightdm service as needed.

Technically speaking gdm or lightdm are managing desktop session requests they are not X servers. (an X server is serving events to X application, xorg is an X server 🙂 .

Edit

To stop the X server killall X or sudo killall X if you are not owner of the process.

Of course you must have a terminal to do that.

One way if you cannot open a gnome terminal or an xterm is to start a text console; press simultaneously Ctrl + Alt + F1 keys, then login at the prompt (your password will not be shown, not even as asterisks). (F1 to F5 are ok)

Источник

Перезапуск, остановка и запуск X-сервера

Будьте внимательны! При перезапуске X-сервера все открытые приложения будут немедленно закрыты и все несохранённые данные будут утеряны.

Читайте также:  Unity games on linux

Во многих руководствах для перезапуска X-сервера предлагается нажать Ctrl + Alt + Backspace . Однако, начиная с Ubuntu 9.04, в связи с туманной возможностью случайного нажатия, эта комбинация по умолчанию отключена. Однако её очень просто вернуть обратно.

Ubuntu 8.10 и более старые

Для перезапуска X-сервера в версиях Ubuntu до 9.04 достаточно в любой момент нажать Ctrl + Alt + Backspace .

Ubuntu 9.04 «Jaunty Jackalope»

Достаточно установить пакет dontzap через Synaptic или командой:

sudo aptitude install dontzap

Затем выполнить в терминале команду:

Можно включить сочетание клавиш и без доп. пакета dontzap , для этого надо вручную отредактировать xorg.conf , см. ниже секцию про Ubuntu 9.10.

Ubuntu 9.10 и более новые

Для того, чтобы включить возможность перезапуска X-сервера сочетанием клавиш в «Karmic Koala» нужно зайти в программу располагающуюся в меню «Система→Параметры→Клавиатура», там перейти на вкладку «Раскладки», нажать на кнопку «Параметры раскладки», найти пункт «Последовательность клавиш для перезагрузки Х-сервера» и поставить галочку в поле «Control + Alt + Backspace».

Найдите пункт «Комбинация клавишь для прерывания работы X-сервера» и установите галочку «Control + Alt + Backspace».

Кроме того, можно включить возможность перезапуска через терминал командой:

setxkbmap -option terminate:ctrl_alt_bksp

Однако действие этой команды сохраняется только до перезагрузки. Для постоянного действия просто добавьте эту команду в ваш файл ~/.xinitrc .

Также можно просто исправить файл xorg.conf , добавив в него секцию:

Section "ServerFlags" Option "DontZap" "false" EndSection

Неправильное редактирование системных файлов xorg.conf и ~/.xinitrc может привести к очень неприятным последствиям, так что не стоит изменять эти файлы, если вы чётко не понимаете, что делаете.

Альтернативные варианты остановки X-сервера: alt+SysRq+k (тоже самое,что kill) или alt+SysRq+R,E,I — после чего можно перейти в консоль по alt+Fx и остановить или перезагрузить X-сервер.

Включение, выключение и перезапуск графической подсистемы вручную

Для остановки X-сервера зайдите в текстовую консоль (нажав Ctrl + Alt + F1 ), войдите в ней под своим именем и выполните:

sudo /etc/init.d/lightdm stop

Для перезапуска X-сервера необходимо вместо stop указать restart :

sudo /etc/init.d/lightdm restart

Для запуска графической подсистемы достаточно выполнить:

sudo /etc/init.d/lightdm start

Вместо прямого вызова init-скриптов можно использовать service . Названия процессов и команды будут теми же (вызываются те же скрипты, но более прогрессивным методом). Например:

sudo service lightdm stop sudo service lightdm start

Еще один метод выполнения этих же действий:

sudo stop kdm sudo start kdm sudo restart kdm
  • Сайт
  • Об Ubuntu
  • Скачать Ubuntu
  • Семейство Ubuntu
  • Новости
  • Форум
  • Помощь
  • Правила
  • Документация
  • Пользовательская документация
  • Официальная документация
  • Семейство Ubuntu
  • Материалы для загрузки
  • Совместимость с оборудованием
  • RSS лента
  • Сообщество
  • Наши проекты
  • Местные сообщества
  • Перевод Ubuntu
  • Тестирование
  • RSS лента

© 2018 Ubuntu-ru — Русскоязычное сообщество Ubuntu Linux.
© 2012 Canonical Ltd. Ubuntu и Canonical являются зарегистрированными торговыми знаками Canonical Ltd.

Источник

stop/restart X server

I want to generate xorg.conf but for that X needs to not be running. How do I stop X or start without it? I tried ctrl + alt + F2 but the X server is still running. I’m running Lubuntu 14.10.

You can make changes to xorg.conf while X is running. You just need to restart X in order for the changes to take effect: killall X will restart it for you.

@drs X: no process found is what I got. I made minimal ubuntu installation. I’ve installed X11 and then openbox and fbpanel .

Читайте также:  Linux посмотреть тайминги оперативной памяти

2 Answers 2

I ended up doing the following:

sudo service lightdm stop 

Then I had to run ctrl + alt + F2 and log in the second terminal, otherwise it would just sit there with dark screen. To start it back up:

sudo service lightdm start 

lxdm starts/stops the X server.

The default installation of lubuntu since 12.04 uses lightdm rather than lxdm as its display manager, I think — in which case it would more likely be sudo service lightdm stop

You must log in to answer this question.

Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.7.14.43533

Linux is a registered trademark of Linus Torvalds. UNIX is a registered trademark of The Open Group.
This site is not affiliated with Linus Torvalds or The Open Group in any way.

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Источник

How do I kill the x-server?

That sounds mysterious 😉 my best guess is that lightdm is not runnig at all and you are using some other Display manger. With cat /etc/X11/default-display-manager, you can find out which Display Manager you are currently using, with sudo service —status-all you can find out which services are currently running. Maybe that helps to find out why there is no lightdm instance and what Diplay manager runs instead..

For me it was gdm3 rather than lightdm . Also my desktop environment in recent ubuntu was running on the F1 terminal, not F7, so I did the sudo service gdm3 stop on some other free terminal — the F3 one.

I did a little more digging around and found that I could just use pgrep to find its PID and then kill it.

pgrep dm -l

sudo kill (insert PID here)

You will need the help of htop or top . Write down the PID number of the process you want to kill (in this case, Xorg ). Once you have the PID, run the below command in a root shell ( sudo -s ):

You should then be able to install the NVidia drivers.

Do you have nvidia-card with CUDA ? — for this case there is special driver — you can read all this at my post here : askubuntu.com/questions/311151/…

Try running sudo service gdm stop .

The reason your command may be resulting in that output is because lightdm isn’t your Display Manager.

In addition to gdm , also try xdm and kdm .

/etc/init.d/lightdm stop maybe? And why you can’t install nvidia drivers from software center?

Ok had the GTX 970 installation Problem under Ubuntu 14.04 too. Sometime i was able to start Ubuntu with the standart drivers and sometime not.

However, this should hopefully fix the Problem: After switching from IGP (I7 4770 with HD4600) to GTX970 in Biosi got an error with some Xorg Gui.

Читайте также:  What is spamassassin in linux

However you can not install the Nvidia-Driver while X is running: -> sudo killall Xorg solves the problem

Then -> sudo ./NVIDIA-x68xxx.run

After the first Driver Install (orig. Nvidia 352.xx) i had a blank screen. Then i run the Nvidia Driver Installer again -> sudo ./NVIDIA-x68xxx.run This second install told me some kind of noveu driver is running and should be disabled. The driver asked me if it should disable noveu -> Yes disable noveu

After restart: Et Voila lighdm is running again 🙂

Источник

How to kill and to start the X server?

In 12.04 How do you kill the X server from the command line and from the GUI interface and how do you start it from the virtual terminal?

If you just want to kill the X server, you can enable the Ctrl+Alt+Backspace key combinations on “Options” of keyboard layout settings.

4 Answers 4

One way to restart an instance of the X server is to run (from the commandline)

sudo service lightdm restart 

For Ubuntu 15.04 and later:

sudo systemctl restart lightdm.service 

and for Kubuntu 15.04 and later:

sudo systemctl stop sddm.service 

lightdm? I thought gdm was for GNOME, kdm for KDE, xdm for XFCE and lightdm for LXDE! and to stp it from the gUI?

lightdm starts only one instance of Xorg, so restarting lightdm should close the only open Xorg instance, unless you’re doing something much more complicated.

On 12.04, you can restart the server with the shortcut keys: Right Alt + Print Screen + K .

What a strange combination!. Print. It has no logic; and what would «(Right alt) + (Print Screen) + K» be in an Apple keyboard? I have right command and no print

en.wikipedia.org/wiki/Magic_SysRq_key has more info on it if you want to understand the logic behind it. printscreen is the same key as sysrq(System Request).

@semi: «printscreen is the same key as sysrq» — not on my keyboard. sysreq is the same key as delete .

In order for this to work you need to run this command once: sudo echo kernel.sysrq=1 > /etc/sysctl.d/10-magic-sysrq.conf

Press Ctrl + Alt + F1 and then run:

sudo service lightdm stop 

… depending on your display manager.

NOTE: To recover use startx , alternatively replace the stop with start in either of the above commands.

Kill : xkill -a . -a means it will kill all display instances. For more information run man xkill .

Run : xinit . Also startx but this command is to start an instance and not the server itself. For more information run man xint and man startx .

I don’t believe it’s possible to kill Xserver from GUI, and even if it were, it would not be the right way to do it.

Wouldn’t that kill all individual windows, which is not what the user wants? For example I don’t want to kill all my firefox windows, I want to restart the visualisation.

The user said: «kill and start the X server». That seems to be exactly what he wants. It’s not about restarting gnome-shell.

Источник

Оцените статью
Adblock
detector