How to enable monitor from terminal?

After running this command switch immediately to the tty where the screen is black, and after 5 seconds the screen should show up.

sleep 5 && xrandr -d :0 --output LVDS --auto

The xrandr command will turn on your main screen. It only seems to work if you're currently on the tty where your display manager is run, hence the sleep to give you some time to be able to switch.


  1. Figure out that the offending settings are stored in a file called displays.xml.

    I won't detail here how I guessed it, though the comment about deleting monitors.xml proved helpful. It also involved manual comparing of several .config subdirectories.

    Of course, what I should have done was ask my search engine "where does xubuntu store display settings" and find this thread at ubuntuforums...

  2. Log in to your blank display and use CTRL+ALT+F# to enter command line.

  3. sudo find . -type f -name "*displays*"

  4. mv ~/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml ~/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml.bak

  5. sudo reboot

I hope this quest may help somebody.


You should be able to open (and set properties for) a display via the virtual terminal console provided you know the display number for the running X session. That's usually :0 for the primary physical display but that's not always the case. For example, to query display :0

xrandr -d :0 -q

To re-enable a display that's been turned off, it's usually sufficient to use the --auto e.g. to turn the LVDS1 output device on display :0 back on

xrandr -d :0 --output LVDS1 --auto 

I would extend the answer of Martin Marčan by replacing the sleep with a command that switches to the black console:

chvt 7 && xrandr -d :0 --output LVDS --auto

where 7 is the number of the console used for X11 (usually 7 or 8) and LVDS is the name of the output you want to reconfigure. You can retrieve the list of outputs first with

xrandr -d :0