Running PyCharm on a virtual machine using X-forwarding

Samuel Williams
Scanning Probe Microscopy
Center for Nanophase Materials Sciences
Oak Ridge National Laboratory

School of Materials Science and Engineering
Georgia Institute of Technology


X-forwarding involves connecting an application running on a Linux system to a display server (known as the X server) running on a different system (such as a Windows computer through which the user is interfacing with the Linux system). In this guide, we will install an X server on your local computer, install PyCharm on the virtual machine, and then run PyCharm, displaying its graphical user interface through the X server. For more background information, read about the X Window System and X.Org.

Before beginning this guide

Setting up X-forwarding

We will have the virtual machine connect to a program running locally through X-forwarding to display PyCharm as a graphical user interface.


Install an X server

One possible X server to use is Xming. On the Xming website linked, click "Xming" under "Public Domain Releases" in the Releases section. Download and install Xming, using all of the recommended settings.

Other X servers may work, too. However, these servers may require different or additional configuration.

Configuring PuTTY to use the X Server

  1. Open PuTTY.
  2. Load your saved session.
  3. Go to the ConnectionSSHX11 category in the Categories field on the left.
  4. Check the box for Enable X11 forwarding.
  5. Go to the Session category again. Change the name of the session. For example, if your saved session was named "JupyterVM," you could name the new session "JupyterVM-X11." Then, click Save to save the session.
  6. Open your new saved session.


Install XQuartz, and then start XQuartz. Connect to your virtual machine using SSH in a terminal window as you would normally, but include the -Y argument to enable X-forwarding.

Installing PyCharm

PyCharm is available as a snap package. Run sudo snap install pycharm-community --classic to install it.

Running PyCharm

Before running PyCharm, ensure that your X server on your local computer is running. By default, Xming is started in the last step of installation. If your X server is not running, start it.

Run PyCharm by running pycharm-community in your virtual machine. Wait a moment and the PyCharm splash screen should appear as a new window created by the X server.

Configuring PyCharm to manage repositories of interest

In this example, the goal is to work on a Python package on GitHub for nanoscale image analysis - pycroscopy starting from the third page, titled "Set-Up PyCharm."