Is it possible to X11 Forward Visual Studio Code on Ubuntu Server 14.04?

Solution 1:

Yes it works. I just tested it.

First off, fix your dependencies

Failed to load libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory

What I did

I used a Virtualbox VM running Ubuntu 15.04, and VSCode. I did not have to install anything. Because it was the Desktop version, X11 libraries and such were already there.

I sshd in from an Ubuntu 15.10 workstation with ssh -Y and ran ./Code. It started up just fine.

Though I did get these errors, likely because it's a remote X11 rather than directly on a graphics card.

[3540:1029/214400:ERROR:browser_main_loop.cc(173)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
[3540:1029/214401:INFO:audio_manager_pulse.cc(258)] Failed to connect to the context.  Error: Connection refused
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
[3555:1029/214402:ERROR:gl_context_glx.cc(54)] Failed to create GL context with glXCreateContextAttribsARB.
[3555:1029/214402:ERROR:gpu_info_collector.cc(41)] gfx::GLContext::CreateGLContext failed
[3555:1029/214402:ERROR:gpu_info_collector.cc(95)] Could not create context for info collection.
[3555:1029/214402:ERROR:gpu_main.cc(411)] gpu::CollectGraphicsInfo failed (fatal).
[3555:1029/214402:WARNING:x11_util.cc(1474)] X error received: serial 65, error_code 2 (BadValue (integer parameter out of range for operation)), request_code 154, minor_code 34 (Unknown)
[3555:1029/214402:WARNING:x11_util.cc(1474)] X error received: serial 64, error_code 2 (BadValue (integer parameter out of range for operation)), request_code 53, minor_code 0 (X_CreatePixmap)
[3555:1029/214402:ERROR:gpu_child_thread.cc(163)] Exiting GPU process due to errors during initialization
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell

It doesn't seem to matter, VScode is working anyways.

Solution 2:

This is the solution that worked for me if you're coming from a Windows machine:

https://stackoverflow.com/a/40013437/3011683

User Frank Liu was nice enough to come back and answer his own question, which was to use VcXsrv rather than Xming. Apparently this is due to Xming not supporting some features VS code needed, but the referenced answer dosen't go into detail on why that is.