Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Saturday, February 12, 2011

Remote Login to Kubuntu via XDMCP

Background
After searching the Internet for the elusive solution, here's what worked for me, using Kubuntu 10.10. Using SSH tunneling to run GUI programs on a Linux server would be easier for me as it's the standard practice at my workplace, but takes out the fun in having to play around with the entire desktop display.

My ex-colleague in my ex-company showed me how to do remote login to a Solaris 9 box via XDMCP using Cygwin (xwin) on Windows XP. Back then there was no need to configure anything on that Solaris box, it just works. When I moved on to my current company, I tried to do the same on the 'standard build' RHEL3/4 box. Failed miserably. The 'standard build' stripped the window manager away, and I have to settle for SSH tunneling. Some simple applications can be run, most of the cool ones don't.

Of course, there are other alternative ways to display the desktop remotely, such as VNC, but I prefer XDMCP because the display resolution is 'customized' to your viewing machine's resolution. XDMCP also establishes a different session so unlike VNC, it will not 'hijack' or take over the current user's session. Maybe VNC can also do these things with some tweaking, but this out of scope in this posting.

Server Settings
Ok, firstly, make sure KDE (I'm using Kubuntu) is running fine & fast. If you are using NVIDIA graphics card, update your drivers via launcher: Applications > System > Additional Drivers. This is the fastest & easiest way. In my workplace where I needed to set a global proxy to connect to the Internet, this way didn't work. I've tried downloading the drivers from NVIDIA website and followed the instructions, but to no avail.

Ok, here's the real meat:
  1. As root, open up /etc/kde4/kdm/kdmrc file. Search for the section with header [Xdmcp], and update as highlighted below (even though the comment says 'Default is true', the Enable key had the value 'false' by default)

    [Xdmcp]
    # Whether KDM should listen to incoming XDMCP requests.
    # Default is true
    Enable=true
  2. Save the file above. If you are happy with the defaults, then open up /etc/kde4/kdm/Xaccess file, and uncomment the following lines (remove the # at the start of the line, and both lines are not next to each other, it's shown as below for conciseness):

    * #any host can get a login window

    * CHOOSER BROADCAST #any indirect host can get a chooser
  3. Save the file above. Ok, now just restart KDM only, but restarting the OS will also achieve the same effect.
  4. Before we move on, make sure you have the server's IP address, we'll need it for the client setup below. Let's say it's 192.168.2.2
Client Settings
For the client, I used Windows XP. I wanted to use Cygwin (xwin) but somehow the command prompt just closes by itself after a few seconds. It's a mystery...but I also have Xming installed. So I used it instead. Get Xming @ http://sourceforge.net/projects/xming/
  1. Open up the command prompt and navigate to the Xming installation folder. It should contain xming.exe file.
  2. Then run this command (replace the IP address with your own server's IP): xming -query 192.168.2.2
  3. It will take a while if your server is not that powerful and using a slow network connection (I was using my old P4 box as server and my WinXP notebook was connecting via wireless). If everything's working, you will see the KDE login screen. Yahoo!

Wednesday, December 22, 2010

RAR in Linux

RAR is a very popular compression format in Windows (at least, since I am using Windows at work & at home). RAR generally has a better compression ratio than ZIP, and in places where disk space counts, would be cost-saving and "life-saving".

At my workplace, there's a need to Un-RAR a RAR file (created in Windows) in a Linux box. In the standard build of Linux (based on RHEL4) that we were running, the "unrar" command-line program is not present. Fortunately there's a free version on the Internet. Just need to do a little searching to get the RPM.

So I went to http://rpm.pbone.net/ and I found the right RPM file. My exact search result: http://rpm.pbone.net/index.php3/stat/4/idpl/11979708/dir/redhat_el_4/com/unrar-3.7.8-1.el4.rf.i386.rpm.html

Installing it is a breeze (phew!), with all the dependencies fulfilled in my Linux box. The command is simple (recommended using root-access to run):

rpm -i unrar-3.7.8-1.el4.rf.i386.rpm

So now, we can un-RAR files in Linux!

Basic usage:

unrar x myrarfile.rar

where 'x' is to extract files. Full list of options can be obtained by just typing "unrar".

What about creating RAR files in Linux? AFAIK, there's no free tool, but you can purchase or try one. Go get the files @ http://www.rarlabs.com