0

I am facing a problem when trying to open VS Code on my Virtual machine in Google cloud using VNC viewer.  It's Real VNC, and I checked that vscode is not running in multiple VNC sessions.

The VM is running Ubuntu 18.04 LTS.

I was able to install the application [VS Code] and see it listed with the other applications, but I am not able to open it, either by clicking on the icon or running it via the terminal.

When I tried to run VS code through the terminal, it didn't give any errors!

I tried to follow a related issue on Github, but I was not able to solve my problem.

For installation, I installed the deb package from the VS code website and did sudo dpkg –i <package_name> to install it.

After following Robot Johnny's answer below, this is the response for code --verbose:

Xlib:  extension "XInputExtension" missing on display ":1".
Xlib:  extension "RANDR" missing on display ":1".
Xlib:  extension "XInputExtension" missing on display ":1".
[13988:1206/040556.509538:ERROR:gl_surface_glx.cc(425)] glxQueryVersion failed
[13988:1206/040556.509600:ERROR:gl_initializer_x11.cc(147)] GLSurfaceGLX::InitializeOneOff failed.
[13988:1206/040556.510808:ERROR:viz_main_impl.cc(170)] Exiting GPU process due to errors during initialization
[13966:1206/040556.517587:WARNING:gpu_process_host.cc(1193)] The GPU process has crashed 1 time(s)
Xlib:  extension "XInputExtension" missing on display ":1".
[13966:1206/040556.554491:WARNING:gpu_process_host.cc(967)] Reinitialized the GPU process after a crash. The reported initialization time was 14 ms
[main 2019-12-06T04:05:56.578Z] Starting VS Code
[main 2019-12-06T04:05:56.579Z] from: /usr/share/code/resources/app
[main 2019-12-06T04:05:56.579Z] args: {
  _: [],
  diff: false,
  add: false,
  goto: false,
  'new-window': false,
  'reuse-window': false,
  wait: false,
  version: false,
  help: false,
  telemetry: false,
  'list-extensions': false,
  'show-versions': false,
  verbose: true,
  status: false,
  'prof-startup': false,
  'disable-extensions': false,
  'disable-gpu': false,
  'extension-development-confirm-save': false,
  logExtensionHostCommunication: false,
  'skip-getting-started': false,
  'skip-release-notes': false,
  'sticky-quickopen': false,
  'disable-restore-windows': false,
  'disable-telemetry': false,
  'disable-updates': false,
  'disable-crash-reporter': false,
  'disable-user-env-probe': false,
  'skip-add-to-recently-opened': false,
  'unity-launch': false,
  'open-url': false,
  'file-write': false,
  'file-chmod': false,
  'driver-verbose': false,
  force: false,
  trace: false,
  'force-user-env': false,
  'no-proxy-server': false,
  nolazy: false
}
[main 2019-12-06T04:05:56.580Z] Resolving machine identifier...
[main 2019-12-06T04:05:56.581Z] Resolved machine identifier: 8195d34eeeec20241a1db1a84b63b5309fc06715a4960b3481584f41d87c0955 (trueMachineId: undefined)
[main 2019-12-06T04:05:56.597Z] update#setState idle
[main 2019-12-06T04:05:56.600Z] [storage state.vscdb] 
open(/home/developer/.config/Code/User/globalStorage/state.vscdb, retryOnBusy: true)
[main 2019-12-06T04:05:56.600Z] lifecycle (main): phase changed (value: 2)
[main 2019-12-06T04:05:56.601Z] windowsManager#open
Xlib:  extension "XInputExtension" missing on display ":1".
Xlib:  extension "XInputExtension" missing on display ":1".
[13966:1206/040556.659702:ERROR:atom_browser_main_parts.cc(183)] X IO error received (X server probably went away)

Any help would be greatly appreciated.

5
  • Hi, welcome to the U&L community. In order for us to be able to help, we will need further information. Please can you edit your question and paste exactly what you did to install vs code, along with any output. If it's a fresh VM with nothing on it, it may be worth just starting from scratch rather than trying to uninstall and re-install so we get the most accurate output. FYI some VNC clients don't allow you to copy text. If that's the case for you, I'd recommend trying realvnc Dec 4, 2019 at 11:13
  • Try running code --verbose from a terminal. It might be useful to include that output in your question.
    – Mikel
    Dec 5, 2019 at 13:29
  • Check if you have vscode running in multiple X (or VNC) sessions. Unfortunately it doesn't support that. github.com/Microsoft/vscode/issues/57843
    – Mikel
    Dec 5, 2019 at 13:31
  • The RANDR error sounds interesting. Is DISPLAY=:1 correct? What's your VNC server app called? There are several versions these days (RealVNC, UltraVNC, TigerVNC, etc.) that should support RANDR.
    – Mikel
    Dec 6, 2019 at 4:10
  • It's Real VNC and I also checked that vscode is not running in multiple VNC sessions.
    – spock
    Dec 6, 2019 at 4:15

1 Answer 1

0

Sounds like either something is wrong with the deb package or something else has not installed correctly along the way.

I would recommend starting with a new VM deployment to ensure you have a clean VM.

Then, As per this tutorial:

First, update the packages index and install the dependencies by typing:

sudo apt update
sudo apt install software-properties-common apt-transport-https wget

Next, import the Microsoft GPG key using the following wget command:

wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -

And enable the Visual Studio Code repository by typing:

sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"

Once the apt repository is enabled, install the latest version of Visual Studio Code with:

sudo apt update
sudo apt install code

That’s it. Visual Studio Code has been installed on your Ubuntu machine and you can start using it; either via terminal by typing code or via the UI.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .