2

I'm setting up a vncserver (tightvncserver) from start. After run vncserver :1 first time, it creates file "~/.vnc/xstartup" with content:

#!/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

Then from client, I run command "vncviewer :1" but I just see the grey screen. I did many search and see that I can fix the problem if I change the line " export XKL_XMODMAP_DISABLE=1" to " export XKL_XMODMAP_DISABLE=0" . -> I want to ask how can I make this line is right at start when I call "vncserver :1"? (I don't want to edit the file xstartup)

Vi Do
  • 81
  • 1
  • 6

1 Answers1

0

After a lot of trial and error - this worked for me -

#!/bin/sh
def
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS

#exec sh /etc/Xll/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources

xterm -geometry 1920x1080 &

gnome-session &
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &

When you call your server, it has to be vncviewer ip-address::port. Value of port can be 5901 or 5902, 5903... 5900+N (depending on how many vncserver sessions you start at your server

zookastos
  • 917
  • 10
  • 37