Using Debian Stretch. My computer starts with the screen sideways. I can set it right with xrandr -o 0 but this only works for the session. Using rc.local does not work because X session is not running then.

Can I somehow set the default screen orientation so that the login screen and following are oriented correctly across sessions?

  • How is your screen set up (resolution, size, display make, video card)? Do you have a widescreen display that is mounted on its side or something similar? Framebuffer display rotation is possible, but if there's a lower-level solution I prefer to use that. – ErikF Feb 18 '18 at 6:32
  • The computer is an ASUS Monitor is InfoVision LCD monitor graphics card is Intel Atom /Pentium Processor x5 Integrated Graphics Controller. Size 12" Aspect Ratio is 16:9 Resolution is 1366 x 768 – BarryG Feb 18 '18 at 11:59

If you have the fbcon module in your kernel (this is usually the case), then you can control screen rotation for text mode using that. Per this answer (for Ubuntu, but it's generally applicable):

  1. First, make sure that fbcon is working:

    $ echo 1 | sudo tee /sys/class/graphics/fbcon/rotate

    (or rotate_all to affect all virtual framebuffers; valid values are 0 through 3, starting normally and rotating 90° clockwise for each additional number.)

  2. If the rotation works, add or edit the GRUB_CMDLINE_LINUX (or GRUB_CMDLINE_LINUX_DEFAULT if you're paranoid) line in /etc/default/grub:


    (replace 1 with whatever value worked for you.)

  3. Run sudo update-grub (or whatever you use to update your grub.cfg configuration).

If your computer boots using EFI, you may need to add video=efifb to GRUB_CMDLINE_LINUX.

  • The sudo tee /sys/class/graphics/fbcon/rotate does not work because rotate is not a directory. fbcon is a link to /../devices/virtual/graphics/fbcon So i could not test. Tried fbcon=rotate:0...3 in this command but that did nothing just returned to the prompt. fbcon appears to be there OK but testing it before editing GRUB was not possible .... so far – BarryG Feb 20 '18 at 5:31
  • OK so I tried the update to grub but that had no effect. – BarryG Feb 25 '18 at 7:00

Make a script, start it with #!/bin/bash and add the command which fixes your screen. Then add the script in crontab so it gets executed on every boot:

crontab -e @reboot path_to_script/name_of_script.bash

This will allow your fix to be automatically applied as PC boots.

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.