Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code won't open on Ubuntu 16.04 via VNC

I have tried installing VS Code both via snap and via apt-get

In both cases code doesn't run on a Ubuntu 16.04 server where I use VNC to access the xfce GUI. When I run code --verbose from a terminal window I get

Xlib:  extension "GLX" missing on display ":1.0".
Xlib:  extension "XInputExtension" missing on display ":1.0".
Xlib:  extension "RANDR" missing on display ":1.0".
Xlib:  extension "XInputExtension" missing on display ":1.0".
Xlib:  extension "GLX" missing on display ":1.0".
[6004:0422/160013.955062:ERROR:gl_surface_glx.cc(426)] glxQueryVersion failed
[6004:0422/160013.955091:ERROR:gl_initializer_x11.cc(157)] GLSurfaceGLX::InitializeOneOff failed.
[6004:0422/160013.957145:ERROR:viz_main_impl.cc(195)] Exiting GPU process due to errors during initialization
[5973:0422/160013.958492:ERROR:service_manager_context.cc(258)] Attempting to run unsupported native service: /usr/share/code/content_gpu.service
[main 2019-04-22T23:00:13.965Z] Starting VS Code
...
Xlib:  extension "XInputExtension" missing on display ":1.0".
Xlib:  extension "XInputExtension" missing on display ":1.0".
Xlib:  extension "XInputExtension" missing on display ":1.0".
[6013:0422/160014.026855:ERROR:gl_implementation.cc(292)] Failed to load /usr/share/code/swiftshader/libGLESv2.so: /usr/share/code/swiftshader/libGLESv2.so: cannot open shared object file: No such file or directory
[6013:0422/160014.028943:ERROR:viz_main_impl.cc(195)] Exiting GPU process due to errors during initialization
[5973:0422/160014.030199:ERROR:service_manager_context.cc(258)] Attempting to run unsupported native service: /usr/share/code/content_gpu.service
[5973:0422/160014.033799:ERROR:browser_gpu_channel_host_factory.cc(119)] Failed to launch GPU process.
[5973:0422/160014.069389:ERROR:browser_main_parts.cc(135)] X IO error received (X server probably went away)

What do I need to fix?

like image 934
empty Avatar asked Apr 22 '19 23:04

empty


People also ask

How do I open Visual Studio Code in Ubuntu?

Starting Visual Studio Code Now that VS Code is installed on your Ubuntu system you can launch it either from the command line by typing code or by clicking on the VS Code icon ( Activities -> Visual Studio Code ).

How do I run a Visual Studio Code in terminal?

You can also run VS Code from the terminal by typing 'code' after adding it to the path: Launch VS Code. Open the Command Palette (Cmd+Shift+P) and type 'shell command' to find the Shell Command: Install 'code' command in PATH command.

How do I add Visual Studio Code to Ubuntu?

Install a Linux distro#Choose the Linux distribution you want to install (for example Ubuntu) and follow the prompts. Select Install. And when done, select Launch to get started. This will open a Linux terminal and complete the installation.


1 Answers

The problem is that VS Code uses Electron, which is the root cause of the bug. Bug was reported back in 2016 and is still not fixed.

Fix:

# make a copy of the relevant library
mkdir ~/lib
cp /usr/lib/x86_64-linux-gnu/libxcb.so.1 ~/lib
sed -i 's/BIG-REQUESTS/_IG-REQUESTS/' ~/lib/libxcb.so.1
# set the dynamic loader path to put your library first before executing VS Code
LD_LIBRARY_PATH=$HOME/lib code
like image 131
empty Avatar answered Nov 13 '22 18:11

empty