General :: Ubuntu - Wmctrl Cannot Open Display When Session Initiated Via Ssh+screen
Sep 20, 2010
I'm using wmctrl on an Ubuntu machine to manage windows from a script, that I run inside a (gnu) screen.
If I start the screen session from the local machine, wmctrl works fine, including if I completely close the terminal window and issue the wmctrl commands when connecting to the screen remotely via ssh.
Conversely, if I connect remotely with ssh and start a screen, wmctrl doesn't work (returns "Cannot open display") even if I attach that screen session locally from the Ubuntu Terminal.
I guess there is some hidden screen parameter that doesn't get set in a way that allows accessing the display when it's launched remotely -- any ideas what it is and how to modify it from within a remote ssh-screen session so that that the script can access the windows?
I use a program which makes a large image which I have to scroll to view. The program has no way to save the image, and I have no access to the source to modify it. The only way I have to get the image from the program is by screenshot. My goal is to save the full size image without having to piece together individual screenshots. I'm using this script to try taking a screenshot:
This uses wmctrl to get the window id ($window) for a window named "Program". It then tries to resize the window to the desired dimensions. It uses imagemagick (import) to save a screenshot.png on the user's Desktop. All of this works except the resize step. I can resize the window using wmctrl -r -e, but sizes greater than the screen size don't work. I'm using Ubuntu 10.04 and the Gnome Desktop. I run two monitors, but I've tried this with one of them disabled. Is there a way to resize the window larger than my screen to get a huge screenshot?
Part II: I tried using xrandr to set up screen panning, so as to have a bigger desktop than my monitor. xrandr --output LVDS --panning 2600x2500 This command makes the laptop screen pan over a 2600x2500 size desktop, even though it can only show 1440x900 at one time. To turn off the panning, I can use a similar command to set total size and with zeroes for the panning section. This gives me back my original laptop display behavior. xrandr --fb 1440x900 --output LVDS --panning 0x0 This is all done with xrandr, and does not require any Xorg.conf changes (my Ubuntu system doesn't even have an Xorg.conf).
My video card seems to only allow about 6.5 million pixels, even though the maximum dimensions are 8192x8192. That maximum seems to be the maximum for either dimension, but there is a limit to how many pixels can be drawn, which is the width multiplied by the height. Once I did the screen resize, I tried my script again and got a screenshot. The screenshot however is totally scrambled. I'm not sure if it's unable to take a screenshot of an off-screen window or if it is unable to handle the large dimensions of the window. With the panning display, the window should think it is visible, and the window manager should think it is on-screen. So there is a pixel buffer somewhere with those pixels in it, so there should be a way to get a screenshot.
At work, we have a linux machine which is shared among the members of my team. Each of us runs an XServer on our desktop, which allows us to launch XClients (xterm, debuggers, etc) on the linux machine.We all are using X11 forwarding feature with SSH. I personally run all shell sessions behind screen because I like to be able to detach if needed. We've seen issues when the $DISPLAY variable gets crossed between different users. Let me outline a series of events:
1. user1 logs in and $DISPLAY = localhost:10.0 2. user1 launches a screen 3. user1 loses connection to linux machine (eg. desktop reboot) 4. user2 logs in and $DISPLAY = localhost:10.0 5. user1 logs in and $DISPLAY = localhost:11.0 6. user1 resumes screen from previous login, but in this screen $DISPLAY=localhost:10.0. 7. user1's X apps get displayed on user2's desktop!
I assume someone must of encountered this before. Are there any known solutions? Is there a way to configure screen, so that when a session is resumed it inherits the $DISPLAY?
The following message comes up when I boot up: Logging in user Warning: Cannot open ConsoleKit session: Unable to open session: Launch helper exited with unknown return code 0. When I press OK, the system completes the start up and everything looks normal. But when I try to connect to internet, I get the following message:
KNetworkManager cannot start because the installation is misconfigured. System DBUS policy does not allow it to provide user settings; contact your system administrator or distribution. KNetworkManager will not start automatically in future. If I reboot the system, I logg in successfully. So far the problem has appeared approximately upon every second time I boot up. Rebooting the system seems to take care of it.
Don't know what info is of interest. I'm using
Opensuse 11.2 KDE 4.4.2 (Factory) After upgrade from 4.4.1 to 4.4.2 it worked fine for a week or so.
I do a clean install of slackware64 13.1 beta1 with KDE and switch default runlevel to 4 in /etc/inittab.
I try to login in kdm, I always come back to the login....
I try this with default runlevel 3 and an .xinitrc with "ck-launch-session startkde" .. works without problems, so I switch back to default runlevel 4, now i can login and only get the error "Cannot open ConsoleKit session: Unable to open session..."
I am trying to write a bash script to open 1 screen session with multiple windows... each one running a different service. Is this possible? I tried several things, and I can start up multiple sessions really easy.. but not 1 session with multiple windows...
I want this so I can attach to that session and quickly move between the different windows.
I have the following scenario that doesn't seem to work normally. I have a windows 7 pc from which I am using putty to connect to my other linux servers (all running redhat 5 and 6). So here is the scenario that works and one that does not work. And I'm trying to figure out the one that does not work. Scenario that works:
From windows 7 (putty) I ssh into Linux_Server_1. echo $DISPLAY localhost:10.0
I run xclock and I see it pop up on my windows 7 pc. I am using xming on windows 7 to help me populate the display from linux to windows. One that does not work:
From windows 7 (putty) I ssh into Linux_Server_1. Then from Linux_Server_1 I ssh into Linux_Server_2. echo $DISPLAY <no output>
I try to setup $DISPLAY with localhost:10.0 or 0.0 or even my windows 7 pc ip address:0.0 ....etc Then when I try to run xclock I doesn't work.
I get these error messages: Error: Can't open display: <ip of display>
Also as a side note all our Linux servers are sitting on one subnet. My pc is sitting on another subnet. I use vpn to connect to the subnet where the servers sit from my pc.
I have logged as e.g. user1 via ssh into my machine. Then I perform `su -` to switch to root user and I don't see debug messages which are normally displayed when I log as root via system console.How to display console messages in ssh session ?
I'm trying to minimize windows from the CLI (not tied to Gnome/KDE). wmctrl mentions it can set a `hidden' option for windows but this doesn't seem to work. Also found this: [URL]
In the past, when I open a gvim session on a remote machine, the title bar of gvim would show the machine name in brackets. I am not sure if this was done by the remote gvim itself, or the local window manager. In the past I have used gnome2, although I am currently using unity (and finding it rather frustrating). Is there some setting I can change to always force remote windows to display the source machine?
I just tried FreeNX. I work great. I am thinking about uninstalling the vino/vnc on my machine.
However, I'd like to know if FreeNX can access the session that open locally on the server. I tried session 0 and 1, none of them can access the local session.
For default vnc, the connection will let you access the local session on the server. Can FreeNX do that?
I'm ssh'ed into a machine and logged in as a different user. Is it possible to open a few new windows that will still be ssh'ed into that same machine, still logged in as that user?
I'm starting the first command in screen like this: screen -d -m -S testen -t lalala watch df -h Now I have a screen session running in background and I can reconnect at a later time. But how can I run a second command (in a new window) in the same screen session?
I'm connecting via ssh to an Ubuntu server that has a physical display attached.I'd like the physical display of the server to remain locked while I'm connected remotely.Is this possible? How? Also, is there a way to automatically unlock the screen for the VNC session, which is made from localhost via an ssh tunnel?
I typically have several terminal windows each of which is connected via ssh to a remote server. In each window I work using the gnu screen program, to ensure persistence of the interactive processes in case of a disconnection.
Currently, whenever the ssh connection drops (such as when I put my client computer to sleep overnight) I have to manually and tediously restart the ssh session inside each window, and then in each window tediously resume the specific screen session (e.g. "screen -r 3453" in one window, "screen -r 3462" in the other etc.)
Is there an elegant way to automate this? Specifically:
reconnect the ssh session if it drops, as soon as an Internet connection is detected run the specific screen instance for the terminal window as soon as ssh reconnects
I'm trying to connect to my linux server but I'm having some major problems. The server had OEL 5 installed and my local pc is running Windows XP. I'm using PuTTy to connect to the server with Xming running on my loacl machine. I login as root and run the following command - export DISPLAY={ipaddress}:0.0I then run xclock and get the following error - Xlib: connection to "{ipaddress}:0.0" refused by serverXlib: No protocol specifiedError: Can't open display: {ipaddress}:0.0The strange thing is that on my bosses pc (who has got almost the exact same setup ie. PuTTy & Xming) is works perfectly.
I tried to connect to remote server ,which is installed Centos 5.4 x86, through Xmanager on windows 7, and got this error.
Quote:
/usr/bin/xterm Xt error: Can't open display: %s
At the remote server, I turned on firewall and after this I got the above-mentioned error message. I do this accrding to instruction on remote server.
Quote:
2. Firewall (TCP/UDP Ports) Configuration Open UDP port 177 from the PC to the remote host direction. Open incoming TCP ports 6000~6010 from the remote host to your PC. After adding these ports "/etc/sysconfig/iptable" as the enoder mentioned, /etc/init.d/iptables restart
3. Reboot the remote host and start Xmanager <- I could not restart remote server.
I have dual monitors (both 1600x1200) and X is set to span them. I prefer to set my Eclipse window to 3200x1100. However, when I use VNC to connect to my desktop, I'd have to pan around a lot, so I use wmctrl via a script to resize Eclipse (and Chrome, etc.) to better fit my smaller VNC viewport.
When I return to my dual-monitor desktop, I want to resize/move my windows again. But wmctrl does not work correctly. If I do
Code:
(from a script), then instead of putting the window at 0,0 and width 3200, the window appears on the second monitor (i.e. at 1600,0) with width 1600. So I must manually resize it which is more difficult.
Am I using wmctrl correctly? Is it not wmctrl's problem but my window manager? I'm using compiz in Ubuntu 10.10.
I have centos 5.3 i got the login screen but after logging shows error as-- your session only last less than 10 seconds . if you have not logged out yourself tyhis could mean that there is some installation problem or that you may out of disk space .try logging with one of fail session.
I try to change locale for a program to run my native language with root. I don't know what I made, but can't open gui programs from konsole with root account.
It appear this error:
Code:
When type locale, it appear:
Code:
Yesterday I make run level 4 to skip typing startx in console, and login directly to KDE.
I with one problem to open files on terminal. By example, I open the thunar on terminal, see the error:
gustavo@universe /media/montagem $ thunar (process:7902): Gtk-WARNING **: Locale not supported by C library. Using the fallback 'C' locale. Maximum number of clients reachedThunar: Cannot open display: gustavo@universe /media/montagem $ ^C