Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

guidance for making a .Xresources file.

16,670 views
Skip to first unread message

peas...@shaw.ca

unread,
Feb 9, 2011, 12:10:03 PM2/9/11
to
Appears that I need to make a .Xresources file before
TightVNC will work. Can anyone recommend instructions
or examples for the task? The transcript from the
TightVNC follows.

Thanks, ... Peter E.

peter@dalton:~$ tightvncserver :1 -geometry 620x730 -depth 16

New 'X' desktop is dalton:1

Starting applications specified in /home/peter/.vnc/xstartup
Log file is /home/peter/.vnc/dalton:1.log

peter@dalton:~$ cat .vnc/dalton:1.log
09/02/11 08:45:59 Xvnc version TightVNC-1.3.9
09/02/11 08:45:59 Copyright (C) 2000-2007 TightVNC Group
09/02/11 08:45:59 Copyright (C) 1999 AT&T Laboratories Cambridge
09/02/11 08:45:59 All Rights Reserved.
09/02/11 08:45:59 See http://www.tightvnc.com/ for information on TightVNC
09/02/11 08:45:59 Desktop name 'X' (dalton:1)
09/02/11 08:45:59 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
09/02/11 08:45:59 Listening for VNC connections on TCP port 5901
xrdb: No such file or directory
xrdb: can't open file '/home/peter/.Xresources'
peter@dalton:~$

--
Telephone 1 360 450 2132.
Shop pages http://carnot.yi.org/ accessible as long as the old drives survive.
Personal pages http://members.shaw.ca/peasthope/ .


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/171056905....@cantor.invalid

Franz Gustav Niederheitmann

unread,
Feb 9, 2011, 12:20:02 PM2/9/11
to
Hi Peter,

Can you send your 

~/.vnc/xstartup
?

Franz Gustav Niederheitmann
Engenheiro de Computação
------------------------------------------

Running Windows on a PC is like having a brand new Porsche but only be able to drive backwards with the handbrake on.




2011/2/9 <peas...@shaw.ca>

Bob Proulx

unread,
Feb 9, 2011, 1:30:03 PM2/9/11
to
peas...@shaw.ca wrote:
> Appears that I need to make a .Xresources file before
> TightVNC will work.

Shouldn't need one.

> Can anyone recommend instructions or examples for the task?

To workaround the noise create an empty file.

$ touch .Xresources

> The transcript from the TightVNC follows.

> ...


> 09/02/11 08:45:59 Listening for VNC connections on TCP port 5901
> xrdb: No such file or directory
> xrdb: can't open file '/home/peter/.Xresources'
> peter@dalton:~$

The default file created automatically by vnc (it should have stated
that somewhere in all of the many lines of output noise) contains the
following:

#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
# Fix to make GNOME work
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession

That is a default because most people have a .Xresources file. It is
a pretty simple and brute force default. But you can edit that file
yourself. Just edit it to your preferences.

Bob

signature.asc

Bob Proulx

unread,
Feb 9, 2011, 1:30:02 PM2/9/11
to
Chris Jones wrote:
> That's odd.. the vnc4server script on ‘lenny’ from the vnc4server
> package tests the existence of the file:
>
> [ -r ~/.Xresources ] && xrdb -merge ...

The vncserver uses the alternatives. It could be one of several
different servers. From my machine:

$ update-alternatives --display vncserver
vncserver - auto mode
link currently points to /usr/bin/tightvncserver
/usr/bin/tightvncserver - priority 70
slave vncconnect: /usr/bin/tightvncconnect
slave vncconnect.1.gz: /usr/share/man/man1/tightvncconnect.1.gz
slave vncserver.1.gz: /usr/share/man/man1/tightvncserver.1.gz
Current 'best' version is '/usr/bin/tightvncserver'.

The tightvncserver package says:

Creating default startup script /home/bob/.vnc/xstartup

And that file is:

#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
# Fix to make GNOME work
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession

But undoubtedly other vnc servers create different files there. :-)

Bob

signature.asc

Chris Jones

unread,
Feb 9, 2011, 1:30:03 PM2/9/11
to
On Wed, Feb 09, 2011 at 12:03:04PM EST, peas...@shaw.ca wrote:

