14

Ok i installed vnc server on RHEL 5.9 and also installed Tightvnc viewer on windows 7 and from RHEL i started vncserver and assigned the password using vncpasswd.

Then from tightvnc viewer i gave the IP and listening port xxx.xxx.xxx.xxx:1. It successfully connected with VNC server installed and running on RHEL. And then I gave the password and then BOOOM it gave me this hideous interface

enter image description here

When Actual Desktop is like this

enter image description here

Ok people tell me what Im missing

3
  • 8
    What you are missing is an appreciation of the minimalistic beauty of twm. Jan 18, 2013 at 14:27
  • @WarrenYoung: Indeed, which is the hideous one again?
    – sr_
    Jan 18, 2013 at 14:28
  • @sr_ maybe the minecraft screenshot on the bottom?
    – topher217
    Mar 4, 2022 at 8:56

5 Answers 5

10

What you see probably is the X11 session defined in ~/.vnc/xstartup, a minimal X11 session, maybe something like (this is how it looks like on Debian)

#!/bin/sh
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &

on another display, probably :1.

There're two things you can do:

  • To access a different desktop that looks the same, you have to start it in this xstartup file, e.g. with exec gnome-session or something similar, have a look for documentation on xinitrc or xsession[rc])
  • To access the same desktop session, you need a different VNC server. x11vnc can do desktop sharing; in your GNOME environment, Vino is probably the preferable choice (as Ignacio pointed out)
2
  • Great info. Just one quick question I have three users on server and I want only TWO users to have access to vnc server. root and emerg users can use the vnc. HOW TO DO THIS
    – OmiPenguin
    Jan 19, 2013 at 8:27
  • (If I guessed the VNC server you use right,) you might be able to use Xvnc with inetd as described in its man page (last paragraph of the linked section). Another (kind of high-overhead but neat) solution might be using the Guacamole remote desktop gateway and configuring access there.
    – sr_
    Jan 19, 2013 at 11:47
7

vncserver doesn't connect to the actual desktop; it creates a virtual desktop that is configured separately. If you want to access the actual desktop then you need to use either the VNC X extension or Vino.

2
  • 9
    Could you please provide a bit more information of how to do this
    – OmiPenguin
    Jan 18, 2013 at 14:13
  • @Ignacio, Could you please add few details. That will definitely help beginner. Since, I couldn't understand, what to do with VNC X extension
    – Ravi
    Jan 5, 2016 at 6:16
5

Please uncomment following two lines in xstartup file under ~/.vnc/xstartup:

Before:

#unset SESSION_MANAGER
#exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

After:

unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
1
  • 1
    Please could you explain in your answer what those lines do?
    – mwfearnley
    Mar 14, 2017 at 11:08
0

I faced the same issue on solaris 11 and after a little search I found out the gnome desktop is not even installed. So I installed it using:

pkg install --accept solaris-desktop

Then killed the running vnc-server:

vncserver -kill :1

and after running vnc again using this command

vncserver -kill :1

I was able to see the real desktop using vnc-viewer.

-2
#!/bin/sh
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &

Add gnome-session & at the end of the xstartup file

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .