[/user/johnc] $ ssh -X server1 johnc@server1's password: Warning: No xauth data; using fake authentication data for X11 forwarding. Last login: Sat Jun 20 04:58:57 2015 from 10.68.76.230 [johnc@server1 ~]$ [johnc@server1 ~]$ xterm [johnc@server1 ~]$ xauth list server1/unix:10 MIT-MAGIC-COOKIE-1 [some output.....] [johnc@server1 ~]$ sudo -u appuser -H -s bash-4.1$ xauth add server1/unix:10 MIT-MAGIC-COOKIE-1 [some output.....] xauth: creating new authority file /user/appuser/.Xauthority bash-4.1$ id uid=1002(appuser) gid=310(dba) groups=310(dba) bash-4.1$ xtermNow XTERM will open with out any problem!
Showing posts with label DISPLAY. Show all posts
Showing posts with label DISPLAY. Show all posts
Monday, June 22, 2015
How to extend X11 forwarding after SUDO?
Most of the time "ssh -X username@servername" works for X11 (display) forwarding via SSH protocol. However, when we need to sudo to any application user, X11 does not work from that point on. Here is a quick fix to that problem.
Labels:
DISPLAY,
Linux fundamentals,
Solaris,
SUDO,
X11
Thursday, March 5, 2009
VNC with two monitors
Note : This article is true for Redhat Linux.
My users need big display because of type of their software tools. In this article, I will explain how to modify VNC's configuration to support two monitors.
I assume that the VNC is already working fine for other (single monitor) resolution. If this is the case, then go on reading. If you yet to setup VNC from scratch, it may not be the right article.
In my case, I did the two monitors setup in three steps: (note that my servers are already running VNC)
Once above three steps are done, then users can connect to VNC using their favorite VNC viewer (in my case RealVNC) to the IP address and port number 76.
For example 10.10.10.10:76
My users need big display because of type of their software tools. In this article, I will explain how to modify VNC's configuration to support two monitors.
I assume that the VNC is already working fine for other (single monitor) resolution. If this is the case, then go on reading. If you yet to setup VNC from scratch, it may not be the right article.
In my case, I did the two monitors setup in three steps: (note that my servers are already running VNC)
STEP 1) Edit /etc/services to add a new VNC port. In my case I added following line in /etc/services:
vnc-2500x1000x24 5976/tcp
STEP 2) Edit /etc/xinetd.d/vncserver to add new resolution entry given below:
############# FOR DUAL MONITOR #########################################################################
service vnc-2500x1000x24
{
disable = no
socket_type = stream
protocol = tcp
port = 5976
wait = no
user = demo
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 2500x1000 -depth 24 -SecurityTypes=None
}
#########################################################################################################
STEP 3) Restart xinetd service by following command:
# service xinetd restart
Once above three steps are done, then users can connect to VNC using their favorite VNC viewer (in my case RealVNC) to the IP address and port number 76.
For example 10.10.10.10:76
Labels:
DISPLAY,
How-to series,
Linux fundamentals,
VNC
Sunday, February 22, 2009
How to launch CDE, GNOME, xterm, ?
For Solaris:
CDE can be launched by : /usr/dt/bin/Xsession
GNOME can be launched by: /bin/gnome-session
Xterm can be launched by: /usr/openwin/bin/xterm
DTTERM can be launched by: /usr/dt/bin/dtterm
The main requirement is X-server should be running on the local machine. (I have tested on Windows PC).
CDE can be launched by : /usr/dt/bin/Xsession
GNOME can be launched by: /bin/gnome-session
Xterm can be launched by: /usr/openwin/bin/xterm
DTTERM can be launched by: /usr/dt/bin/dtterm
The main requirement is X-server should be running on the local machine. (I have tested on Windows PC).
Labels:
DISPLAY,
How-to series,
Solaris,
xserver
Tuesday, August 19, 2008
How to set default display driver in Redhat Linux?
I faced this problem when I was trying to install Redhat Linux 3 on a system with NVidia display card. After installation, everything came up fine upto X-server and then it was kind of blank screen. Obviously, the driver selected during the installation was not the perfect for the system. So, here is what I did to make it work with 'default' or 'vesa' driver:
1) Booted the system in single user mode.
2) Edited the file /etc/X11/XF86Config and replaced/changed at two places:
- Changed driver from "nvidia" to "vesa" in line starting with "Driver" in Section "Device"
- Checked for line containing "dpms" and appened "off" after it.
Option "dpms" "off"
3) Saved the changes and rebooted the system. Boom! It came up fine with default display driver.
Update on 03/23/2011::
Note: This article became alive again yesterday when I was doing X11 config on RHEL 4U7 server. User wanted GUI and video card was somehow not supported. The simplest way was to switch to VESA driver and get it going. User happy, I am happy!!! :)
Update on 03/28/2011::
This user again called me now for a better (smaller) resolution settings. At first, I thought that it may not be supported with default/vesa driver but the system's default drivers also support better resolution than default 800x600. Here is how I did that:
1) First of all, invoked "system-config-display utility". Using this utility, select the correct Monitor type. In my case, the correct type was "LCD Panel 1280x1024". I saved that monitor type and exited from utility.
2) Rebooted.
3) Again, edited the /etc/X11/xorg.conf file to add more resolutions.
Modes "1280x1024" "1280x960" "1024x768" "800x600" "640x480"
4) Rebooted again! (Yeah I know I rebooted one more time, but I did what I did ;))
And yes, user was able to get much more better display with 1280x1024 settings.
The final /etc/X11/xorg.conf file now looked like below: (Note that the lines/sections in maroon were changed/added/modified manually or using system-config-display.
1) Booted the system in single user mode.
2) Edited the file /etc/X11/XF86Config and replaced/changed at two places:
- Changed driver from "nvidia" to "vesa" in line starting with "Driver" in Section "Device"
- Checked for line containing "dpms" and appened "off" after it.
Option "dpms" "off"
3) Saved the changes and rebooted the system. Boom! It came up fine with default display driver.
Update on 03/23/2011::
Note: This article became alive again yesterday when I was doing X11 config on RHEL 4U7 server. User wanted GUI and video card was somehow not supported. The simplest way was to switch to VESA driver and get it going. User happy, I am happy!!! :)
Update on 03/28/2011::
This user again called me now for a better (smaller) resolution settings. At first, I thought that it may not be supported with default/vesa driver but the system's default drivers also support better resolution than default 800x600. Here is how I did that:
1) First of all, invoked "system-config-display utility". Using this utility, select the correct Monitor type. In my case, the correct type was "LCD Panel 1280x1024". I saved that monitor type and exited from utility.
2) Rebooted.
3) Again, edited the /etc/X11/xorg.conf file to add more resolutions.
Modes "1280x1024" "1280x960" "1024x768" "800x600" "640x480"
4) Rebooted again! (Yeah I know I rebooted one more time, but I did what I did ;))
And yes, user was able to get much more better display with 1280x1024 settings.
The final /etc/X11/xorg.conf file now looked like below: (Note that the lines/sections in maroon were changed/added/modified manually or using system-config-display.
# cat /etc/X11/xorg.conf
# Xorg configuration created by system-config-display
Section "ServerLayout"
Identifier "single head configuration"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "Files"
# RgbPath is the location of the RGB database. Note, this is the name of the
# file minus the extension (like ".txt" or ".db"). There is normally
# no need to change the default.
# Multiple FontPath entries are allowed (they are concatenated together)
# By default, Red Hat 6.0 and later now use a font server independent of
# the X server to render fonts.
RgbPath "/usr/X11R6/lib/X11/rgb"
FontPath "unix/:7100"
EndSection
Section "Module"
Load "dbe"
Load "extmod"
Load "fbdevhw"
Load "glx"
Load "record"
Load "freetype"
Load "type1"
Load "dri"
EndSection
Section "InputDevice"
# Specify which keyboard LEDs can be user-controlled (eg, with xset(1))
# Option "Xleds" "1 2 3"
# To disable the XKEYBOARD extension, uncomment XkbDisable.
# Option "XkbDisable"
# To customise the XKB settings to suit your keyboard, modify the
# lines below (which are the defaults). For example, for a non-U.S.
# keyboard, you will probably want to use:
# Option "XkbModel" "pc102"
# If you have a US Microsoft Natural keyboard, you can use:
# Option "XkbModel" "microsoft"
#
# Then to change the language, change the Layout setting.
# For example, a german layout can be obtained with:
# Option "XkbLayout" "de"
# or:
# Option "XkbLayout" "de"
# Option "XkbVariant" "nodeadkeys"
#
# If you'd like to switch the positions of your capslock and
# control keys, use:
# Option "XkbOptions" "ctrl:swapcaps"
# Or if you just want both to be control, use:
# Option "XkbOptions" "ctrl:nocaps"
#
Identifier "Keyboard0"
Driver "kbd"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "yes"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "LCD Panel 1280x1024"
HorizSync 31.5 - 64.0
VertRefresh 56.0 - 65.0
Option "dpms" "off"
EndSection
Section "Device"
Identifier "Videocard0"
Driver "vesa"
VendorName "Videocard vendor"
BoardName "NVIDIA Quadro NVS 285"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Videocard0"
Monitor "Monitor0"
DefaultDepth 16
SubSection "Display"
# Modes "800x600" "640x480"
Viewport 0 0
Depth 16
Modes "1280x1024" "1280x960" "1024x768" "800x600" "640x480"
EndSubSection
EndSection
Labels:
DISPLAY,
How-to series,
Linux fundamentals,
xserver
Friday, May 23, 2008
X11 Forwarding
Here is the simple way of X-server's display forwarding on local machine. The only three things needed are :
1) Putty/ or any terminal client (I will use putty as example here)
2) Any x-client. (I will use X-ming for this example)
3) SSH must be supported by server.
Method:
1) Run the x-client in back ground
2) Open putty -> Type IP address of your server
3) On left hand pane, select SSH -> X11 -> Select X11 forwarding. as shown in figure.

