Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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.

share|improve this question
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. – quack quixote Mar 20 '10 at 20:58
I was hoping for a kernel command flag that would choose which video card to connect to. – Tim M Mar 20 '10 at 21:03
+1 good question. – bbatman Sep 20 '11 at 16:08
Please specify your version of Linux and window manager. – harrymc Aug 31 '12 at 5:51
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 '12 at 8:06
up vote 3 down vote accepted

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.

share|improve this answer
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 '12 at 5:36
I no longer have the hardware to test this, can anyone confirm that this works? – Tim M Feb 16 '13 at 16:26
@Tim M: I tested it. It works. – beroal Jan 18 '15 at 14:33

During boot

To set any monitor as primary during the boot, this must be a parameter of the BIOS. If there is no option to do that, then there is no other possible solution, since the linux bootloader is (AFAIK) dependent on the BIOS. The second monitor won't boot until the OS is up and running.

The most you can do here is upgrade your BIOS (carefully) to the latest version and examine thoroughly all the available parameters. Or, as you have found out, disconnect the unwanted monitor during boot.

However, I do wonder what will happen if you switch the video cards themselves in the motherboard slots.

After boot

One can use the xrandr command to change the primary monitor in Linux distributions. Calling xrandr with no parameters will give all the available information about connected monitors.

Here is how to query the names of all connected monitors :

xrandr --prop | grep " connected " | cut --delimiter=" " -f1

Here is one way to set the primary monitor :

xrandr --output <monitor-name> --primary

This Ubuntu wiki article describes in the section Setting xrandr changes persistently several ways to make xrandr customizations permanent from session to session: .xprofile, kdm/gdm or xorg.conf.

This article can be useful as an example of how to set a script to run at login time :
Setting up dual monitors system-wide with XRandR on Debian Lenny

share|improve this answer

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.
share|improve this answer
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 '12 at 1:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.