Saturday, August 29, 2009

Using the MobaXTerm Xserver with Linux

Warning - geek alert: If you work with Windows and Linux/Unix, you need to rush out and get MobaXTerm, a free (but not open source) tool. It takes the GNU/Cygwin collection of command line Unix/Linux tools and puts them in a single Windows executable. Think of it as DOS on super steroids.

Now obviously this isn't for everyone.

Frankly, it's not for the many. But if you're one of the chosen few who have a feet in both the Microsoft and Linux world, you are going to love this.

One of the best features of MobaXTerm is that it includes a built in Xserver, for connecting with a graphical interface to Unix/Linux environments. There are several ways of doing this. Though it requires a little setup on the front end, using Xdmcp is the easiest way to have a complete X remote session.

To do this will require a preliminary bit of editing some text-based config files on the command line. It will also require you have root access through sudo. Don't worry, it's easy. Here's how to do it in Kubuntu.

First, after making a backup, edit (as root or using sudo) this file:

/etc/kde4/kdm/kdmrc

Find the following section:

[Xdmcp]
Enable=false
Willing=/etc/kde4/kdm/Xwilling

And change it to say:

[Xdmcp]
# Enable=false
Enable=true
Willing=/etc/kde4/kdm/Xwilling

Save and exit. Then after making a backup, edit (as root or using sudo) this file:

/etc/kde4/kdm/Xaccess

If you want to allow any machine to connect to the Linux box (such as in your firewalled home network), find this line:

#* #any host can get a login window

Uncomment this line by removing the initial # (leave the second one). If you want to allow only specific hosts, you'll need to make other changes in Xaccess (more complicated than I want to get into -- check Google).

Once completed, reboot or restart Xwindows.

Now, on your Windows box, start MobaXTerm, then click the button labeled Applications (mousing over will reveal the name). The final app listed should be "Xdmcp." Click this and enter the name of the server you just modified. A window should open which gives you a graphical login prompt. Enter your name and password and off you go.

For machines which you don't control (such as in a commercial or workplace environment) there is another, let robust approach. Start an SSH login session from the terminal window, then once on the machine, type "xterm" -- if you have the appropriate permissions you should see a terminal pop up in a GUI window on your machine. From here, you can start (on the command line) any GUI based programs.

MobaXTerm is a great tool -- hope you find it as useful as I do.

No comments:

ShareThis