Remmina pre and post VNC connection commands

2

There is little documentation on if this can be achieved. My workflow is thus: I connect to my remote machine via SSH, then if I need a GUI, launch TigerVNC server using

/usr/bin/vncserver :4 -geometry 1920x1080 -depth 32 -nolisten tcp -localhost

(saved conveniently to a bash alias). Then I can connect to it using Remmina as usual. I never bothered to tinker with the pre and post connection commands in Remmina connection editor. Today, suddenly, I noticed them and wondered if I could issue my VNC server spawning commands through there. So I copied the above into the pre-connection box, and tried to connect. No luck. Then I used my bash alias. No luck.

Finally I created an executable shell file with that command, and provided that file in the pre-connection field. This is similar to what the Wiki has. Now it is just stuck at the "Connecting to Host" dialogue box. I cannot tell if I am getting closer. Unfortunately, the Wiki does not elaborate on that, or I am too blind to effectively search for it. Can anyone help? Is this even possible? I would be great if Remmina could connect via SSH, spawn a VNC server, and then connect to GUI, all in one shot.


Obviously, I am also interested in the post-command to /usr/bin/vncserver -kill :4.

Kartik

Posted 2018-10-09T04:02:55.060

Reputation: 145

Answers

1

Ah! I figured it out! The command is run on the client machine, not the server. Therefore,

/usr/bin/ssh user@host '/usr/bin/vncserver :4 -geometry 1920x1080 -depth 32 -nolisten tcp -localhost' 

in the pre command, and

/usr/bin/ssh user@host '/usr/bin/vncserver -kill :4'

in the post command does exactly what I want! Remmina is awesome!

Kartik

Posted 2018-10-09T04:02:55.060

Reputation: 145

0

(An alternative way using x11vnc server)

Pre-command:

sh -c '( ssh user@host '\''killall x11vnc ; x11vnc -forever -passwd SOMEPASSWORD -display :0'\'' & ) ; sleep 5'

Post-command:

ssh user@host 'killall x11vnc'

Explanations:

  • pre-command does the following:

    • starts a background ssh process which (on the remote side):

      • terminates any running x11vnc servers

      • starts x11vnc server

    • waits 5 seconds for this background process to setup VNC server (to prevent remmina from connecting too early)

  • post-command terminates all x11vnc servers on the remote side

vlp

Posted 2018-10-09T04:02:55.060

Reputation: 101