I have a need to connect to my office using Sonicwall’s netExtender. Once connected I need to use RDP to open a remote desktop session to my work computer. But for some reason I ran into two issues on my AMD-based HP home desktop. First I was unable to get the netExtenderGui to run. It kept throwing errors. And second, I was using Remmina for the RDP client and discovered that it did not support dual monitor displays.
After some googling and yahooing, with a bing or two thrown in I had a solution.
For the netExtender issue I discovered that all I had to do was run it from the command line. I added an alias to my .bashrc file and was done. (confidential information is hidden with asterisks)
alias work=echo 'y' | /home/bob/Desktop/netExtenderClient/netExtender -u Bob -p ******* -d HB ***.hbdesign.com:****
Now all I have to do is open a terminal window and type “work” and I connect.
For the dual monitor issue I found another command line solution. Instead of using Remmina I use xfreerdp and run it from the command line. Another alias and I am up and running.
xfreerdp +multimon /u:bob /p:******* /v:192.***.***.86 +clipboard
To run both commands from a terminal I type
work & bobxps
Which starts netExtender to run in the background and then starts my multimonitor session.
To exit the multimonitor session I type ^ctrl alt enter, then right click on the title bar and select close. In the terminal window I enter fg to move netExtender back to the foreground and then type ^c to close it.
Next Steps, full automation
So now that I can open the VPN and then Remote Desktop into my work computer the next step is to make it all a one click shortcut on the desktop. The first task is to make a bash script. I named it dowork.sh.
!/bin/bash # start the netExtender in the background, sending the "y" # to the query it gives about the certificate echo 'y' | /home/bob/Desktop/netExtenderClient/netExtender -u Bob -p ******* -d HB ***.hbdesign.com:**** & # give it time to launch sleep 6 # now open the remote desktop in the forground xfreerdp +multimon /u:bob /p:+intel234 /v:192.168.0.86 +clipboard # when the foreground process terminates, kill the netExtender # process pkill netExtender
After testing this script I installed gnome-panel
$ sudo apt-get install --no-install-recommends gnome-panel
and then created a new desktop shortcut with the following command.
$ gnome-desktop-item-edit ~/Desktop/ --create-new
Now I can click on the desktop icon and open the vpn and connect to my work pc with just one click. Nice.