LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 03-17-2011, 12:12 AM   #1
UnknownUser
LQ Newbie
 
Registered: Mar 2011
Distribution: Debian
Posts: 19

Rep: Reputation: 0
xrandr from remote through ssh?


I just tried to deactivate the VGA connection on my laptop remotely and received this result:

Code:
$ export DISPLAY=:0
$ xrandr
No protocol specified
Can't open display :0
$
I'm nearly certain I was able to use xrandr through ssh at some point in the past, but my memory of the exact time line is inadequate. It seems that what I attempted should be possible, does anyone know how to accomplish this? Searching the internet I found the procedure which I expected to work, the one which just failed for me.
 
Old 03-17-2011, 01:14 AM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,818

Rep: Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004
Try using the following:
Code:
export DISPLAY=:0.0
 
Old 03-17-2011, 02:02 AM   #3
UnknownUser
LQ Newbie
 
Registered: Mar 2011
Distribution: Debian
Posts: 19

Original Poster
Rep: Reputation: 0
Code:
$ export DISPLAY=:0.0
$ xrandr
No protocol specified
Can't open display :0.0
$
 
Old 03-17-2011, 02:08 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
The :0.0 display is local to my desktop. The :10.0 display is for my laptop. My laptop is the ssh client.

Code:
xrandr -display :0.0 -q
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 1920 x 1920
DFP1 disconnected (normal left inverted right x axis y axis)
DFP2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 510mm x 287mm
   1920x1080      60.0*+
   1776x1000      60.0 +
   1680x1050      60.0  
   1400x1050      60.0  
   1280x1024      75.0     60.0  
   1440x900       59.9  
   1280x960       75.0     60.0  
   1280x800       75.0     60.0  
   1152x864       75.0     60.0  
   1280x768       74.9     59.9  
   1280x720       60.0  
   1024x768       75.0     70.1     60.0  
   800x600        72.2     75.0     70.0     60.3     56.2  
   720x480        60.0  
   640x480        75.0     72.8     60.0  
CRT1 disconnected (normal left inverted right x axis y axis)
CRT2 disconnected (normal left inverted right x axis y axis)
jschiwal@elite:~> xrandr -display :10.0 -q
xrandr: Failed to get size of gamma for output default
Screen 0: minimum 320 x 175, current 1440 x 900, maximum 1440 x 900
default connected 1440x900+0+0 0mm x 0mm
   1440x900       50.0* 
   1024x768       51.0     52.0     53.0     54.0     55.0  
   832x624        56.0  
   800x600        57.0     58.0     59.0     60.0     61.0     62.0     63.0     64.0  
   720x400        65.0  
   700x525        66.0     67.0  
   640x512        68.0     69.0     70.0  
   640x480        71.0     72.0     73.0     74.0     75.0     76.0  
   640x400        77.0  
   640x350        78.0  
   576x432        79.0  
   512x384        80.0     81.0     82.0     83.0     84.0  
   416x312        85.0  
   400x300        86.0     87.0     88.0     89.0     90.0  
   360x200        91.0  
   320x240        92.0     93.0     94.0     95.0  
   320x200        96.0  
   320x175        97.0
 
Old 03-17-2011, 02:29 AM   #5
UnknownUser
LQ Newbie
 
Registered: Mar 2011
Distribution: Debian
Posts: 19

Original Poster
Rep: Reputation: 0
I'm not sure what you have demonstrated. I only have one display per host. I can only access the client display by prefixing it with localhost, as in "localhost:12.0".
Code:
xrandr -display :0.0
is the equivalent of
Code:
export DISPLAY=:0.0
xrandr
could you please clarify how you have a display :0.0 and a display of :10.0?

To clarify, I'm not using the laptop in the traditional manner. My desktop is the ssh client, the laptop is serving as a display only with no keyboard or mouse, hence the need to manipulate things remotely.

I feel the "No protocol specified" is the important bit of information, but I don't understand what it means.

