Controlling a secondary X display on a different video card through VNC (or similar)
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Controlling a secondary X display on a different video card through VNC (or similar)
Greetings!
First of all I'm using Ubuntu 7.04.
I'm trying to set up some X with VNC config here.
I'll explain my reasons first:
I use CF, and I'm also a dual monitor lover. While virtual desktops and pretty cubes really help, there's sometimes when I need a secondary monitor showing up some useful info I need in realtime, either because I'm programming, watching something, playing fullscreen while doing something in background I want to watch the progress off without swapping VTs and such.
Now what I have and what I've tried:
My main card (GeForce4 Ti 4200 AGP8X 128Mb) is plugged to monitor #1 (Compaq) and my secondary card (Trident 4Mb PCI) is plugged to an 14" 640x480 monitor.
If I enable Xinerama, I wouldn't be able to run CF because it tries to be the window manager, and thus it can't manage display :1 (Trident) because, obviously, it can barely display anything "3D" by software.
Also, I can't enable or use twinview because my GeForce isn't dual-head and thus it only has one VGA and TV output.
I had a solution once which was to use x2x and/or synergy to control the secondary display like if it was a multiseat system, idea that didn't work because those are set up to work with more than one keyboard and mouse at the same time, so I always ended up with mirrored input in both displays.
I went to the #ubuntu IRC channel and someone suggested me to just start some X on the other display and start a VNC server on it and control it from the main display. Of course, that wasn't exactly what I was trying to archieve, but hey, it's something different to try out!
So I tried to configure everything. Here's my xorg.conf:
So far so good, I have X working on the secondary display by running this on VT1:
Code:
xinit -- -layout BW :1 -sharevts -novtswitch
That works and I can switch to VT7 (GeForce's X).
Then I tried to set up x11vnc.
Code:
x11vnc -display :1 -bg
I've tried with and without -bg, with and without -desktop :0 (or :1), with -noshm and other options, none has worked.
I can get a connection to the server if I use -bg, but it doesn't refresh until I switch to VT8 (Trident's :1) and then back to VT7 (GeForce's :0) which is when I get in the VNC window on :0 the display on :1 for a few seconds before it freezes, then I must do the VT switching again.
The root of the problem, I think, is that the Trident :1's X doesn't actually refresh anything until it gets some input (or "focus") and it loses it again when I switch to VT7.
What puzzles me, is that if I start X on the same device (this is, the GeForce) like this:
Code:
xinit -- :1
Then switch back to VT7 and run x11vnc and try to connect - that works!, why does it work on :1 on the same device, but it doesn't on :1 on the other device??.
From what I see, you want two x sessions on two monitors. You don't need to join the two screens into one big one, you are happy just to open an app to a particular screen and have it stay there.
Why not just use the regular X dual head?
However, you are going to have to identify those cards by their BusID in xorg.conf
From what I see, you want two x sessions on two monitors. You don't need to join the two screens into one big one, you are happy just to open an app to a particular screen and have it stay there.
Why not just use the regular X dual head?
However, you are going to have to identify those cards by their BusID in xorg.conf
EXACTLY!!!!! finally someone who understands what I want! xD
Identifying the cards by the BusID I can do, I did so with the Trident Device section if you take a look at the xorg.conf file .
What's the regular X dual head config? does that work with my setup? and if so, can you guide me or similar, please?
Thanks in advance!!
/Edit:
By the way, another reason I also want two separate X displays is because I can kill display :0, init a bare fullscreen :0 for playing a game on the same display while the secondary one on :1 keeps running, because it's not attached to :0's X initialization and :1 won't be killed.
I would reconfigure the xorg.conf file first though... it looks a bit of a mess there.
The Compaq will be DISPLAY :0.0 running off the nvidia card and the Multilite (which I keep reading "mutilate") should be DISPLAY :0.1 with lower resolution. Unfortunately, dynamic moving between displays is not supported.
You get a particular app to open on a chosen screen with the -display DISPLAY parameter.
I would reconfigure the xorg.conf file first though... it looks a bit of a mess there.
The Compaq will be DISPLAY :0.0 running off the nvidia card and the Multilite (which I keep reading "mutilate") should be DISPLAY :0.1 with lower resolution. Unfortunately, dynamic moving between displays is not supported.
You get a particular app to open on a chosen screen with the -display DISPLAY parameter.
Lol, hehe the monitor is a Multilite brand indeed! that happens .
That works like I had it a year ago, but the display doesn't seem to work unless I disable Compiz Fusion since it also wants to manage Display :1 it can't because the Trident card is way tooooooo old to support anything 3D and all I can do and see is to move the mouse to and from the other display... but nothing more.
Also, if I switch to a terminal, :1 also gets disabled showing garbage on the screen - something that doesn't happen if I start X manually with a different layout and -novtswitch -sharevts.
In theory, my idea is to have a separate :1 display that doesn't have to neccessairly (sp?) be controlled my moving the mouse cursor to the edges, I could control it using VNC or XDMCP or anything else, I wouldn't mind that, and, of course, be independent from :0.
What I'm trying to archieve is something similar to the called Multiseat systems, here's some info I've looked around for:
Basically my own desktop PC would run as an "X server" and the client would be itself. In those multiseat systems, they use USB keyboard and mouse for the other users, I've read that it can be done with one keyboard and mouse only, but I haven't found info about it, nor I have a clue how to simulate something like that...
I went into the #xorg chat yesterday and asked how could I make a null device (so I could assign that to :1 instead of an USB mouse/keyboard I don't have ) and they pointed me to the "void" x.org driver. That worked, but I had no way to control the other display then.
I appreciate your help, I hope those links give some clue to you because to me, they've given all the clues they've could to me :/ maybe you'll have a different idea?
Another solution would be to know how to just start another X display (not neccessairly (sp?) on the secondary card (Trident :1) ) and display its contents by ANY way in the secondary monitor...
I've tried running :1 as a "ghost", just xinit -- :1 and start x11vnc -display :1 -forever, and then making my own .xinitrc for the secondary monitor and running it as :2... the xinit would then run vncviewer :0... that works, but the problem persists: The secondary display freezes when I'm not in vt8 (ctrl+alt+f8).
The very easiest method is to run a thin-client off your machine which uses the other head. Then remote it's desktop back to you. This would give exactly the functionality you want and the hardware is incredibly cheap as it need only be apos.
Next up in difficulty is to run a VM which controls the other screen. Exact details depend on the kind of virtualization being used.
I've been able to set up VNC to send a remote desktop to the same machine. VNC creates it's own X session - usually with a lite WM by default... I've used this to run more than one desktop simultaneously.
So, if it is possible to use this, you should attempt to control which display VNC outputs to. Certainly do your experimenting without Compiz.
I suspect, if you change the second screen line in ServerLayout to Screen "Side Screen" then that will remove the relationship while still letting X know about the other screen. You want vnc-server to output to the side screen, and use vnc-viewer to manipulate it.
But maybe you should try export a terminal first.
When I was writing the last post, it occurred to me that it may be possible to start a windows manager with the -display parameter in the dual-head arraingement before... but never seen or heard of this being done. It may be more likely to work with a desktop shell, like DR17.
Compiz-fusion has settings for multi-head that I haven't looked into in detail. They seem to be spread through the menus and require careful observation to spot them.
...
Note: when you boot to CLI, or exit to a terminal, you are shutting down the X server. So X's dual-head will no longer work. Presumably that is why you get the effect you report when you go to terminal.
Realize also that you don't need to use the main screen as the bootup screen. You could boot to xfce (say) on the side screen as screen 0 and then open gnome (say) on screen 1 as your main workspace. Provided, of course, you actually can do something like gdm-start -display DISPLAY (still trying to leverage the multi-head thing here.) Maybe even knobble startx to set it up for you when you know that it works... but I'm getting ahead of myself.
Hmmm... that would look cool - you boot: the side screen shows boot messages, the main screen "no input". Text login on the side screen... then "startx", and the main screen comes to life. This could be more interesting than I thought!
In the immortal words of the great computer-philosopher-sage, Owah Taggi Khyam, "pass the coffee... need... more... coffee..."
Hmmm... reading Xvnc man page, I think I've got a bit confused... you need to be able to control the content of the side screen from the side-screen? Or are you happy just to have it display stuff, and you rotate your main desktop to manipulate it?
In the first case, vnc won't help you much. In the second, you need it to run "windows style" so you are effectively "copying" a local desktop to the other monitor.
Your main issue is still the desire to run different desktop environments in each X session.
Reality Check:
The xorg dual-head does what you want in terms of the raw functionality (you get to use both screens). Trouble is that it insists on the same desktop on both screens. The display capabilities of the cards/monitors is so disparate that this is not practical: either you accept running your classy card wildly under spec or come up with a way to have different desktop environments (DTEs) on different screens.
I am asking around networky guys I know. But workaround #1 I have is as follows:
1. keep xorg.conf (dual boot) as above. Boot to a simple DTE.
2. run xvnc-server to create a second x-session with a fancy desktop.
3. use vnc-viewer to look at it on localhost:0 (the main screen is an emoticon - gawds)
4. tweak it until it works, then automate.
This way you would get two active screens. This has the feel of a horrible hack to me though. Do I really need two x-servers to get two desktops? Strikes me that X should be able to handle this directly.
The very easiest method is to run a thin-client off your machine which uses the other head. Then remote it's desktop back to you. This would give exactly the functionality you want and the hardware is incredibly cheap as it need only be apos.
Next up in difficulty is to run a VM which controls the other screen. Exact details depend on the kind of virtualization being used.
So you mean to run a VM instead of an X server? (if I understood you correctly, VirtualBox/VMWare?).
Quote:
Originally Posted by Simon Bridge
I've been able to set up VNC to send a remote desktop to the same machine. VNC creates it's own X session - usually with a lite WM by default... I've used this to run more than one desktop simultaneously.
Yes, I have used VNC myself in the last tests I've done lately, it would be great, at least, to have it output to the other head... thing is, how to activate an X to display that output on the other head, if VNC occupies it?.
Quote:
Originally Posted by Simon Bridge
So, if it is possible to use this, you should attempt to control which display VNC outputs to. Certainly do your experimenting without Compiz.
I could try to redirect VNC to :1, but then, :1 will be busy with VNC and the I won't be able to start a X display on it, which basically throws everything off for me
Quote:
Originally Posted by Simon Bridge
I suspect, if you change the second screen line in ServerLayout to Screen "Side Screen" then that will remove the relationship while still letting X know about the other screen. You want vnc-server to output to the side screen, and use vnc-viewer to manipulate it.
Yet, they're in the same X initialization group, I need them separate :/.
Quote:
Originally Posted by Simon Bridge
But maybe you should try export a terminal first.
I was looking on info about that on #ubuntu but I didn't got much ideas... :/ I also had the idea to run a different VT on that monitor, and then using "Screen" I could control the 2nd VT from any terminal window on my main session, but I don't know how to create or even redirect a VT (TTY, GETTY) to :1.
Quote:
Originally Posted by Simon Bridge
When I was writing the last post, it occurred to me that it may be possible to start a windows manager with the -display parameter in the dual-head arraingement before... but never seen or heard of this being done. It may be more likely to work with a desktop shell, like DR17.
Compiz-fusion has settings for multi-head that I haven't looked into in detail. They seem to be spread through the menus and require careful observation to spot them.
It could work with desktop shells/environments, but not with WMs. IIRC, Linux only allows to have one WM at a time, so even if I could tell CF to not to use :1 due to its lack of 3D capabilities, it's still active on :0, and unless I detach :1 from :0, the only WM active will be CF :/, unless I kill it and start Metacity, which, obviously, starts on both.
Quote:
Originally Posted by Simon Bridge
Note: when you boot to CLI, or exit to a terminal, you are shutting down the X server. So X's dual-head will no longer work. Presumably that is why you get the effect you report when you go to terminal.
That's correct! I don't get that when I run another X separately on the other head, that's why I want to separate them, so they're not in the same X layout but instead use one layout for each head, that gives me the independence I need.
Quote:
Originally Posted by Simon Bridge
Realize also that you don't need to use the main screen as the bootup screen. You could boot to xfce (say) on the side screen as screen 0 and then open gnome (say) on screen 1 as your main workspace. Provided, of course, you actually can do something like gdm-start -display DISPLAY (still trying to leverage the multi-head thing here.) Maybe even knobble startx to set it up for you when you know that it works... but I'm getting ahead of myself.
Hmmm... that would look cool - you boot: the side screen shows boot messages, the main screen "no input". Text login on the side screen... then "startx", and the main screen comes to life. This could be more interesting than I thought!
In the immortal words of the great computer-philosopher-sage, Owah Taggi Khyam, "pass the coffee... need... more... coffee..."
Hehe XD pretty cool indeed I had it like that once about a year or two ago, it was pretty cool... the thing is that I couldn't run Beryl back in that time due to the same lack of 3D capabilities on the other head xD, and switching to terminal used to disable both displays (which was kinda annoying, and sometimes it locked the computer up).
Hmmm... reading Xvnc man page, I think I've got a bit confused... you need to be able to control the content of the side screen from the side-screen? Or are you happy just to have it display stuff, and you rotate your main desktop to manipulate it?
In the first case, vnc won't help you much. In the second, you need it to run "windows style" so you are effectively "copying" a local desktop to the other monitor.
Your main issue is still the desire to run different desktop environments in each X session.
I wouldn't mind to control the side screen from my main one, in fact that's what I'm hoping to do since controlling it from the side screen itself it's a pain from what I've read...
I'd prefer to control the side screen from the side screen itself, but if I can't, I'm happy having it display stuff and control it from my main one .
Alright, so you kinda know how to apply the second case? as I said maximum thing I've archieved is to run vnc through an .xinitrc script on the side screen as :2... that displays me my "ghost screen" on :1 which runs x11vnc... but it all goes down to hell when I switch to VT7... the other display freezes >.<.
>_> I'd dare to make a video and upload it to youTube...
/Edit!:
Quote:
Originally Posted by Simon Bridge
Reality Check:
The xorg dual-head does what you want in terms of the raw functionality (you get to use both screens). Trouble is that it insists on the same desktop on both screens. The display capabilities of the cards/monitors is so disparate that this is not practical: either you accept running your classy card wildly under spec or come up with a way to have different desktop environments (DTEs) on different screens.
I am asking around networky guys I know. But workaround #1 I have is as follows:
1. keep xorg.conf (dual boot) as above. Boot to a simple DTE.
2. run xvnc-server to create a second x-session with a fancy desktop.
3. use vnc-viewer to look at it on localhost:0 (the main screen is an emoticon - gawds)
4. tweak it until it works, then automate.
This way you would get two active screens. This has the feel of a horrible hack to me though. Do I really need two x-servers to get two desktops? Strikes me that X should be able to handle this directly.
X should be able to handle that indeed, but it doesn't thus why I came up with the idea to run two X-servers on the same machine, one for each head... this way, since there can be only one WM for one X, then one WM/DE in one X and other WM/DE in the other X! . (of course, the side screen would run something light such as fluxbox, openbox, xfce... something simple).
For applying workaround #1, you mean to do that on the main screen or the secondary screen? let's see if I got it right:
I know I got it kinda wrong, but if you could clarify a bit what steps should I take I would gladly try them... in the meanwhile, I'll make my youtube video to explain better... XD.
/edit:
Meh, nevermind about the youtube video... my camera's not good enough >.< it's blurry and barely visible (poor light input for video :/) sorry >.<
Note: this is under the heading of - "I haven't actually done this but..."
I was thinking that you run the regular dual head - verify this is fine for a light DTE... Gnome, Xfce, whatever. Presumably you get to a desktop on both screens.
xvnc-server can create another x-server
vncserver -geometry 1280x1024 -depth 24 -desktop main :1
vncviewer -localhost localhost:1 -display :0.0
... there is a full-screen made in the viewer too (F8). vncviewer is just a perl script so it should be amenable to the -display redirect. You will want to serve a smaller geometry at first.
IIRC: you need to modify $HOME/.vnc/xstartup to get a different desktop sent. Ideally, you try booting to Xfce and export Gnome... but the other way will be proof of concept.
(Remember, you have two x-servers running; :1 and :0, the first one has two screens configured; :0.0 and :0.1 )
.............
Windows-style: XP et al only has the one desktop, which WinVNC shares between hosts. So, you move a mouse on the local machine and the mouse moves on the remote and t'other way round.
The effect, for your situation, would be to have a window on a workspace in your main screen showing the content of the side screen. This should be tidy because the side screen is quite small.
In linux, xvnc won't do that by default. I've never seen any reason to set it up either. You have to share the xserver between two viewers.
You still need the dual head - but maybe you won't need to change the active display with the mouse. You still get the advantage of being able to change workspace and still see the side-screen contents. But it is more work for reduced effect.
You'll have to share the vncserver between two viewers - exporting one viewer to the side-screen (:0.1).
After you do this awhile, your head hurts. The main reason there is no pat solution here is that it is just so much easier just to buy new hardware. This is a "throw-away" industry we're in.
...
The root of the problem, I think, is that the Trident :1's X doesn't actually refresh anything until it gets some input (or "focus") and it loses it again when I switch to VT7.
What puzzles me, is that if I start X on the same device (this is, the GeForce) like this:
Code:
xinit -- :1
Then switch back to VT7 and run x11vnc and try to connect - that works!, why does it work on :1 on the same device, but it doesn't on :1 on the other device??.
Any help is GREATLY appreciated!!
I'm a bit confused what you are trying to do; and what you have achieved in the various experiments you've described in this thread... but anyway I think some info the the above question is here: http://www.karlrunge.com/x11vnc/faq....q-black-screen
That might not be the full story though... my guess is your GeForce has so much video RAM on it that it has no problem keeping the :1 in it and (amazingly) pollable by x11vnc. I think I saw a similar thing on an older MGA card.
BTW, I assume you are only using x11vnc for testing, right? In general, I am confused why VNC enters into what you are trying to achieve, but I haven't understood everything in the post...
Also, I'm not sure it would apply, but there also is a hack I wrote called "Xdummy" that takes the Xorg server and disables VT-switching for it. It uses the "dummy" Xorg driver to create a virtual X server (like Xvfb, for exporting via VNC), but I wonder if it would also work for a real card like your Trident...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.