Dec 242010

I am starting a series of blog posts for users who are new to Ubuntu. After spending all the time working on Windows, users face a learning curve for even doing simple tasks in Linux. I am going to explain some of those tasks and hopefully it makes things simpler.

The first task many users struggle with is usually shortcut keys. Having gotten used to a few short cut keys in Windows, users find it adapt to the different keys in Linux. I am going to explain how to see existing key mappings and add your own keys. Unlike Windows which usually comes with a single desktop management software – Windows Explorer, Linux has a multitude of options. The two most popular ones are GNOME and KDE. A list of keyboard shortcuts for both these environments can be found here.

Apart from the ones given, there might be scenarios where you want to add your own shortcut keys. Lets see how to do that. First on the top navigation menu, click System -> Preferences -> Keyboard Shortcuts

You will see the Shortcut keys window which can be collapsed to four main categories – Sound, Desktop, Accessibility and Windows Management.

Clicking on any of the categories gives you a list of functions and the shortcut keys assigned for them. Some functions are not assigned shortcuts and given as disabled. If you click on any function, it is highlighted and the shortcut changes to “New Shortcut…” The window is now ready to accept the new key combination and you can enter your desired key to it.

Oct 202010

For the last few months, I am almost exclusively using Ubuntu as my primary operating system. Due to this my .NET development suffered quite a bit and was limited just to work. To find a way around I installed Mono and played around with it.

Though a lot of people believe that .NET is completely tied with the Windows API, that is not exactly true. If we look at the source code of the .NET runtime (released by Microsoft under the name Rotor/SSCLI), there is a seperate layer called the Platform Adaption Layer (PAL) written which acts as an abstraction between the OS and runtime. This layer allows people to write their own implementations of the CLR to translate CIL into native code.

The mono project is one such effort which has ported .NET to both Mac and Linux environment. Even though Mono can work on Linux, I wouldnt really recommend using it for a production application because you might end up with bugs and small irritants while running it on linux which you can ill afford for a commercial application. So if you want to write once, run anywhere, Java is still your best bet.

To install Mono, first the repository needs to be added to the package manager. The mono packages are available here and a guide to add them is given here. After the source is added, click reload to update the list. The use the familiar apt-get command to install Mono. If that doesnt work enable the multiverse repositories or you can use the GUI Synaptic package manager.

Now mono is the application which can execute a .NET exe file. It however cannot compile the code. For that there is another application called mcs. To install it use the following command.

Now for the obligatory hello word program. Just write a simple program and save it as a text file.

Now lets compile it using mcs. The -v switch gives more detailed information in case a parsing error occurs.

If you observe the folder, you will see an exe file created with the same name as the source code file. Now, Linux has no idea how to run an exe without a compatibility layer (cough: emulator cough:) like WINE. So we can compare mono to be an very specific emulator only for .net applications. Even inside Windows, .NET assemblies are loaded differently than other windows dlls. The PE header contains an additional entry about the CLR version and the execution is transferred to the runtime rather than the operating system handling it. I think a similar process happens when we run the exe using mono. Here is the command.

The output of the program is displayed in the console.

Oct 152010

The new Indian rupee symbol has finally arrived. It was announced in July and now the new Unicode 6.0 specification has included the symbol along with 2000+ other new characters. The Unicode key for the Indian rupee is U+20B9.

Ubuntu 10.10 which was released a few days back on October 10th is the first operating system to support the symbol out of the box. The pace at which the rupee sign has been adopted by people and the media is quite laudable. Widespread acceptance however, will depend on how many people within the country start using it.


The government is now asking keyboard and mobile manufacturers to include the character to allow for easy typing. The aim is to make it universally used within 18-24 months.

Jul 192010

AndroidVNC is an Android app that can be used to connnect and control a remote machine which runs a VNC server. There are many VNC servers available like RealVNC, TightVNC, X11VNC server etc. The VNC server listens to a port (typically 5900) which the VNC client, can connect to and view/control the machine remotely.

Running it on a machine is quite straightforward. All you need to do is to start the TightVNC service and connect it from the phone using the app that can be downloaded from the market. It works great and can be used to control your PC from anywhere as long as its connected to the net.

But when you want to connect to a machine running on a VM, things can get a bit tricky. Mainly because of the way VirtualBox works. The default networking mode between a Host OS and the guest OS is NAT (Network Address Translation), which makes the VirtualBox as an intermediary between the Host and the guest and maps traffic to and fro. Though this mode requires virtually no configuration, it also makes the guest OS inaccessible from the outside world. Since any VNC viewer requires connectivity to the VNC server running on a machine, this limitation was effectively a dealbreaker.

To avoid this, the packets which reach the host must be sent to the guest through some mechanism. VirtualBox provides such a mechanism to do it and the protocol is called SSH (Secure Shell) which allows two networked devices to exchange data with each other. What happens is we open a port on the host side and forward any data received to a specified port on the guest through TCP. However, the GUI interface doesn’t give this option, its in a command line tool called VBoxManage. Before running this command, get the local IP address from Ubuntu using the ifconfig command. The IP was

Now we need to tell VirtualBox to forward all data received on any specified host port to port 5901 on Ubuntu.
I used the port 2222. The command for this is given below. Keep in mind that the VM needs to be powered off to use this command. Here you need to substitute your VM name with VM_NAME_here parameter. The guestssh is just a name assigned to it and doesnt really matter. Next comes the protocol – TCP, followed by the port on the host 2222. The two values after it signify the local IP for the guest OS and and port on the guestOS which will recieve the data.

VBoxManage modifyvm "VM_name_here" --natpf1 "guestssh,tcp,,2222,,5901"

Now that forwarding is configured, power on the VM again and install any VNC server on Ubuntu. I used X11VNC for this exercise.

sudo apt-get install x11vnc vnc-java

After X11VNC is installed, start it by going to Applications -> Internet -> X11 VNC server. It will display a dialog asking for the options. Make sure the port is 5901 and click on OK.

After clicking on OK, in the next screen. Make sure the Accept Connections tab is checked and also give a password and click on Ok. The X11VNC should be visible on the top left of the screen (If you are using GNOME)

Now that VNC is listening to port 5901 on the server, you can test it by running a VNC viewer on the localhost and specifying the port 2222 and seeing if the connection is made. The host would be This connection should be forwarded to the Ubuntu’s 5901 and the connection should succeed. If not see the logfile of the X11VNC to see if the connection was rejected due to some reason.

If your all set, run the AndroidVNC application on your phone. Also a very important point – “If you are accessing the net through a slow connection such as GPRS, make sure the resolution on Ubuntu is set to the miminum to prevent timeouts.” Get the network IP of your host through ipconfig or a site such as and enter the required settings on your phone.

Nickname: Any nickname you want
Password : What you specificied on X11VNC
Address: The public IP of your computer you got from ipconfig.
Port: 2222

And hit connect. It might take upto a minute to draw the first frame. Once thats done, you will be able to completely control the computer from your phone.

You can also send text and other key commands to the VM from your phone using the app options. Just How cool is that??