Last edited by UnknownUser; 03-17-2011 at 02:38 AM.
 
Old 03-17-2011, 03:52 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
The ssh server creates a proxy for X11 connections. This proxy will had a DISPLAY of either :10.0 or :11.0.

For example, my laptop is named qosmio. My desktop is named elite. When I'm at my laptop and enter: "ssh -X elite konsole", a konsole shell is displayed on my laptop. It is running on my desktop (ssh server) and displayed on my laptop (ssh client).
Entering "echo $DISPLAY"
localhost:11.0

The program, konsole, is using localhost:11.0 for the display. The ssh server setup a proxy for my laptop's display on the desktop. It uses a different display.

Now if I enter in the ssh remote terminal:
mplayer video.mpg
the video will display on my laptop. (note: not the audio however)
If I run instead "mplayer -display :0.0 video.mpg" it will be displayed on my desktop's screen.

You are logging remotely into a laptop. The :0.0 display will refer to the laptop's first display. For a dual head interface the VGA port may be the localhost:0.1 display.

After logging in, enter:
xrandr -q :0.0
to display info on the LCD screen.
xrandr -q :0.1
to display info on the VGA screen. I'm not certain if a monitor needs to be connected. If not, a screen may not be setup for it.

If you use
xrandr -display :0.1 --prop
you may be able to see info on the VGA display, including verifying it is the VGA display.

On an HP laptop I once had, I would need to power cycle the laptop, after plugging in my TV, before the SVHS connector would be active. I found this was even true for the SVHS output on my Sony receiver with a Video switch.
 
Old 03-17-2011, 04:24 AM   #7
UnknownUser
LQ Newbie
 
Registered: Mar 2011
Distribution: Debian
Posts: 19

Original Poster
Rep: Reputation: 0
Alright, so we are indeed talking about the same thing. As I type this message into firefox using my desktop monitor (on the left) and my desktop keyboard and mouse, firefox is running on my laptop (a much more powerful machine with much much more memory). My laptop is connected to another monitor (on the right).

Usernames and hostnames removed:
Code:
$ ssh -X laptop
password:
Linux 2.6.32-5-amd64 #1 SMP Wed Jan 12 05:14:59 UTC 2011 x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
No mail.
Last login: Thu Mar 17 05:19:42 2011 from
$ xrandr -d :0.0 -q
No protocol specified
Can't open display :0.0
$
I think we are all in consensus that this should be working? It isn't working.

Also, maybe worth mentioning is that on the laptop, X is no longer located on Alt+F7, it is now on Alt+F8. The desktop is still running Debian 5.0 (lenny) with X on Alt+F7.

Also, in case anyone was wondering, if I walk over to the laptop and open a terminal window in X I can use xrandr to manipulate display :0.0 without incident. However if I switch to tty1 I get the same errors as when coming in through ssh. From the desktop, if I use Alt+F1 to login through tty1 I can successfully manipulate it's display. Surely this is strange?

Last edited by UnknownUser; 03-17-2011 at 04:42 AM.
 
Old 03-17-2011, 04:38 AM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
Try -d :0.1 if you switched to an external monitor. For example using a Fn key to cycle between displays may effect whether :0.0 or :0.1 exists.

Also check the /var/log/Xorg.0.log file on the laptop. It will tell you with displays are used.

One thing to note. Running firefox starts a wrapper script which may end up running firefox on the local machine if there is already an instance running, i.e. on ssh client. Use the "-no-remote" command line option if you want to run firefox remotely. (seems misnamed to me) I discovered this accidently. Entering "firefox --help" will show you what the command line options are.
 
Old 03-17-2011, 04:44 AM   #9
UnknownUser
LQ Newbie
 
Registered: Mar 2011
Distribution: Debian
Posts: 19

Original Poster
Rep: Reputation: 0
Trust me, firefox is running on the laptop, this desktop is a 1Ghz Athlon with 128 Mb of memory, I could tell the difference after waiting 5 minutes for the program to load.

