This is the first time I use VNC in Ubuntu. It worked fine in Centos. The problem is: whenever I open 2 GUIs (e.g. One is Matlab, the other is Gedit), the VNC remote desktop collapsed and can not be reconnected. My .vnc/xstartup file is:
#!/bin/sh
unset SESSION_MANAGER
exec sh /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 1280x1024+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession
genome-session &
Any suggestions?