

Step 4.2: Run VS Code & connect to the serverĬheck the value of $DISPLAY, it should be consistent with your before setting. There should be an 'X' icon on your task bar when you run the software successfully. Step 4.1: Run VcXsrv Display number should be the value you get from Step 3.1, here I set it as 10. If the output is blank, you should set the $DISPLAY value by yourself. Remember the D's value, which is 10 here. So, type the following command in your server's terminal, and it will output something in the form of IP:D.S. Usually, the $DISPLAY variable is set by default. Remember to copy your public key into the authorized_keys on your server machine if you configure a key-based SSH connection. What's more, to enable X11 Forwarding, the following two lines should be added to config file: ForwardX11 yesĭownload VcXsrv from here: VcXsrv Windows X Server download | Īfter the installation, the following software should appear in your Menus. To establish a key-based SSH connection, you should specify the path of key file. It locates at C:\Users\\.ssh\config, where should be your username. To show GUI from remote server, we need to use a tech called X11 Forwarding, which means forwarding the remote XClient's stuff to the XServer that runs on the local machine. XServer is the one who actually draws the pixels on display equipment, while the XClient takes charge of processing the logics behind displaying. IMHO, the X11 protocol is consists of two parts, the XServer and the XClient. Reproduced from see comment above.īasically, all we need to know is that on the server side (mostly are Linux OSs), they use X11 protocol to display GUI. Hopefully everything works after these steps. An easier check is to see if the DISPLAY variable is automatically set in the Linux server. If not set properly, it will complain that the display is not set. You can actually check the logs of remote host, if x11 forwarding is successful and port is set. Make sure that the ssh config forwards x11 connection:

