Visual Studio代码无法在Linux的Windows 10子系统上启动(ubuntu)

时间:2018-09-16 19:31:05

标签: ubuntu visual-studio-code windows-10 xming

我在Windows 10上,已经直接从商店using the guidelines given here安装了Linux(Ubuntu) 我也有Xming,并在我的bashrc文件中设置了DISPLAY =:0。 诸如Firefox和PyCharm之类的程序运行良好,但VSCode无法运行。 它与this issue不同,并且产生的错误消息似乎有所不同。 使用--verbose选项运行它,如下所示:

undefined

我使用以下命令安装了VScode:

Me@DESKTOP-1:/mnt/e/ubuntu-stored/repoitories/pawlib$ code .
Me@DESKTOP-1:/mnt/e/ubuntu-stored/repoitories/pawlib$ which code
/usr/bin/code
Me@DESKTOP-1:/mnt/e/ubuntu-stored/repoitories/pawlib$ code --verbose
[3773:0916/193522.695084:ERROR:bus.cc(395)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
shared memfd open() failed: Function not implemented
[main 7:35:23 PM] Starting VS Code
[main 7:35:23 PM] from: /usr/share/code/resources/app
[main 7:35:23 PM] args: { _: [],
  help: false,
  h: false,
  version: false,
  v: false,
  wait: false,
  w: false,
  diff: false,
  d: false,
  add: false,
  a: false,
  goto: false,
  g: false,
  'new-window': false,
  n: false,
  'unity-launch': false,
  'reuse-window': false,
  r: false,
  'open-url': false,
  performance: false,
  p: false,
  'prof-startup': false,
  verbose: true,
  logExtensionHostCommunication: false,
  'disable-extensions': false,
  disableExtensions: false,
  'list-extensions': false,
  'show-versions': false,
  nolazy: false,
  issue: 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,
  'skip-add-to-recently-opened': false,
  status: false,
  s: false,
  'file-write': false,
  'file-chmod': false,
  'driver-verbose': false }
[main 7:35:23 PM] Resolving machine identifier...
[main 7:35:23 PM] Resolved machine identifier: d4398814e404b0f7472543859e2fed861c7a29fc750e4c131eab633c4e5a44b8
[main 7:35:23 PM] update#setState idle
[main 7:35:23 PM] windowsManager#open
[3805:0916/193523.829735:ERROR:gl_surface_glx.cc(413)] GLX 1.3 or later is required.
[3805:0916/193523.829875:ERROR:gl_initializer_x11.cc(153)] GLSurfaceGLX::InitializeOneOff failed.
[3805:0916/193523.848836:ERROR:gpu_child_thread.cc(252)] Exiting GPU process due to errors during initialization
[3773:0916/193523.869175:ERROR:browser_gpu_channel_host_factory.cc(103)] Failed to launch GPU process.
[3773:0916/193524.216326:ERROR:browser_main_parts.cc(139)] X IO error received (X server probably went away)

出现启动错误时,我尝试使用“ dpkg -i”安装.deb文件,只是为了确保问题不在于安装。

3 个答案:

答案 0 :(得分:2)

哈! Google先生来营救。 解决方法如下:

# 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

来自: https://github.com/Microsoft/vscode/issues/3451

答案 1 :(得分:1)

VS Code不支持通过WSL启动Linux客户端,但是您可以通过调用<VS Code Install>\bin\code.sh通过WSL启动Windows客户端。

此外,尽管可以通过安装X服务器通过WSL启动Linux应用程序,但这更多是试验性的。 WSL的重点是将基于Linux的命令行工具引入Windows。

答案 2 :(得分:0)

我有同样的问题,但是我正在从Linux机器上启动代码。 Xming处理xterm,firefox等,但对vs代码不满意。您可以使用

解决glx问题
$ code --disable-gpu

but I still get:
[main 2:29:54 PM] update#setState idle
[main 2:29:54 PM] windowsManager#open
[42083:0108/142954.536002:ERROR:browser_main_parts.cc(139)] X IO error received (X server probably went away)

So maybe an X-server problem?  Maybe try a different X server?