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

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

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

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)

我使用以下命令安装了 VScode:
$ sudo apt install curl
$ curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
$ sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
$ sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
$ sudo apt update
$ sudo apt install code

当我收到启动错误时,我尝试使用“dpkg -i”安装 .deb 文件,以确保问题不在于安装。

最佳答案

哈!谷歌先生来救援。
这是修复:

# 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

关于ubuntu - Visual Studio 代码无法在适用于 Linux 的 Windows 10 子系统(ubuntu)上启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52357712/

相关文章:

visual-studio-code - 如何通过按键绑定(bind)在当前打开的文件右侧打开一个新终端?

visual-studio-code - 如何对语言服务器中的文件系统事件使用react

python - Pyinstaller编译的exe找不到绝对路径的文件

python - DLL 加载失败 : The specific module could not be found (VSCode, Numpy)

windows - 排除目录的 uwfmgr 会增加 RAM 使用量

c# - 有什么正确的方法可以通过路径获取文件吗?

linux - 在当前目录和子目录中查找文件类型,包括隐藏文件。 (家庭作业)

python - 尝试在 ubuntu windows 中查看输出时出现 Makefile 错误

node.js - 为什么 LeetCode 扩展无法在 ubuntu 16.04 上的 Visual Studio Code 中运行?

java - JFrame 在 ubuntu 上的默认大小