FINALLY! SOME UPDATES! This website is being reconstructed. Some content will go away soon. If you want to see my new stuff, visit my github:

December 8, 2012

One Giant Leap Forward (Part 1)

I've been struggling with myself to set up Virtual Network Computing (VNC) for years. Firstly, when you use something like VNC, you kind a need a second computer to do that. Secondly, if you do establish a VNC connection between two devices, it is completely insecure.

The tipping point for me to get on the VNC bandwagon after much hesitation came when I realized, I still want to access my netbook directly, but up until a few months ago, the keyboard and mouse were still screwed into the chase where the cooling fan once made such a loud unbearable noise, it was louder than most conversations.

However, since the fan-dectamy, things have become much quieter but I can't take my netbook with me anymore. This is a problem for a guy with no money looking for work. So what am I to do?

I think of what I've learned so far that I can do with my HP Touchpad, ported with Cyanogenmod with access to Android applications like Connectbot and AirTerm for Secure Shell (SSH) and RealVNC and Vino for VNC.

Let's start with the simple part even though it is insecure. Let's assume that we have two devices. An Android tablet and a Linux Netbook using the GNOME desktop. On the Linux notebook where either GNOME or--heaven forbid--Ubuntu Unity, type into the applications menu search bar Desktop Sharing and click on the icon for the "Desktop Sharing" application. What this is really setting up Vino. As software changes or if you have different preference, you might use other VNC programs. But you don't have to worry about installing such program if you are using GNOME as your desktop as it should be built-in. If it isn't, in the terminal sudo apt-get install vino.

Set your settings up to look like this.

Desktop Sharing Settings
Don't forget a password!

After setting things up line in the image, and setting a password, click "Close". Whenever you are connected to your computer, an icon should show up on the lower status bar indicating that another computer is connected to this device.

Next part you will need to look for is your computer's IP Address so that you can input that information into the RealVNC application on Android or Windows or another Linux machine that has Vino.

$ netstat -an | less
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0  *               LISTEN
tcp        0      0  *               LISTEN
tcp6       0      0 :::5900                 :::*                    LISTEN
tcp6       0      0 :::80                   :::*                    LISTEN

Finding your computer's IP address with netstat. This is just a truncated list. In real life there is other stuff.

In the above figure, just made a copy of part of the output the netstat -an command does. As an extra measure, I piped it to less (though you could use more.) The above examples show active internet connections. The first column on the left shows what protocol is being used. tcp means the computer is using the TCP/IP version 4 (IPv4) protocol on some connections, while tcp6 means the computer is using the TCP/IP version 6 (IPv6) protocol. The last column on the right indicates the state of the connection. In this case, all the Local Addresses are LISTENING for activity on the Foreign Addresses. Often these addresses will only listen to a certain port such as port 80 (web server) or port 5900 (VNC server). There is other stuff involving how Internet protocols and Internet connections work, but let's focus on the issue at a hand.

So we checked the state of the services and know that they are running and waiting for something to happen. Let's find our IP address to tell the other device where to connect.

$ ifconfig | sed -n '/inet/p'
	inet addr:192.168.x.y  Bcast:192.168.x.z  Mask:
	inet6 addr: [REDACTED] Scope:Link
	inet addr:  Mask:
	inet6 addr: ::1/128 Scope:Host
Finding the IP address with ifconfig. Note, some data has been redacted for my privacy.

I decided to add a sed command to reduce the number of lines outputted. In all honesty, most of the other lines without using sed are irrelevant to what we are looking for. Although, we can't see what devices use what connections.

At any rate, this is all being done on a local home network. I'm rather new to this so patching into the Netbook from outside of the home network is something I'm not familiar with as of yet, but I'm sure to learn it very soon.

The address for just connecting to the netbook starts with 192.168-something. If your home computers don't keep the same IP address either due to the set up of the router's firmware (such as the local IP address changes if the router is reset or unplugged), your going to need to do this step again the next time it happens.

The next four figures will show how to set up RealVNC for Android. This app is free on most other platforms but not Android. Generally, this app is about $9.99 in the Google Play store, but as of this writing, the app is $4.99. But I think that deal is only good through December 2012. Anyway, here's the sequence for setting up RealVNC.

Step 1: Press the plus icon in the upper right to create a new connection profile. Enter the IP address from earlier. 192.168.x.y should be replaced with the appropriate value. Don't forget to name the device. Picture quality can be left as "Automatic" because the image quality is generally high quality.
Step 2: Review the settings you want. You can edit them with the pencil icon on top or delete it with the trash icon. Otherwise, press "Connect".
Step 3: The first time you create a profile and have the profile save the password, you will see this prompt. Fill in the Password then press OK.
And you're connected! If you touch the top part of the screen, you will see icons for keyboard, mouse, connection information, help , and to close the screen. (BTW, Sinfest © Tatsuya Ishida.)

Back at your computer, you will move the mouse or do whatever else you are doing and the netbook will show those actions to in real time. On the other hand, if you touch the screen or use Reverend Kyle's USB Hosting Hack (which lets you use a Keyboard and a Mouse for Input), you can manipulate what happens on the computer remotely as we have it set up that way.

So does this mean, that we are done? NOOOOOOOOOOOO!!!!! In fact, if you haven't already, log out of the VNC session.

What's wrong with it then? There is no security between the Tablet and the Netbook, but there is a way to fix that using SSH. To do this on Android, you will have to tune in tomorrow for part 2.


Under Construction