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
6/20/2018
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
- This guide assumes that you have completed the "Setting up a Python Analytics Server" guide available here.
- Close any running PuTTY sessions.
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.
Windows
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
- Open PuTTY.
Load
your saved session.- Go to the
Connection
→SSH
→X11
category in theCategories
field on the left. - Check the box for
Enable X11 forwarding
. - 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, clickSave
to save the session. Open
your new saved session.
macOS
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."