Change Linux Console's Default Monitor

13,992

Solution 1

I think the option we're looking for here is fbcon=map:n where n is the number assigned to the fb device for the desired video output.

Documentation/fb/fbcon.txt explains it and also mentions con2fbmap as the utility for changing it at runtime.

Solution 2

As for changing what console runs on what monitor (frame buffer @ /dev/fbx), you can download this small, eighty line C program that allows you to specify such things.

wget https://raw.githubusercontent.com/kunguz/pi3b/master/con2fb.c
gcc con2fb.c -o con2fb.out

After you have downloaded and compiled that, it's simplest usage is sudo ./con2fb.out /dev/fb[frame buffer number, starting at 0] /dev/tty[console number, starting at 1].

This will "lock" the specified terminal to the specified monitor (frame buffer), so when you try and and switch to a terminal that's been assigned to a monitor, it will give focus to that terminal instead of switching it on the current display.

Remember though, frame buffer != physical monitor. Each monitor which you want to have a seperate tty on must be plugged into a seperate graphics card (so seperate frame buffers).

Also you can crash the kernel if you're not careful, so watch out you don't try and trick the program! ;)

Share:
13,992

Related videos on Youtube

Tim
Author by

Tim

Updated on September 17, 2022

Comments

  • Tim
    Tim over 1 year

    Is there any way to specify which monitor the console is displayed on in Linux?

    Details:
    I have a 3 monitor setup with 2 video cards. When I boot the computer, the BIOS displays on the PCI graphics card (which has a small monitor). When starting Linux, the console is displayed on the same monitor. Is there a way to have the console output on a different monitor? I'm using the vesafb framebuffer.

    I don't see a way in my BIOS to change the default video card.

  • Daniel H
    Daniel H over 11 years
    The OP is talking about a virtual console, not an X window. If you have a graphics environment, this can usually be found using ctrl+alt+F1 through ctrl+alt+F6. (you can get back to X with ctrl+alt+F7).
  • Thalys
    Thalys over 11 years
    I haven't gotten to test this out, but this is the closest answer to plausible I can find. I'm giving this the bounty, and will comment when I test this out. All the other answers seem to talk about X, so are obviously not as likely to be correct.
  • Tim
    Tim about 11 years
    I no longer have the hardware to test this, can anyone confirm that this works?
  • beroal
    beroal over 9 years
    @Tim M: I tested it. It works.