Apr
4
How To Use Remote Access to Fix Problems in Ubuntu Linux – Revisited
April 4, 2008 | By: UbuntuLinuxHelp | 2 Comments
Posted in Applications, How to..., Installation, Linux Projects - Hands On
For regular readers of this blog, it comes as no surprise that I enjoy playing with and tweaking Linux systems (in this case Ubuntu Linux is the distribution of choice). I also enjoy practical, hands-on projects that we can all actually use.
One thing I often run into is helping friends fix problems with their Ubuntu Linux based PC's. I like doing that, because it gives me a sense of satisfaction and accomplishment when I'm able to help them. One drawback, is I often get a call from help after the workday is over. (That's when I want to relax). Inevitably, I sometimes spend a long time on the phone, trying to talk them through a "fix". Often I pay them a visit.
Wouldn't it be nice if I could simply access their desktops and do the fix from my end? Yes, of course. On that train of thought, I figured I'd role out VNC on all of them (who want it). The best part being that it does not take a rocket science approach to accomplish. :) It's fairly simple. This post is revisiting one of our earlier posts.
To enable remote connections, simply select System > Preferences > Remote Desktop as seen in the screenshot below.

In my case, I needed the ability to change configuration settings while fixing issues for them. Therefore, I enabled "Allow others to view your desktop" and "Allow others to control your desktop". For added peace of mind, I also enabled "Ask for confirmation" and required a password to be used. You can see these settings in the screen shot below.

Okay! We're at the half-way point. We have remote desktop enabled. Now we need the ability to connect to it from the outside. To make sure networking works, I always open Firefox, just to make sure there's an internet connection. In case there's not,
a simple networking restart command will work (to get a DHCP provided address from your router):
sudo /etc/init.d/networking restart
To be able to connect from the outside, you need two pieces of critical information and a properly configured router.
- Your external router (WAN) IP address. The script that runs in my "How to: Easy Remote Access Connection to Ubuntu" post will display it for you.
- The port number that VNC uses. That number is: 5900
To facilitate the last step, we are going to configure the router to allow connections to port #5900 from the outside (WAN) IP address. And... those connections are going to be forwarded to the Ubuntu Linux PC.
In my case, I have an old SMC router gathering dust, so I've quickly connected it for the purpose of this post. Your router interface will look different, but at least the screenshots below will give you an idea of what to look for.
After logging into the router's configuration interface, you can go the the "Virtual Server" area and allow port 5900 function on your private IP address and make sure that port 5900 is also allowed as a public connection port (to your private IP address).

Next, we can go to the "Special Applications" and enable the trigger and public ports (5900).

After saving the new settings, you should be able to establish remote connections. Here is the process for that:
- Have the person you are connecting to visit: http://ubuntulinuxhelp.com/how-to-easy-remote-access-connection-to-ubuntu/ (or any other site that provides IP addresses) and have them tell you what their external IP address is.
- In your Ubuntu Linux system, open a terminal and issue the following command (using the IP address you were given above). It will look something like this:
vncviewer 24.36.85.112:0
You should get a prompt to enter a password and away you go!
Where did I get the "vncviewer xxxxxx :0" part? Look at the second screenshot in this post. You will see where it says "vncviewer uplay:0" Right under where it says "Users can view your desktop using this command". When trying to connect to the desktop from another location, I would change the "uplay" part to "24.36.85.112"

As usual, I hope this helps some of you and is a bit of fun to do.
Either way, it's a good learning tool!
Enjoy!
:)
Related posts:
- How to: Easy Remote Access Connection to Ubuntu
- Ubuntu Linux Plug ‘N Play Zone Revisited
- Building a Web Developer / Designer PC Using Ubuntu Linux – Revisited
- Browser Problems – Creating a Linux Based Virtual Box – Part 2 of 2
- The Best 10 Minute, Effective Desktop Firewall Installation for Ubuntu Linux

(1 votes, average: 4.00 out of 5)
This is just what the doctor ordered. Thank you for the post.
@ehal990 – You’re welcome. :) The post seemed to be a much needed follow-up.