> Appears that I need to make a .Xresources file before
> TightVNC will work. Can anyone recommend instructions
> or examples for the task? The transcript from the
> TightVNC follows.
>
> Thanks, ... Peter E.
>
> peter@dalton:~$ tightvncserver :1 -geometry 620x730 -depth 16
>
> New 'X' desktop is dalton:1
>
> Starting applications specified in /home/peter/.vnc/xstartup
> Log file is /home/peter/.vnc/dalton:1.log
>
> peter@dalton:~$ cat .vnc/dalton:1.log
> 09/02/11 08:45:59 Xvnc version TightVNC-1.3.9
> 09/02/11 08:45:59 Copyright (C) 2000-2007 TightVNC Group
> 09/02/11 08:45:59 Copyright (C) 1999 AT&T Laboratories Cambridge
> 09/02/11 08:45:59 All Rights Reserved.
> 09/02/11 08:45:59 See http://www.tightvnc.com/ for information on TightVNC
> 09/02/11 08:45:59 Desktop name 'X' (dalton:1)
> 09/02/11 08:45:59 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
> 09/02/11 08:45:59 Listening for VNC connections on TCP port 5901
> xrdb: No such file or directory
> xrdb: can't open file '/home/peter/.Xresources'
> peter@dalton:~$

That's odd.. the vnc4server script on ‘lenny’ from the vnc4server


package tests the existence of the file:

[ -r ~/.Xresources ] && xrdb -merge ...

Maybe you could get away with defining an empty ~/.Xresources file:

$ touch ~/.Xresources

cj


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/2011020918...@pavo.local

Chris Jones

unread,
Feb 9, 2011, 2:00:02 PM2/9/11
to

Ah, yes.. I'm unclear as to how I got to have vnc4server and
tightvncserver both installed on my machine. :-)

Now the problem is that I use the old, possibly deprecated, ~/.Xdefaults
and I have a lot of stuff in there. Since I was in a rush and testing
something unrelated, when I saw that I was gettting the wrong fonts,
colors, etc. etc. I just duplicated did: cp .Xdefaults .Xresources.

That's what gave me the idea of the empty ~/.Xresources file.

