17

I want to rotate my console (not X Server) by 90 degrees (clockwise).

The following seems to work for me: echo 1 > /sys/class/graphics/fbcon/rotate; however, I'd prefer to use a kernel option in Grub, rather than including the above in the /etc/rc.local script.

The fbcon documentation outlines the following option that can be passed to the kernel: fbcon=rotate:<n>. Unfortunately, when I modify /etc/default/grub and modify the GRUB_CMDLINE_LINUX line like this:

GRUB_CMDLINE_LINUX="fbcon=rotate_all:1"

... it doesn't work. I also ran update-grub before rebooting.

I've also tried this:

GRUB_CMDLINE_LINUX="fbconsole=rotate_all:1"

Still nothing. Any thoughts?

BMiner
  • 441
  • 1
  • 3
  • 10
  • Why don't you want to edit `rc.local`? – Emanuel Berg Mar 19 '13 at 23:05
  • @EmanuelBerg If you edit `rc.local` it will only run after the system has finished booting, which means if anything goes wrong and you land in single-user/recovery mode, the screen won't be rotated. By putting it on the command line, the screen will be rotated correctly relatively early in the boot process. – Malvineous Dec 27 '20 at 13:16

4 Answers4

17

Figured this out. You may need to add video=efifb to ensure that the framebuffer console is used:

GRUB_CMDLINE_LINUX="video=efifb fbcon=rotate:1"

EDIT: The efifb driver is designed for EFI firmware only, especially Intel-based Apple computers. However, as I've found out, it also works for non-Apple PCs. I am running the proprietary nVidia drivers on my Linux system, and the efifb driver works quite well. I assume it works for me because I am using nVidia drivers, and the "native" fbdev driver conflicts with them.

To be honest, I don't fully understand why the efifb driver makes things work, but if someone else does (or if you can get things working with another framebuffer driver with nVidia drivers installed), please comment below. Thanks!

BMiner
  • 441
  • 1
  • 3
  • 10
  • Thanks for posting your solution! If this did indeed solve it for you, please accept it so the question can be marked as answered. – terdon Jan 12 '15 at 23:50
  • 2
    Big caveat: This only applies if your machine ships with an EFI-enabled BIOS. – Alex Jan 12 '15 at 23:47
  • @aperezbios - Are you sure that's the case? I'm pretty sure that I've seen this working on a conventional BIOS system. – BMiner Jan 16 '15 at 19:31
  • @BMiner +1. With the option "video= **efi** fb" it stands to reason this only works on *efi* BIOS. Possibly, there is a different command for non-efi BIOS. – MariusMatutiae Nov 29 '16 at 09:58
  • @MariusMatutiae - Indeed. The `video=efifb` part isn't necessary if you are running a BIOS firmware or booted in BIOS compatibility mode with an EFI firmware, though it probably doesn't hurt either. *Technically speaking*, there is no such thing as "EFI BIOS", just EFI firmware *or* BIOS firmware. – BMiner Dec 05 '16 at 14:43
  • @MariusMatutiae - But... since I am running nVidia proprietary drivers... I had to use the `video=efifb` line to makes things work for me. I think I've used the same solution for BIOS firmware and for EFI firmware PCs. – BMiner Dec 05 '16 at 14:53
  • Old question and answer, but you have written `rotate_all` in your question, then answer by adding something about `efifb` claiming it works, but you have also silently changed `rotate_all` to `rotate`, which is the _actual_ fix. – pipe May 18 '19 at 09:10
  • @pipe - are you saying that simply `GRUB_CMDLINE_LINUX="fbcon=rotate:1"` would suffice? – BMiner Jul 29 '19 at 01:54
  • @BMiner Yep, that's the only thing I'm using. I'm not using any nvidia drivers on my system though. – pipe Jul 29 '19 at 04:04
6

There is a small but important difference between the documentation and what you have written in your config file:

…the following option that can be passed to the kernel: fbcon=rotate:<n>

While you have written

fbcon=rotate_all:1

rotate_all is not a valid keyword. If you leave out the _all suffix, it should work:

GRUB_CMDLINE_LINUX="fbcon=rotate:1"

pipe
  • 921
  • 10
  • 25
  • 3
    The documentation OP linked does mention `rotate_all` as a valid name in the `/sys/class/graphics/fbcon` sysfs directory. It's just that the kernel arguments don't use the same set of words as the sysfs attributes do. – Ben Voigt Dec 20 '19 at 03:32
  • FYI `rotate_all` now works on the kernel command line. I don't know when it was introduced but works with kernel 5.6.12 dated May 2020. – Malvineous Dec 27 '20 at 14:54
0

writing this answer with the hope that it will help folks in 2023.

GRUB_CMDLINE_LINUX="fbconsole=rotate:1"

is what works on the kernel command line.

As an Archlinux user running kernel 6.1.6 and latest version of grub, i can confirm that the above command line also ensures that all virtual terminals are rotated clockwise.

For the record, 'rotate_all' is not recognized on the kernel command line.

  • 2
    Does `fbcon` no longer work? It is what is still [documented](https://www.kernel.org/doc/Documentation/fb/fbcon.txt) so I am skeptical. – Olivier Jan 16 '23 at 20:23
0

fbcon=rotate:1 is what worked for me in 2023.

Arch Linux, kernel 6.1.26-1-MANJARO

grub-mkconfig (GRUB) version: 2.06

  1. Edit /etc/default/grub

  2. Add fbcon option:

     GRUB_CMDLINE_LINUX="fbcon=rotate:1"
    
  3. Update Grub

     sudo update-grub
    
NP2048
  • 1
  • 1