Multi monitor CLI adventures
Hi all,
I've always enjoyed doing stuff in CLI rather than GUI when possible. That lead to the fact that currently I do almost everything in CLI. I've wanted to use multiple monitors on CLI for a very long time but never found out how to do it. Until now that is. I'm so happy I finally got it working that I'd like to share how I did it. So what do you need?
So let's get rolling. I assume you've got your hardware all set up properly and you just booted with the 2 videocards with on each video card a screen attached. There's a big chance one of your monitors is working and the other one isn't or is a mirror of the first monitor. Either way, let's check if they were detected properly. Code:
username@host:~$ lspci | grep -i vga The next step is creating a file with the following C code in it an compile it. If you don't have a compiler installed or if you are not sure you can always install it yourself: On Debian Code:
apt-get upgrade Code:
yum groupinstall "Development Tools" "Development Libraries" Code:
/* this is userspace utility which allows you to redirect console to another fb device Code:
username@host:~$ gcc -o con2fb con2fb.c Congratulations! You've got yourself a helluva working multi-monitor setup :-) Feel free to comment. This is a very short howto.
|
Out of curiosity, is this for enviroments without x (or any gui)
I can do this very easily in Linux mint by simply dragging the emulator to the other monitor. But if this is meant for without x - very impressive. |
Yes indeed, there are multiple programs for multiple monitor support in X. At the moment I'm running exclusively in framebuffer and I consider tmux to be my "window manager". X is currently not installed and from now on I've got even less reasons to do so :-).
And I don't know about the impressive part. It's no rocket science, I didn't write the code myself and I couldn't if I wanted to. It's just perseverance of a geek. However, I've got to say it looks rather cool on my desk, 2 1920x1200 24" monitors with each their own tmux session running :-). |
If you want it to keep updating, I think 'screen' multiplexer does that in the background, so maybe run your sessions inside of 'screen'(?).
|
Thanks for your input.
I am already using tmux as a terminal multiplexer which is an alternative to 'screen'. When one monitor 'loses focus' the updating stops, also in tmux. I can try it at home with screen but I expect the same behaviour. Why do I expect no change? I'm not sure about this but my best guess is that this behaviour has to do with how the kernel "efficiently" stops updating a framebuffer it assumes is not shown/in use anyway. Tmux or screen are still updating but the framebuffer simply isn't so the image you can see on the monitor simply doesn't change. But I might be wrong about this assumption :-) |
Single video card with multiple outputs?
Can the solution above be adapted to a single video card with multiple outputs of different resolutions? My current (X) setup has a 24" 1900x1200 via DVI, and a 19" 1440x900 via VGA. Otherwise, this is exactly what I wanted, and I've been looking for a solution for a few hours.
|
All times are GMT -5. The time now is 05:06 PM. |