Categories: Linux

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”:
    X11Forwarding 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
     sudo systemctl restart ssh.service
  5. If you don’t have a graphical desktop installed, install some sample programs:
    sudo apt-get install x11-apps
  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. xeyes
    
  10. 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.
  11. For programs that require sudo you have to use the “-E” option:
    sudo -E gparted
    
  12. 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:

Charlie

Recent Posts

Creating a Shortcut to Windows Terminal (Or Any Other App That Doesn’t Show Shortcut Option)

Weirdly, Windows Terminal does not allow you to create a shortcut - there's no obvious…

3 months ago

Simplest Wireguard Setup Ever

Wireguard Wireguard is the newest way to setup a VPN for your home servers. What…

4 months ago

Fix Your Smart Home – Stop Tasmota Devices From Switching Randomly

While working on fixing my KuLED light switches from magically but unexpectedly switching on, I…

6 months ago

Using WP-CLI to Access MySQL Running in A LAMP Docker Container

WP-CLI is a great command line tool to help you manage Wordpress. I had trouble…

9 months ago

Dunzip – Download and Unzip in Linux With One Command

Tired of downloading zip or tar files, decompressing, and then having to delete the compressed…

10 months ago

Backing Up an SD Card or Hard Drive to A VHD File (Virtual Hard Disk)

  The Microsoft Virtual Hard Disk - An Ideal Backup Image Format Microsoft's Virtual Hard…

10 months ago