How To Remotely Access Linux GUI From Windows PC


As Linux is becoming more and more popular, today's networks have become a hybrid mesh of Windows and Linux machines.

Often, it becomes quite neccessary to remotely gain GUI access to a Linux box from a Windows PC. In today's Linux Gyan section, we give you various ways to get this done. Though most of the screenshots here are taken in a fedora box, the methods ought to work in any other distro like Ubuntu.

Note: If you just want a command line access and is not interested in GUI, enable ssh in your linux machine. Then use putty from windows machine.

1. Using Cygwin

If you happened to have cygwin already installed in your Windows PC, then this is the method to go. If you are about to install cygwin, then ensure that you install the X server packages.

Now you need to make some modifications in the Linux machine to which you want to login. Specifically, you need to enable XDMCP. For this:

  1. Select System -> Administration -> Login Screen.
  2. Select the Remote tab and set the style as "Same as local"

  3. If you want to login as root, select the Security tab and ensure that the checkbox "Allow remote system administrator login" is checked

  4. Reboot the Linux machine.

Now in the Windows PC, take a cygwin shell and enter the command:

XWin -screen 0 -clipboard -nodecoration -kb -nowinkill -unixkill -query <ipaddress>
Replace <ipaddress> with the ipaddress of your linux machine (use ifconfig command to know your Linux machine's ip address).

2. Using NoMachine NX

NoMachine is an Italian company that developed the NX tool. You need to install the NX server in the Linux machine and run the NX client from Windows. Note that this is not a free software. Some of the parts of the software is released under GPL. NoMachine provides a free edition of their server that you can download here.

Go for this method if you have a slow network. NX's high compression and caching can reduce the bandwidth cost and deliver a faster performance.

3. Use VNC

This is the fastest way to get Linux GUI access from Windows. So use this method if your boss has given you a dead line of 5 minutes to setup remote access to a Linux machine from his Windows PC.

Almost all modern Linux distros come with a vnc server installed by default. Take a terminal and enter vncserver. If run for the first time you'll be asked to set a password. Once VNC server is running, use any VNC client for windows like the UltraVNC to access the Linux machine.

Note that when you start the VNC server, it will churn out something like New 'localhost.localdomain:1 (root)' desktop is localhost.localdomain:1. note the digit that comes after your host name (usually it will be 1).This is your display number to which the VNC server has attached. You need to provide that number in the VNC client as <IPADDRESS>:DISPLAY_NUMBER

Know of any better ways? Share it in the comments.