Break Out of the Virtualbox Jail: Run Linux Graphical Apps On Windows Using Putty, Xming, and VirtualBox

I use Virtualbox to run linux. But the terminal Virtualbox uses is awful so I ssh in when I want to use the command line. I recently discovered you can also do this for the graphical desktop so you don’t have to put up with the lousy Virtualbox console which fits all the linux elements in a hard to scale box. You can have your graphical linux desktop run right along Windows just as it was another MS Window Window. Follow thiese steps:

  1. Download and install Xming Server on Windows.
  2. Setup your VirtualBox running say debian and boot up your virtual box ( I won’t go into that here but check this tutorial out).
  3. At your debian command line edit /etc/ssh/sshd_config and make these lines “yes”:

    If this doesn’t work, on some older versions of SSH you may also need to set “X11UseForwarding yes”. To make sure if you need this check “man sshd_config” if that option is available. If it is, either set it to yes or upgrade sshd (which is really what you should do!). If you use X11UseForwarding option and ssh refuses to start then you should delete it from the sshd_config.

  4. Restart your ssh server if X11Forwarding was previously set to no. On debian/ubuntu this would be
  5. If you don’t have a graphical desktop installed, install some sample programs:

  6. Now on your Windows desktop fire up Putty. Add a profile to ssh into your debian virtualbox machine (hint: if you haven’t already, you’ll need to get your virtual machine’s ip address and you can’t get that until you make sure your debian virtual machine’s network setting is set to bridge so it has an ip address on your local network. Follow the steps under Selecting Bridge Networking)
  7. In your Putty profile Go to X11 and make sure forwarding is turned on. Save your profile.

  8. Now, ssh in to your Virtualbox machine and start an x-windows app.
  9. You should see the eerie “xeyes” program staring at your right on your Windows desktop!:

    That’s right, a Linux program running right on top of your local Windows desktop (actually the graphical elements are being forwarded by your virtualbox session to xming). Really cool and the Windows resizing and movements are unlimited by the Virtualbox Console. Try moving the window around – acts like any other Windows program.
  10. For programs that require sudo you have to use the “-E” option:
  11. Now you should see something like this – completely cool. I’ve labeled all the windows so you can appreciate the fact that the gparted GUI is running separately from the Putty and Virtualbox consoles:

    And here’s a video:


Leave a Reply

Your email address will not be published. Required fields are marked *