20

I am new to xubuntu, somtimes my xfce desktop crashes, and I can only use tty1 from command line.

I want to know how can I restart my xfce in tty7 from tty1?

I've googled it, but didn't found the solution. Thanks.

9

Try killing user by

pkill -KILL -u yourusername

This will bring you back to login screen though.

  • Sometimes lose current windows is not a choice :X, u can do same restarting ldm service ( or the login manager you have ). Killing every process of a user it's the last option, because you may be working on tty1 and you will kill it too. Login manager (wich is x based) would not close other sessions. – erm3nda Oct 23 '15 at 4:20
16

For me startxfce4 didn't work, but pkill did.

You could try the following command:

xfwm4 --replace

It restarts the windows manager.

  • 1
    Yeah. This is, first try to reload window manager, if don't work try restarting login service, and in the worst of cases, kill your user then start again your work :) – erm3nda Oct 23 '15 at 4:20
  • 1
    Exactly. Don't forget to append a &: xfwm4 --replace & – Jamieson Becker Jan 27 '17 at 2:02
9

You can try startxfce4.

As this site says:

Restart XFCE4 : from the command line, you would better use "startxfce4" to bypass stupid distribution X startup scripts that can drive you crazy, really.

  • 1
    That's the start XFCE4, not to to restart it. When I ran startxfce4 I got these messages: /usr/bin/startxfce4: X server already running on display :0.0 xfce4-session: Another session manager is already running – Enkouyami Jul 4 '15 at 21:43
  • I get "xinit: unable to connect to X server: Connection refused" – kurdtpage May 20 '18 at 10:47
  • good luck fixing login loop afterwards: askubuntu.com/a/223634/308869 – Ufos Apr 4 at 13:15
  • @Enkouyami well, when something crashes Restart = Start. You got the message already running because your xfce4 was not crashed ;)—this is a linguistic issue. Anyway, this answer fits the question. :) – loved.by.Jesus Aug 27 at 10:23
8

pkill worked but seemed a little extreme to me. If I had other stuff going on in other tty sessions it would kill those too.

Another solution is:

sudo restart lightdm

A great strength of Linux is that there are always multiple ways to achieve the same task.

  • --replace does try to save things :) – erm3nda Oct 23 '15 at 4:20
  • 1
    Ubuntu16 use sudo service lightdm restart. – jc__ Aug 9 '18 at 17:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.