4

I am setting up a VNC server (vnc4server on mint) and I have a default xstartup file in ~/.vnc. I am using twm window manager. When I connect to the VNC server, I can authenticate successfully and see the terminal but I don't get a prompt. I can open a new tab in the terminal using a mouse but none of the keys pressed are acted on by the Terminal application. When I press few random keys and on packet capture, those keys are received as 'Client key event' on the VNC server box. It looks like, the VNC client can pass keyboard and mouse events and can receive frame buffer updates but for some reason, the application running on the server does not seem to process keyboard events.

xstartup file:

~/.vnc$ ls
passwd  rag-tos-laptop:1.log  rag-tos-laptop:1.pid  xstartup*  xstartup.bak*

~/.vnc$ cat xstartup
#!/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 &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
twm &

Screenshot showing terminal menu

On further investigation, I found that I can work (type sentences) if I launch gedit so it seems only to be a problem working with any terminal (+shell). When I start gnome-terminal in xstartup, I can't still get a shell on my VNC viewer. Some more diagnostic info:

~/.vnc$ ps --ppid 3334 -o pid,ppid,stat,cmd
  PID  PPID STAT CMD
 3342  3334 S    gnome-pty-helper
 3343  3334 Ss+  bash

~/.vnc$ ls -l /proc/3334/fd
total 0
lr-x------ 1 rag rag 64 Jan  5 23:25 0 -> /dev/null
l-wx------ 1 rag rag 64 Jan  5 23:25 1 -> /home/rag/.vnc/rag-tos-laptop:1.log
lrwx------ 1 rag rag 64 Jan  5 23:25 10 -> socket:[17343]
lrwx------ 1 rag rag 64 Jan  5 23:25 11 -> anon_inode:[eventfd]
lrwx------ 1 rag rag 64 Jan  5 23:25 12 -> /dev/ptmx
lrwx------ 1 rag rag 64 Jan  5 23:25 13 -> /dev/pts/4
lrwx------ 1 rag rag 64 Jan  5 23:25 14 -> socket:[19273]
lrwx------ 1 rag rag 64 Jan  5 23:25 15 -> anon_inode:[eventfd]
l-wx------ 1 rag rag 64 Jan  5 23:24 2 -> /home/rag/.vnc/rag-tos-laptop:1.log
lrwx------ 1 rag rag 64 Jan  5 23:25 3 -> socket:[19263]
lrwx------ 1 rag rag 64 Jan  5 23:25 4 -> socket:[19267]
lrwx------ 1 rag rag 64 Jan  5 23:25 5 -> anon_inode:[eventfd]
lrwx------ 1 rag rag 64 Jan  5 23:25 6 -> anon_inode:[eventfd]
lrwx------ 1 rag rag 64 Jan  5 23:25 7 -> socket:[20165]
lrwx------ 1 rag rag 64 Jan  5 23:25 8 -> socket:[17342]
lrwx------ 1 rag rag 64 Jan  5 23:25 9 -> anon_inode:[eventfd]

~/.vnc$ ls -l /proc/3343/fd
total 0
lrwx------ 1 rag rag 64 Jan  5 23:23 0 -> /dev/pts/4
lrwx------ 1 rag rag 64 Jan  5 23:23 1 -> /dev/pts/4
lrwx------ 1 rag rag 64 Jan  5 23:23 2 -> /dev/pts/4
lrwx------ 1 rag rag 64 Jan  5 23:25 255 -> /dev/pts/4
  • Anyone solve this yet? – PNDA Dec 23 '15 at 1:02
3

I had exactly the same problem. I prefer to use TWM as it is lean and light. The Linux Mint box is my home server, and rarely needs gui tools anyway. Nearly everything I do on it is command line stuff - lots of scripts running.

Here is what I did:

  1. sudo apt-get install xterm
  2. edit ~/.vnc/xstartup to use xterm.

#!/bin/sh

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

xsetroot -solid grey   

vncconfig -iconic &  #!/bin/sh



/usr/bin/xterm -geometry 80x24+10+10 -ls -title "xterm" &   

/usr/bin/xterm -geometry 80x24+200+200 -ls -T "xterm" &   

twm &

VNC server running TWM window manager on Linux Mint 17.1 So, I use xterm, not mate-terminal, gnome-terminal or x-terminal-emulator.

Don't know why the others don't work, but I'm happy with xterm. I doesn't appear to do multiple seesions/tabs in the one window, but you can achieve the same by just entering xterm & to open a new session in its own window.

Cut and paste using Shift-Ctrl-C and Shift-Ctrl-V don't work either, but you can do just the same by highlighting the text with the mouse, then move to the target window and press the middle mouse button (or left and right together) to paste. This is how I pasted the xstartup file above, from the vncviewer window on my laptop to the firefox browser window on the same laptop. The same method works between xterms on the server.

Note: the -title argument is ignored. Again, don't know why.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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