Seamless Remote Linux Desktop in Windows


This howto describes how to setup your Windows desktop to login remotely to a Linux host and run programs in local desktop windows. In other words, you get seamless access to local and remote apps without jamming all your remote apps into a remote desktop window. You will even be able to run the XFCE Menu application to provide an Applications menu for the remote host, and you get clipboard integration between local and remote windows.


1. Introduction

My main motivation in writing this howto is actually XFCE's Application menu. There is plenty of instructional material out on the Internet showing you how to run X programs remotely, but if you want to go beyond launching a remote xterm window, launching and managing lots of other applications in the session is unintuitive; if you don't know what you're doing, you could end up with your xterm blocked while you run a GUI application, or it's not blocked, but it's getting all the debug output from the GUI applications you did launch.1 You might try just launching your favorite desktop environments with gnome-session or kde4-session but these don't behave as well as XFCE, and even XFCE needs a little bit of tweaking.

You will need:

There are alternative X servers for Windows such as Cygwin/X, which is a little harder to install than Xming. And if you like, you can use Cygwin's ssh command instead of PuTTY. Choose your own adventure and adjust my instructions accordingly.

23 Oct 2009: Oops! I need to rewrite this article! I figured out that if you log into your virtual machine and launch lxpanel (package name lxpanel) instead of xfce4-session, you'll get a nice launcher panel and no unclosable "Desktop" window. Read through the rest of this article, but try using lxpanel instead of xfce4-session.

2. Prepare your Remote Host

Login to the remote host as your normally would for command prompt access. Ensure that you have OpenSSH Server and XFCE Desktop Environment installed. If you are using Ubuntu you should run this command:

sudo apt-get install openssh-server xfce4

For other Linux distributions and other Unix operating systems, see your documentation for how to install these two packages.

3. Install and Configure PuTTY

If you haven't already installed PuTTY as your method for command prompt/text-only remote login, go to the PuTTY Download Page and download putty-X.XX-installer.exe and run it.

4. Install and Configure Xming

Go to the Xming home page, look under the headings Xming Server β†’ Releases β†’ Public Domain Releases and download and run Xming-mesa. (Of course, if you have an Xming Donor account, download from the newer "Website Releases" heading instead.)

Once you have Xming installed, run Start β†’ Programs β†’ Xming β†’ XLaunch.

On the first page of the wizard, Select display settings, choose Multiple windows.


Next, in Select how to start Xming choose Start a program.


Next, in Enter or choose onr X client... fill in

Start Program xfce4-session
Using PuTTY (plink.exe) checked
Connect to computer remote
(Fill in the actual hostname or IP address of the remote host!)
Login as user your username on remote host
Password your password

For security, your password will not be saved by default.


Click Next and you are prompted for the location of plink.exe. You will probably find it in C:\\Program Files\\PuTTY. Navigate to that folder, select plink.exe and click Open.

Next, in "Specify parameter settings" keep the defaults.


Next, in "Configuration complete", choose whether or not to save your password and click Save configuration. You can save it under C:\Users\Me\Desktop\remote.xlaunch, for example.

5. Configuring your Remote XFCE Desktop

At the end of the wizard, you can click Finish to go ahead and launch Xming, plink, and (remotely) xfce4-session. If all goes well, you will get a desktop, composed of one or two xfce4-panel windows, and a full screen desktop window (xfdesktop).

Don't worry if your desktop looks different or plainer than mine; the default configuration of XFCE will be different from one distribution to the next, and the host you see in my screenshot actually has Ubuntu's more comprehensive xubuntu-desktop package installed. Also don't worry that your Windows taskbar is covered up. We can fix these issues.

Right-click on one of the xfce4-panel windows (the grey toolbars in my screenshot) and click Customize Panel. Optionally, using the circle-slash ("⊘") Remove the currently selected panel button, remove all but one of the panels.

Change the remaining panel(s) to Freely moveable and Close the "Customize Panel" dialog box.

Now it should be apparent that although the Desktop xfdesktop window is as large as your screen, it also has a titlebar. Click its minimize button to make it disappear.

Unfortunately, I don't know how to login to a full XFCE session with full GTK+ theme and font support and without xfdesktop being launched. But this is good enough for me, if you just have to minimize the Desktop window after you log in.

Now your desktop should look something like this:

Feel free to move your panel(s) around the desktop and add and remove panel Items from them. You shouldn't need the "Task List" or "Window List" Items because the Windows taskbar works just fine and so does its task switcher (\<kbd>Alt+Tab\</kbd>):

There are a couple of gotchas you should be aware of:

6. Logging Out

Click the Quit button on your Panel.

If you deleted the Quit button, right-click on the Panel, choose Add New Items and add the Action Buttons Item.

Inside the "Log out" dialog box, click Log out.

After the XFCE Desktop session disappears, right-click on the "Xming" icon in the system tray and click Exit.

Xming will warn you that "There are currently 11 clients connected." Those are just background XFCE tasks that didn't terminate during Logout. Click Exit and they will be terminated.

7. Logging Back In After Your First Time

Navigate to where you saved your remote.xlaunch file and double-click it.

8. Oh Crap, I Screwed Up My XFCE Desktop! Help!

If your XFCE Panels are all out of whack or you just want to start over with your XFCE Desktop configuration for any other reason, just log in to your remote host with your usual text-only method and run these commands:

cd ~/.config
rm -r xfce4
rm -r xfce4-session

  1. The simple solution for launching a GUI app from an xterm is to run "[command] >/dev/null 2>/dev/null &", but who wants to type all that every time? 


Add Comment

* Required information
Powered by Commentics

Comments (3)

Hi, to avoid xdesktop, just launch xfce4-panel, instead of xfce4-desktop

Sorry I took so long to approve this comment.

A little late to the party, but I just wanted to thank you for this tutorial. Xming had me a bit stumped and this worked really well. Thank you!