I have a Ubuntu Server 16.04.02 LTS configured as a Kiosk (see my question here) but it works only if a Monitor is connected when I'm booting the computer.
When I boot the computer without a Monitor connected and connect one later, nothing is shown on the monitor.
I have no control on what will be connected on the computer or when it will be connected. Also, rebooting is not a good solution because the system must stay online.
Wrong status with xrandr
I tried xrandr -q
to diagnose and the status is disconnected even I connected my monitor after booting. Same if I disconnect the monitor later, xrand -q
return connected.
export DISPLAY=:0
export XAUTHORITY=/home/kiosk/.Xauthority
sudo xrand -q
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
DP1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 480mm x 270mm
1920x1080 60.00*+ 50.00 59.94
1920x1080i 60.00 50.00 59.94
1680x1050 59.88
1400x1050 59.95
1600x900 60.00
1280x1024 75.02 60.02
1440x900 59.90
1280x800 59.91
1152x864 75.00
1280x720 60.00 50.00 59.94
1024x768 75.03 60.00
800x600 75.00 60.32
720x576 50.00
720x480 60.00 59.94
640x480 75.00 60.00 59.94
720x400 70.08
DP2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
What is the proper way to detect monitors and display correctly with good resolution? Must be autocratically configuring the display.
Thanks!