See my last post, edited while you were posting.
 
Old 03-17-2011, 04:49 AM   #10
UnknownUser
LQ Newbie
 
Registered: Mar 2011
Distribution: Debian
Posts: 19

Original Poster
Rep: Reputation: 0
Perhaps I was confusing... what I typed looks confusing to me.

Do this:

Press Ctrl+Alt+F1 to access login screen of tty1
login
type xrandr -d :0.0 -q

it works right? It works on my desktop.

It isn't working on my laptop... something has changed and I don't understand what it is.
 
Old 03-17-2011, 07:00 AM   #11
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
Is an X server running on the laptop?

Did you log in with ssh to the laptop before running "xrand -d :0.0 -q" and "xrand -d :0.1 -q".

Do you have physical access to the laptop? does the LCD screen work?

If you want to disable the VGA port on the laptop, why not just unplug it?
 
Old 03-17-2011, 07:13 AM   #12
UnknownUser
LQ Newbie
 
Registered: Mar 2011
Distribution: Debian
Posts: 19

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jschiwal View Post
Is an X server running on the laptop?
Yes, gdm is running so there is always an X server.
Code:
 /usr/bin/Xorg :0 -br -verbose -audit 0 -novtswitch -auth /var/run/gdm3/auth-for-Debian-gdm-ROqYBW/database -nolisten tcp vt8
Quote:
Originally Posted by jschiwal View Post
Did you log in with ssh to the laptop before running "xrand -d :0.0 -q" and "xrand -d :0.1 -q".
Yes. I also attempted logging in locally through tty1. It only works from a terminal window within the current X session on the laptop.

Quote:
Originally Posted by jschiwal View Post
Do you have physical access to the laptop? does the LCD screen work?
Yes, it is cracked, but I can use it. See my previous post about switching to tty1.

Quote:
Originally Posted by jschiwal View Post
If you want to disable the VGA port on the laptop, why not just unplug it?
That works, true. This isn't something that I can't work around, but seeing as how this worked in Debian 5.0 and now does not work in Debian 6.0 I'd like to discover why for my sanity's sake.
 
Old 03-18-2011, 09:07 AM   #13
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
Power down the laptop, unplug the VGA cable, and power back up. I'm betting that the card won't enable the port if it's unplugged and "xrandr -display :0.1" won't have a result.
 
Old 03-28-2011, 03:23 AM   #14
UnknownUser
LQ Newbie
 
Registered: Mar 2011
Distribution: Debian
Posts: 19

Original Poster
Rep: Reputation: 0
Sorry, to have left this thread for so long. Some updates became available, and after installing them the problem disappeared. So, it's unsolved, but solved just the same.
 
Old 06-11-2014, 06:47 AM   #15
stefank
LQ Newbie
 
Registered: Jun 2014
Distribution: Gentoo
Posts: 1

Rep: Reputation: Disabled
As this was my first hit on google for a similar problem, I'd like to comment in this old thread.

In my case (Gentoo/KDE combination on the remote system) "xrandr -display :0.0 -q" would only work if the user (used for ssh) was actually logged in on the remote machine (i.e. had an active X session). "xrandr" did never work from ssh and always gave "Can't open display".

I don't know if this intended behaviour or can be fixed somehow.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't SSH to remote machine: Connection closed by remote host Avatar Linux - Networking 35 10-23-2017 01:21 AM
radeon and dual head, to xrandr or not to xrandr, that's the question i92guboj Linux - Desktop 1 06-17-2009 06:48 AM
Fedora 10/unable to ssh out from box to remote host (SSH within LAN ok) huskeypm Linux - Networking 3 04-14-2009 08:37 PM
SSH - Remote aplications in remote server Urien Linux - Newbie 11 04-04-2009 05:02 AM
Remote login with SSH, but display on remote computer. brodin Linux - Software 3 09-09-2007 04:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration