Tuesday, May 28, 2013

Export Display over TELNET on Ubuntu 12.04 64 bit LTS


The solution is derived from this link

Edit the file /etc/lightgdm/lightgdm.conf and add the following line towards the end of file:

xserver-allow-tcp=true

and restart your system.

Open a terminal and run the following commands:

$ xhost +

allow any user to connect to the xserver


$ telnet  

Once you login, type in the following commands:

$ export DISPLAY=:0.0

$ xterm &

You should be able to see the terminal.

On your own computer (not the remote server), you can run the following command to verify if there is any "-nolisten" variable with tcp.

$ ps -ef | grep listen
nobody    1182   839  0 19:33 ?        00:00:00 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/var/run/sendsigs.omit.d/network-manager.dnsmasq.pid --listen-address=127.0.0.1 --conf-file=/var/run/nm-dns-dnsmasq.conf --cache-size=0 --proxy-dnssec
mayank    5323  5064  0 20:17 pts/0    00:00:00 grep --color=auto listen


As you can see, it is not there and hence things should work properly now.

Disable Graphical login manager on Boot or Changing Default Runlevel on Ubuntu 12.04 64bit LTS

One of the following three methods should work for you:

1. If you just want to disable x-server after log-in. Then press CLT+ALT+F1. You can recover the x server by  running the following command:

$ startx


2. Ubuntu uses lightgdm instead of GDM as the default desktop manager.  So disable lightgdm on  boot by using the following command:

$ update-rc.d -f lightgdm remove

Then reboot the system.

You can start it by using either of the following two commands:

$ sudo service lightgdm restart
or
$ update-rc.d -f lightgdm defaults



3.  Edit the file /etc/default/grub and find the line containing the text:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

replace it by

GRUB_CMDLINE_LINUX_DEFAULT="text"

save the file and update the grub using the following command:

$ sudo update-grub

Now restart the system.

Monday, May 27, 2013

Making Webex work on Ubuntu 12.04 64 bit LTS with Firefox

I could finally get webex work on my ubuntu 12.04 64 bit LTS, thanks to Shariq's blog on the same topic. I will just enumerate few things in addition to what Shariq has already explained.


1. Install ia32-libs using apt-get:

$ sudo apt-get install ia32-libs


I did not downgrade the distribution as Shariq explained in his blog (see this link). I simply installed them using apt-get.

2. Create the folder ~/webex in your home folder as explained by Shariq. 

3. Download the firefox tar ball from the official firefox website. Just click on the download button to get the tar ball. I got the firefox-21.0.tar.bz2. I am not sure if it is a 32-bit or a 64-bit version. At least it did not matter to me.

4. Download the 32-bit JDK version from Oracle's official website. I got the package "jdk-7u21-linux-i586.tar.gz".

5. Extract these packages with in the ~/webex folder as shown below:

$ cd ~/webex
$ tar -xjvf firefox-21.0.tar.bz2
$ tar -xzvf dk-7u21-linux-i586.tar.gz

It creates two folders: 'firefox' and 'jdk1.7.0_21' within the webex folder.

6. Now link the java plugin within the firefox folder:

$ cd firefox
$ mkdir plugins
$ cd plugins
$ ln -s ~/webex/jdk1.7.0_21/jre/lib/i386/libnpjp2.so

Now you should be ready to go.  'Run the firefox executable within the firefox folder.

$ cd ~/webex/firefox
$ ./firefox &

Now open the webex link. You should be able to see the following screenshots. Note the blue 'share desktop' symbol. It indicates that webex is properly. The second screen shows the presentation shared on the webex.






Friday, May 24, 2013

Grub Rescue on Ubuntu 12.04

OS: Ubuntu 12.04

I have two versions of Ubuntu installed on a low-end PC. I resized partitions and it finally messed up the grub settings and I finally ended up getting a grub rescue > prompt on reboot:


I could finally resolve it but still I am not sure if it is the right method. If you know a better method, please let me know.  I basically followed the instructions given here.


Step 1.  It is necessary to identify and locate the partitions where the boot images of your distribution is available.

grub rescue> ls
(hd0)  (hd0,msdos3) (hd0,msdos7)  (hd0, msdos2) (hd0,msdos1)

grub rescue> ls (hd0,msdos1)/boot
... grub .. initrd.img-3.2.0-43-generic-pae ... vmlinuz-3.2.0-43-generic-pae ...

This is the right partition where we would like the grub to boot into

Step 2. It is necessary to find "linux.mod" file which usually lies inside /boot/grub folder.  Do the following:

grub rescue> set prefix=(hd0,msdos1)/boot/grub
grub rescue> insmod (hd0,msdos1)/boot/grub/linux.mod
grub rescue> insmod part_msdos
grub rescue> insmod ext2
grub rescue> insmod gzio

Last two may or may not be necessary. At least I don't get any errors so far.

Step 3. Now its time to tell grub to find the boot images.

grub rescue> set root=(hd0,msdos1)
grub rescue> linux /boot/vmlinuz-3.2.0-43-generic-pae root=/dev/sda1 ro 
grub rescue> initrd /boot/initrd.img-3.2.0-43-generic-pae
no partition found 
grub rescue> boot

The initrd command does not work for me. However, the system boots properly and I get back the login page of my distribution.

Once I log into the system, I open a terminal and install the 'boot-repair' package as follows:

sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair
 
I go for the 'recommended step' and everything gets into its place. When I reboot, I get 
the usual grub menu. If you have a live CD or Live USB, then you can boot into the system 
and install & run boot-repair as explained above to restore your grub.