1) Putty/ or any terminal client (I will use putty as example here)
2) Any x-client. (I will use X-ming for this example)
3) SSH must be supported by server.
Method:
1) Run the x-client in back ground
2) Open putty -> Type IP address of your server
3) On left hand pane, select SSH -> X11 -> Select X11 forwarding. as shown in figure.
Once done, then press Open button. Login as usual and then type xterm/xclock after logging in. Voila! Isn't it easy? hmmmm :-)
Monday, January 7, 2008
How to setup DISPLAY in profile file?
While setting up display to local machine, one can use following method to set it in /etc/profile file so that each time, display can be set automatically. This solution works very well for Solaris 10 and any other Solaris version.
Q: How to check if DISPLAY variable is setup correctly?
Ans. The easiest way to test to check if DISPLAY is set correctly is to run /usr/openwin/bin/xclock command. If it shows a GUI clock, then your display variable is set correct.
#-------------------------------------------------------------------
ME=`who -m PIPE awk '{print $2}'`
PORT=`who -u | grep $ME | awk '{print $8}' | sed 's/(//' | sed 's/)//'`
DISPLAY=$PORT:0.0
export DISPLAY
#-------------------------------------------------------------------
Q: How to check if DISPLAY variable is setup correctly?
Ans. The easiest way to test to check if DISPLAY is set correctly is to run /usr/openwin/bin/xclock command. If it shows a GUI clock, then your display variable is set correct.
Labels:
DISPLAY,
How-to series,
reflectionx,
Solaris,
xserver
Subscribe to:
Posts (Atom)