Showing posts with label X server. Show all posts
Showing posts with label X server. Show all posts

LCD monitor resolution

Got a new Samsung 22" 1920x1080 monitor and the default resolution being shown was 1280x800. Now with 8.04 I used to do dpkg-reconfigure xserver-xorg and it would redo the X11 configuration.

In Jaunty, the above command just configures the keyboard setting. In order to get the monitor to work with the correct resolution do

$ xrandr

This would probe the monitor and display the resolutions, then do the following

$ xrandr --output VGA --auto --above LVDS

Using VNC over SSH

Okay, now I need to connect to this Linux box in the department which is running Matlab and access it on the wire.

Options:

1. SSH + X11 forwarding [slow]

% ssh -X username@hostname
% matlab &


In order to have SSH forward X11 by default change the following in /etc/ssh/ssh_config and also remove the #

ForwardAgent yes (default no)
ForwardX11 yes (default is no)
StrictHostKeyChecking no (default is ask)


With this you can now use

ssh username@hostname

2. VNC without SSH. [fast]
% vncviewer hostname:display

3. VNC tunneling over SSH [faster]
% ssh -C -L 5901/localhost/5901 username@hostname
% vncviewer localhost:5901


Ensure that vncserver is running on the remote node and also that you have set your vncpasswd. The "display" is the number that you get after starting the vncserver

NOTE:
If you are running compiz\beryl (any composite window manager), Matlab's pre-bundled java does not support it and hence it would not render it properly with option (1). You would have to point to the latest version of the JVM before starting matlab

% export MATLAB_JAVA=/usr/lib/java/blah-blah/jre
% matlab &


Update:
Got a local copy of Matlab and realized that it has the same problem and is solved by pointing to the latest JVM. Create a launcher that takes care of setting up the environment before the launch.

env MATLAB_JAVA="/usr/lib/jvm/java-6-sun/jre" xterm "/home/piyush/matlab-2007b/bin/matlab"

Reconfiguring the X server on Ubuntu

If, for some weird reason which could probably be any recent update, your screen resolution goes for a toss and if in KControl display settings the only possible resolution which you can move to is 640 x 800, then you need to reconfigure the X server.

Either you can open the /etc/X11/xorg.conf file manually and break your head or simply reconfigure X server by using the following command

$sudo dpkg-reconfigure xserver-xorg

This would start a configuration wizard. All you need to do is keep clicking "Yes" and then at the end select the correct resolution supported by your monitor like "1280 x 1024", save the configuration file and restart the X server.

Hopefully your shall be able to get back to the old resolution.