But since debian systems also have tons of X system-wide resources in
/etc/X11/app-defaults/*, I think I should keep that in mind, and check
whether whatever vnc server I'm running is aware of those.. or maybe
they're picked up by default anyway and I shouldn't worry about it.

Dr. Ed Morbius

unread,
Feb 9, 2011, 4:40:02 PM2/9/11
to

They do?

It's not configured by default or populated in /etc/skel. I doubt
"most" users would go about adding one themselves. Yes, _if_ you're
going to specify custom xrdb resources, that's the default place to do
so, but for the bulk of the userbase, that's probably two or three
levels of obscure arcana.

An empty .Xresources should work just fine, but if that's required by
the tightvnc (or other) package, I'd file a bug.

--
Dr. Ed Morbius
Chief Scientist / Robot Wrangler When you seek unlimited power
Krell Power Systems Unlimited Go to Krell!

signature.asc

Bob Proulx

unread,
Feb 9, 2011, 4:50:01 PM2/9/11
to
Dr. Ed Morbius wrote:

> Bob Proulx wrote:
> > That is a default because most people have a .Xresources file.
>
> They do?

Sorry I was definitely over generalized there. :-)

> An empty .Xresources should work just fine, but if that's required by
> the tightvnc (or other) package, I'd file a bug.

I think it would be worth a wishlist bug to improve it.

Bob

signature.asc

Bob Proulx

unread,
Feb 9, 2011, 5:00:01 PM2/9/11
to
Chris Jones wrote:
> Ah, yes.. I'm unclear as to how I got to have vnc4server and
> tightvncserver both installed on my machine. :-)

Good for testing them out!

> Now the problem is that I use the old, possibly deprecated, ~/.Xdefaults
> and I have a lot of stuff in there. Since I was in a rush and testing
> something unrelated, when I saw that I was gettting the wrong fonts,
> colors, etc. etc. I just duplicated did: cp .Xdefaults .Xresources.

Seems reasonable to me.

> That's what gave me the idea of the empty ~/.Xresources file.

Again that seems reasonable to me.

> But since debian systems also have tons of X system-wide resources in
> /etc/X11/app-defaults/*, I think I should keep that in mind, and check
> whether whatever vnc server I'm running is aware of those.. or maybe
> they're picked up by default anyway and I shouldn't worry about it.

They are picked up anyway.

/etc/X11/app-defaults != /etc/X11/Xresources

I ranted about the many and various ways resources are provided to
applications in a previous message recently. It isn't simple.

And if you look through /etc/X11/Xresources/* you will probably find
that you can live without those most of the time without noticing that
you are missing them. So ignoring them is probably safe enough. By
having an empty .Xresources and loading the empty file with xrdb you
will be missing the contents of /etc/X11/Xresources but I think you
can live well enough without those and not worry about it. As a user
you are allowed to override that configuration.

Bob

signature.asc

Chris Jones

unread,
Feb 9, 2011, 5:50:02 PM2/9/11
to
On Wed, Feb 09, 2011 at 04:32:05PM EST, Dr. Ed Morbius wrote:

[..]

> They do?
>
> It's not configured by default or populated in /etc/skel. I doubt
> "most" users would go about adding one themselves.

Trust the little beggars..

> Yes, _if_ you're going to specify custom xrdb resources, that's the
> default place to do so, but for the bulk of the userbase, that's
> probably two or three levels of obscure arcana.

.. drop your guard and reality ‘obscurely’ hits back and bites your ass.

> An empty .Xresources should work just fine, but if that's required by
> the tightvnc (or other) package, I'd file a bug.

Odd vnc4server doesn't have this particular issue. Someone and somebody
are apparently not talking...

cj


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/2011020922...@pavo.local

peas...@shaw.ca

unread,
Feb 10, 2011, 12:00:03 PM2/10/11
to
From: Bob Proulx <b...@proulx.com>
Date: Wed, 09 Feb 2011 11:24:45 -0700

> To workaround the noise create an empty file.
>
> $ touch .Xresources

Check.

> The default file created automatically by vnc ... contains the
> following: ...

Restored that. Yes, TightVNC works again. Whew.

As expected with the trivial .Xresources, parameters in the screen on
the server and in the screen on the VNC client are the same. The
desktop background, for example, is the same in both screens; not a
concern. Conversely, I'd rather that a change of dimensions of the
browser window on one screen wouldn't change the browser on
the other screen. For that I'll need to use xrdb properly with screen
specific parameters in .Xresources. Documentation I've seen is skimpy.
http://wiki.debian.org/TinyWM for example, puts the invocation of
xrdb in /usr/bin/tinywm-session! Certainly not good practice according
to discusion here.

Thanks for the help, ... Peter E.


--
Telephone 1 360 450 2132.
Shop pages http://carnot.yi.org/ accessible as long as the old drives survive.
Personal pages http://members.shaw.ca/peasthope/ .

--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Archive: http://lists.debian.org/171056906....@cantor.invalid

Bob Proulx

unread,
Feb 10, 2011, 4:30:01 PM2/10/11
to
peas...@shaw.ca wrote:
> Conversely, I'd rather that a change of dimensions of the browser
> window on one screen wouldn't change the browser on the other
> screen.

Uhm... Suddenly reading you saying this confuses me immensely! We
are talking about VNC sharing a *single* screen. So isn't it the
exact *same browser* on the exact *same screen*? Changing it on one
screen will change it on the other too since there is only one browser
window being changed, right? What did I miss?

> For that I'll need to use xrdb properly with screen specific
> parameters in .Xresources. Documentation I've seen is skimpy.
> http://wiki.debian.org/TinyWM for example, puts the invocation of
> xrdb in /usr/bin/tinywm-session! Certainly not good practice
> according to discusion here.

Sometimes what people do is to script the setting of some resources.

$ xrdb -sym | grep -e DWIDTH -e DHEIGHT
-DWIDTH=3200
-DHEIGHT=1200
... I have two 1600x1200 monitors side by side. ...

Then something like this can be done.

if [ X$(xrdb -sym | awk -F= '/DWIDTH/{print$NF}') = X3200 ]; then
xrdb -load .Xresources.big
else
xrdb -load .Xresources.small
fi

And endless variations too.

Bob

signature.asc

peas...@shaw.ca

unread,
Feb 10, 2011, 4:50:03 PM2/10/11
to
From: Bob Proulx <b...@proulx.com>
Date: Thu, 10 Feb 2011 14:24:41 -0700

> We are talking about VNC sharing a *single* screen.

Two machines, Dalton and Cantor in http://carnot.yi.org/NetworkExtant.jpg .

Dalton has an X server and a TightVNC server. My understanding is that
TightVNC uses X to some extent. Dalton also has an X console. Cantor has
a VNC console. With my trivial configuration the two consoles get the same
desktop wallpaper. Some other parameters are also shared.

> Sometimes what people do is to script the setting of some resources.

So here it would be this way in pseudocode.

CASE client OF
DaltonsOwnConsole: set this; set that
|CantorsConsole: other settings
END

Does that make sense? Thanks, ... Peter E.

Bob Proulx

unread,
Feb 10, 2011, 5:10:02 PM2/10/11
to
peas...@shaw.ca wrote:
> Dalton has an X server and a TightVNC server. My understanding is
> that TightVNC uses X to some extent.

To the extent that 100% is a percent, yes. TightVNC is a way to
transport the X protocol from one host to another so as to share a
display. VNC starts up an X display on one system and allows it to be
connected to from other hosts. (Or the same host too.)

> Dalton also has an X console.

Okay.

> Cantor has a VNC console.

What is a VNC console? Text console, sure. A graphical console
started through xdm/gdm/kdm (X display manager) for graphical login,
sure. Or maybe you are using XDMCP and an X-terminal for a remote
login, sure. But what is a VNC console? Surely you would need to log
in using either the text console or ssh from another system or from
xdm or something and then start up a vnc session, right? I am sure I
am just misunderstanding something simple.

> With my trivial configuration the two consoles get the same desktop
> wallpaper. Some other parameters are also shared.

Ah so when you said "change of dimensions of the browser window on one
screen wouldn't change the browser on the other screen" you meant when
you change the resources in .Xdefaults / .Xresources which is is
somehow copied between the two (or network filesystem shared) that
this would change the default browser size when the browser starts
up. Gotcha.

> Bob Proulx wrote:
> > Sometimes what people do is to script the setting of some resources.
>
> So here it would be this way in pseudocode.
>
> CASE client OF
> DaltonsOwnConsole: set this; set that
> |CantorsConsole: other settings
> END
>
> Does that make sense? Thanks, ... Peter E.

Sure. That is a perfect application for it. Then you can have one
script that will run on ether/both of the systems and behave
differently.

Bob

signature.asc

peas...@shaw.ca

unread,
Feb 10, 2011, 10:10:02 PM2/10/11
to
From: Bob Proulx <b...@proulx.com>
Date: Thu, 10 Feb 2011 15:00:26 -0700

> TightVNC is a way to transport the X protocol from one host to another
> so as to share a display.

According to http://en.wikipedia.org/wiki/Virtual_Network_Computing
to protocol is RFB. VNC is based on X in Linux and Unix but not in Windows.
Some servers can support more than one session.

> ... an X display on one system ... connected to from other hosts.
> ...


> What is a VNC console?

It was my term for the screen of the "other host" you mentioned.
Photo here. http://carnot.yi.org/Cantor.html Sorry if the aspect ratio is bad.
According to http://en.wikipedia.org/wiki/Virtual_Network_Computing
the correct name is "VNC Client". Dalton is the VNC server and Cantor
is the VNC client.

> Surely you would need to log
> in using either the text console or ssh from another system or from
> xdm or something and then start up a vnc session, right?

On Cantor simply execute (click) this and the viewer opens.
Desktops.OpenDoc "dalton.invalid:5901" (VNCViewerDocs.NewDoc) ~
Yes, Cantor sends a password to Dalton.

> ... you meant when


> you change the resources in .Xdefaults / .Xresources which is is

> somehow copied between the two ...

"Resource" strikes me as an odd term here. I'd rather say "size" or
"color" or more generally "parameter". The abstractness of "resource"
must have appealed to an X developer. In any case, the problem appears
to be that Dalton is using just one framebuffer. Dalton has a decent
sized 4:3 display whereas Cantor has a small 5:6 display. If Iceweasel is
opened on Cantor and then on Dalton, the Dalton instance has the
small shape of the Cantor instance.

> ... you can have one script that will run on ether/both of the systems and
> behave differently.

I was imagining the script to run on server Dalton so that each client is
recognized and served the appropriate framebuffer. Dalton provides one
session to its own client and one to Cantor. Both sessions should be able
to run concurrently. I'll guess that the script you mentioned is the place
to configure this.

Isn't there a "native" X communication more sophisticated than VNC via
RFB? If so, why is VNC ever used for a Linux client?

Regards, ... Peter E.

0 new messages