vncの設定で初歩的なミス。

vnc server側の設定でgnome-sessionを使いたい時。

まず、vncユーザでvnc-serverを起動する。

$vncserver

するとhomeディレクトリに設定ファイルが出てくる。
*1
*2
とりあえず、vnc-server使わないので。

$ps auxww | grep vnc

とかでプロセスID調べて

$kill

vnc-server設定ファイルの変更

#vi /home/hoge/.vnc/xstartup

*3

この時にgnome-sessionで作業したければ。

#!/bin/sh

# Uncomment the following two lines for normal desktop:
#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" &
gnome &

これを

#!/bin/sh

# Uncomment the following two lines for normal desktop:
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" &
gnome &

以上のように変更。

*1:/home/hoge/.vnc/xstartup

*2:でもでも、sudo /etc/init.d/vncserver start。でもいい。ちなみにvmVNC使っていたのでrestartした。

*3:hogeはユーザ名です。使いたいユーザ名で設定してください。