Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

We have a couple of (identical) Ubuntu 11.10 machines, configured with gnome-classic, which we use as remote servers, and let our clients log into personal user accounts we create for them using vnc4server.

We configured all the machines in the same way, following a short manual we compiled, describing how to download, install and prepare a few tools and our software.

The connection usually works fine, but today I set up a fresh machine, and experienced problems.

After installing vnc4server, I ran vncpasswd and copied the following startup file to ~/.vnc/xstartup:

#!/bin/sh  
unset SESSION_MANAGER  
unset DBUS_SESSION_BUS_ADDRESS  
gnome-session --session=gnome-classic &  
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup  
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources  
xsetroot -solid grey  
vncconfig -iconic &  

Then, I started vnc4server and used two viewers (the Ubuntu Remote Desktop Viewer and Windows RealVNC Client) in two other machines, but instead of getting my desktop, I see an empty window with a grey-ish background pattern like this:

enter image description here

and the cursor is a bold X.

What is wrong with the setup and why don't I get a remote session as expected?

share|improve this question
    
Please check your firewall settings on both machines for ports 5900 (or whichever port you've configured) as that the service is allowed. –  RWC Apr 9 '12 at 23:44
    
Thanks, @Hobie, but everything was set correctly, otherwise I won't even be able to connect. –  ysap Apr 10 '12 at 0:04
    
You might consider using a configuration management tool such as ansible to avoid this sort of problem in the future. –  root.ctrlc Mar 11 at 19:35
add comment

2 Answers

You may want to edit the /root/.vnc/xstartup file so it reads (in your case, the x-terminal-emulator line is your important part to add),

xrdb $HOME/.Xresources
xsetroot -solid grey
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &
share|improve this answer
    
Is this a default file that vnc4server reads whenever it starts, before reading the per-user file? –  ysap Apr 10 '12 at 0:49
    
How is gnome-terminal (x-terminal-emulator) related to the problem? –  ysap Apr 10 '12 at 0:55
add comment
up vote 0 down vote accepted

So, we found out that the xstartup file needs executable permission, which were not set in this machine's configuration. Contrary to other machine, this time I created a new file and typed the contents in instead of just copying a file from another machine, so by default it did not have exe permissions.

> chmod a+x ~/.vnc/xstartup

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.