6

I was playing around with Ubuntu 16.04's display features and I accidentally turned off my monitor.

I can still see my screen on the login screen, but my screen disappears the second I log in to my user account. The system guest account is not affected.

Is there any way I can undo this?

Kaz Wolfe
  • 34,122
  • 21
  • 114
  • 172

1 Answers1

9

If you know your account password, this is going to be (thankfully) easy to fix.

  1. Press the Ctrl+Alt+F1 keys on your keyboard all at the same time. You will be transported to a TTY (or a giant terminal without any fancy graphics).
  2. Log in to your user account. Note that you must know your username and password.
  3. Delete the monitor config file:

    rm ~/.config/monitors.xml
    
  4. Log out of the tty with the logout or exit command, and press Ctrl+Alt+F7 to get back to the GUI.

  5. Log in as normal, and enjoy having your screen back.

The monitors.xml file contains practically all information about your own monitor configuration. Unfortunately, this gets annoying. And, as this file is owned by your user, you must either be your user or root.

If for some reason you can't reach the TTY, you'll need to reboot into recovery mode. Follow the instructions in that post until you see root@something:~#. Then, run this command:

rm /home/<your_username>/.config/monitors.xml

Then, reboot your system using the reboot command.

Kaz Wolfe
  • 34,122
  • 21
  • 114
  • 172
  • Isn't the guest account barred from using sudo and su? http://askubuntu.com/questions/747343/how-is-the-guest-account-prevented-from-using-su-and-sudo – muru Mar 30 '17 at 06:54
  • @muru Huh, did not know that. I'll edit that out of my answer and go test. Be back in a moment. – Kaz Wolfe Mar 30 '17 at 06:54
  • step2 fails as after entering the password i see setgid: Operation not permitted – Shairyar Baig Mar 30 '17 at 06:57
  • @Baig Yeah, my apologies about that. Muru pointed out an inconsistency inasmuch as the guest user can't use su. I've updated my answer. – Kaz Wolfe Mar 30 '17 at 06:59
  • 1
    @KazWolfe thank you so much :) so happy to see the screen again. – Shairyar Baig Mar 30 '17 at 07:03
  • This did work perfectly on Ubuntu 22.04 with Budgie when external monitors did work but the integrated display would simply turn black after log in. Also, I was not able to enable the integrated display in the Ubuntu settings, so this operation was a complete success :) – WebDevPassion Mar 02 '23 at 06:24