GUI forwarding
If you develop a web application or some other project that contains Graphical User Interface (GUI) remotely, you can forward GUI from a remote server to JetBrains Client using Xpra or VNC viewer.
Xpra configuration
When you work with Xpra, keep its pros and cons in mind:
It handles each window by itself and displays it as a native window on your local machine.
It handles HiDPI better than VNC.
It sets up the whole environment by itself, only a single command needs to be started.
It allows you to forward different items and devices such as clipboard, sound, cameras, and so on.
It allows you to forward a real desktop.
It can work as a server also on Windows and macOS.
It is quite heavy because ships a lot of additional items.
In some distributions such as Ubuntu, Xpra has quite an old version (3.1.3) while the version 4.3.4 is the latest
Configure Xpra for a remote project
Connect to your remote server and enter the following command:
sudo apt-get install xpra x11vnc xvfbNote that the package name might be different in the distributions other than Ubuntu or Debian.
On you local machine, install the Xpra application.
Open the remote project using JetBrains Gateway.
Open the embedded terminal and execute the following command:
xpra start --bind-tcp=0.0.0.0:10000 --use-display=no --daemon=no :10Click
forward
at the terminal suggestion to forward an opened port10000
.On your local machine, in the local terminal, execute the following command:
xpra attach tcp://localhost:10000The port number is taken from the
forwarded to
label in the terminal tool window.In JetBrains Client, from the main menu, select Edit Configurations to open the desired run configuration with your GUI application.
In the Run/Debug Configurations dialog, in the Environment Variables field, add
DISPLAY=:10
and click OK to save the changes.On the main menu, click Run next to your configuration.
The application window forwarder by Xpra gets displayed.
VNC configuration
When you work with VNC, keep the following pros and cons in mind:
Xvfb and x11vnc are standard Linux tools.
VNC is lighter comparing to Xpra.
As a prerequisite, a window manager such as
fluxbox
has to be installed on a remote server.The windows aren't rendered natively on your machine.
It is not displayed properly on the HiDPI screens.
Configure VNC for a remote project
Connect to your remote server and enter the following command:
sudo apt-get install x11vnc xvfb fluxboxNote that the package name might be different in the distributions other than Ubuntu or Debian.
On your local machine, install a VNC client, such as tigervnc or any alternative VNC client.
Open the remote project using JetBrains Gateway.
Open the embedded terminal and execute the following command:
Xvfb :10 -screen 0 1920x1080x24 & DISPLAY=:10 fluxbox & x11vnc -display :10 -autoport 10000 -localhost -scale 1.75Click
forward
at the terminal suggestion to forward an opened port10000
.On your local machine, in the local terminal, execute the following command:
vncviewer localhost:10000The port number is taken from the
forwarded to
label in the terminal tool window.An empty VNC session gets started.
In JetBrains Client, from the main menu, select Edit Configurations to open the desired run configuration with your GUI application.
In the Run/Debug Configurations dialog, in the Environment Variables field, add
DISPLAY=:10
and click OK to save the changes.On the main menu, click Run next to your configuration.
You should see your application inside the VNC viewer. In the case of HiDPI, your application may look blurry.