Remote Linux Mint (Ubuntu) on VMWare from Windows over SSH



In this article we want to dig into the world of remote controlling a machine running Linux Mint 6 Felicia (Ubuntu based) as operating system, by using XDMCP capabilities and connecting from a Windows Client.
Thus, this machine will not be accessible only by console (ssh shell) but using full graphic, with the same login screen as we were accessing as a local user.

To accomplish this task, we will exploit xserver and X11 capabilities, xdm (gdm) and xdmcp.

But in this case we have a little different (and more complex) scenario than in a standard situation like the one described before : we want the linux machine (running Mint) to be virtualized and hosted in a Windows XP computer.
We've chosen VMWare as virtualization software, but you could use QEmu or VirtualBox as well.

So let's proceed defining our sample configuration:

  • client: Windows Vista
  • server: Linux Mint 6
  • virtualization host for Linux Mint: Windows XP Professional
  • virtualization software: VMWare Server


Installing VMware Server and Linux Mint 6

Firstly, we have to install the virtualization software on the host machine and you can download it for free from VMWare website.
After completing the setup procedure, we have to configure our virtual machine, so we connect to our "vmware server" through VMWare Server Console and by clicking on New Virtual Machine we create a new Virtual Machine;
we can configure the machine as we like but assigning at least 512 RAM MegaBytes and the Ethernet Adapter as "NAT mode" (this for simplicity, as we could use also "Host Mode" configuring VMWare port forwarding accordingly).

If you don't have Linux Mint latest version you can easily download it from Mint website.

To start Mint setup process in our Virtual Machine we have to assign the downloaded ISO file to the virtual CDRom drive or insert the burned cd in our real drive, if you need more information on using VMWare Server you can read this guide Linux on Windows Xp.

If this is the first time you are installing a Linux Operating System you could be seeking for help, so you can follow this tutorial as well : Installing Mint Felicia.

After having successfully configured the Virtual Machine and installed the operating system, we can start our system (virtual) and configure it for remote access (as a server) : after the boot procedure log in with your username and password (you assigned them during the setup) and go to Main Menu (bottom left) -> Administration -> Login Screen; choose "Remote" tab and set "Same as Local" on "Style" menu; after doing this simply hit Close on bottom right to activate XDMCP.



Downloading OpenSSH Server

If you are intersted about accessing through ssh (both shell and X11 forwarding) you need to install the openssh-server package.
The quickest way is to open a terminal (Main Menu -> Terminal) and give this command from console
sudo apt-get install openssh-server
and follow on screen instructions (probably you will be prompted for your password and you could need to answer "yes" to some questions).
Alternatively you can use the graphic packet management tool.



Configuring the Windows Client

At this point we have to configure our client and to do it we have chosen the free solution offered by CygWin.
CygWin is a porting of some Unix tools (for example the shell) on Windows to allow the user to work in a Unix-like way.
To download it you can get the windows-like setup here Installing Cygwin

Run the downloaded setup file and remember to install the shell, ssh and X (graphic server): for further instructions click here.



Remote Login

Now we are ready to login to our remote system, just only be sure that the pc hosting vmware is running and that the Linux Virtual Machine has been started; then go to your Windows Client and start the Cygwin bash shell.

Now, if you are trying to use XDMCP you can simply give this command (on cygwin bash shell)
xwin -query
for example, assuming the "host" pc with ip address of 192.168.1.91
xwin -query 192.168.1.91
and you'll see a Linux Mint login screen on your pc, as if you were sitted on the host pc allowing you to use the graphic login screen remotely.



Using ssh

If you don't want to use XDMCP (or if it does not work for some reason) it's still possible to use the Gnome graphic desktop remotely using SSH, X11 Forwarding and XWin, bypassing the login screen.

To do it you have to be sure that SSH (as server) is running on your Mint machine (this will be the default if you followed our previous steps, but a reboot of the virtual machine could be necessary) and open cygwin bash on Windows client.

Execute the command
xwin&
to start a local instance of XServer and then go back to the shell;
now you have to connect to your SSH daemon on the virtual machine and run the command for the graphic desktop
DISPLAY :0.0 ssh -l -Y gnome-session
for example if the Mint user is test and the host ip 192.168.1.91
DISPLAY :0.0 ssh -l test -Y 192.168.1.91 gnome-session

Wait a few seconds and input the user's password at prompt;
now you can lower the shell window (don't close it) and return to the local XServer you launched before: after waiting some load time (remote loading time) you will see the mint desktop as you were on the remote computer.



We finished, just some tips : if you need to configure your firewall router keep in mind that XDMCP works on port 177 UDP and that XServer communicates on port range TCP 6000-6005 (outgoing from the remote pc to the local pc).

We hope that this article can be useful and we suggest you to leave comments.

Crystal Solutions
Emanuele Pedrona
Follow on Twitter: epedrona



ADV : looking for a Hotel Parma ?


curiosity

Out of curiosity, why not just use vmware's own cross-platform vmware-server-console? It's more feature rich than RDP, and way faster.

Re: curiosity

Your solution is good as well, but I wanted other pcs to connect to the linux server using only open source and free software. VMWare is not.

Anyway, the vmware mechanism works well.

Edit: I don't think you can use "multiple logins" with vmware console. I wanted to have a "virtual server" to allow multiple simultaneous logins at the same time.

Nice test :) But I doubt it

Nice test :)
But I doubt it would be used somewhere in a real environment...

User login

Contattaci

Lasciate i vostri dati e verrete ricontattati il prima possibile.

Azienda
Nome
eMail
Telefono
Richiesta
informativa sulla privacy
accetto informativa sulla privacy