24

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.

5
  • 1
    i've had the same trouble on a dual-monitor setup (single video card); after swapping outputs i've determined the BIOS just displays on the first monitor to be detected. i get the right monitor if i disconnect or completely cut power to the one the BIOS usually picks, but if it's connected (even on standby) then the BIOS sends everything to that monitor. Mar 20, 2010 at 20:58
  • I was hoping for a kernel command flag that would choose which video card to connect to.
    – Tim
    Mar 20, 2010 at 21:03
  • Please specify your version of Linux and window manager.
    – harrymc
    Aug 31, 2012 at 5:51
  • 4
    I'm baffled by the answers and comments referring to X. The question is about the console, which is the tty where kernel messages go. GNOME? xrandr? window manager? What the hell?
    – Alan Curry
    Aug 31, 2012 at 8:06
  • @AlanCurry: That's what happens when the post is not clear enough.
    – harrymc
    Sep 3, 2012 at 7:21

3 Answers 3

9
+100

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.

3
  • 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.
    – Journeyman Geek
    Sep 7, 2012 at 5:36
  • I no longer have the hardware to test this, can anyone confirm that this works?
    – Tim
    Feb 16, 2013 at 16:26
  • 1
    @Tim M: I tested it. It works.
    – beroal
    Jan 18, 2015 at 14:33
3

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! ;)

-3

I believe this will depend on the window manager you are using. For example Enlightenment has the ability to remember window position.

Fluxbox also supports the saving of window positions and states.

I don't believe GNOME can do this out of the box since they believe that it should be up to the application developer to write code that can remember its last state.

So having this functionality depends on:

  1. The version of linux you are running
  2. The window manager you are using
  3. If you are willing to try switching your window manager to one of these
  4. And it depends on if these window managers are supported by your favorite flavor of linux.
1
  • 1
    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).
    – Daniel H
    Sep 4, 2012 at 1:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .