WhitewaterFoundry / Pengwin

A Linux distro optimized for WSL based on Debian.
Other
1.48k stars 105 forks source link

Unable to launch VSCode #395

Closed hidenmind closed 5 years ago

hidenmind commented 5 years ago

I am unable to launch VSCode in a specific machine. I did a fresh install of pengwin and installed the VSCode via pengwin-setup. My XServer is x410 and when I start vscode nothing happens, no GUI is shown even though the process is running. peng

Additional context I am running other GUI applications with no problems, like nautilus and Vim.

The problen only happens in one machine.

Basic Troubleshooting Checklist

[ x] I have searched Google for the error message. [x ] I have checked official WSL troubleshooting documentation: https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#confirm-wsl-is-enabled. [ x] I have searched the official Microsoft WSL issues page: https://github.com/Microsoft/WSL/issues. [x ] I have searched the Pengwin issues page: https://github.com/WhitewaterFoundry/Pengwin/issues. [ x] I have reset Pengwin: Settings->Apps->Apps & features->Pengwin->Advanced Options->Reset. [x ] I have disabled and re-enabled WSL in Windows Features. [x ] I have run Windows 10 updates and restarted.

Pengwin Version Last version, since it's a fresh install

Windows Build Windows 10 - 1709 - 10.0.16299 build 16299

crramirez commented 5 years ago

Hello,

Please run pengwin-setup --debug install again VSCode and send us the output.

Regards

hidenmind commented 5 years ago

Here is the output:

diego@PAT1677:~$ pengwin-setup --debug Running in debug/verbose mode ++ shift ++ [[ 0 -gt 0 ]] +++ cmd-exe /c 'echo %HOMEDRIVE%%HOMEPATH%' +++ tr -d '\r' /usr/local/bin/cmd-exe: line 3: wslpath: command not found ++ readonly 'wHomeWinPath=C:\Users\charles.dsn.shop' ++ wHomeWinPath='C:\Users\charles.dsn.shop' +++ wslpath -u 'C:\Users\charles.dsn.shop' /usr/local/pengwin-setup.d/common.sh: line 106: wslpath: command not found ++ readonly wHome= ++ wHome= ++ readonly CANCELLED=CANCELLED ++ CANCELLED=CANCELLED ++ SetupDir=/usr/local/pengwin-setup.d ++ readonly GOVERSION=1.12 ++ GOVERSION=1.12

crramirez commented 5 years ago

Ok, I don't see anything special in the code installation. But /usr/local/pengwin-setup.d/common.sh: line 106: wslpath: command not found indicates that your PATH variable doesn't have Windows path. Look in your /etc/profile or ~/.bashrc for something that is overwriting your PATH.

Please send me the output of echo $PATH. Meanwhile, run vscode with:

env DISPLAY=:0 code

Regards

sirredbeard commented 5 years ago

Did you install the common GUI libraries in Pengwin-Setup?

@crramirez I don't think this is #285 but something to keep in mind.

crramirez commented 5 years ago

Yes, I thought this, but I saw the right versions of udev in the output. This is what I was initially looking for. I believe that due to the PATH error, the DISPLAY variable won't get initialized in /etc/profile

hidenmind commented 5 years ago

About overriding my PATH I could not see anything in those files. My instalation is fresh and I did not make any changes in any system files.

In /etc/profile file there is the folowing code involving PATH:

IS_WSL=`grep -i microsoft /proc/version`
if test "$IS_WSL" = ""; then
  if [ "`id -u`" -eq 0 ]; then
    PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
  else
    PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
  fi
fi
export PATH

The code `grep -i microsoft /proc/version ` is returning a long string, then I assume that the PATH is not beeing changed in this file. In the ~/.bashrc file I could not find any references to PATH.

My output for $PATH command is:

-bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program: No such file or directory

Running env DISPLAY=:0 code did not work, I don't think the issue is the display because I am running another GUI applications without passing display parameters.

When I run code --verbose --log trace the following output is shown:

[33:0410/184228.124991:ERROR:bus.cc(394)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory [63:0410/184228.370036:ERROR:gl_implementation.cc(292)] Failed to load libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory [63:0410/184228.371619:ERROR:viz_main_impl.cc(195)] Exiting GPU process due to errors during initialization [33:0410/184228.372477:ERROR:service_manager_context.cc(258)] Attempting to run unsupported native service: /usr/share/code/content_gpu.service [71:0410/184228.583539: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 [71:0410/184228.585194:ERROR:viz_main_impl.cc(195)] Exiting GPU process due to errors during initialization [33:0410/184228.588120:ERROR:browser_gpu_channel_host_factory.cc(119)] Failed to launch GPU process.

crramirez commented 5 years ago

Ok, you have a problem with OpenGL run code as follows:

env -u LIBGL_ALWAYS_INDIRECT code

But this error is quite weird. What happens if you try running glxgears?

Your PATH is good, I don't understand why wslpath fails. Can you run wslpath from the prompt?

Regards

hidenmind commented 5 years ago

Code runned with env -u LIBGL_ALWAYS_INDIRECT code but nothing happens. The output for glxgears command is: -bash: glxgears: command not found The output for wslpath command is: -bash: wslpath: command not found

It seems that glxgears was not installed in my pengwin fresh install, after installing mesa-utils, a package that contains glxgear, the following output was shown:

X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 147 (GLX) Minor opcode of failed request: 3 (X_GLXCreateContext) Value in failed request: 0x0 Serial number of failed request: 23 Current serial number in output stream: 25

sirredbeard commented 5 years ago

Did you install the common GUI libraries in Pengwin-Setup?

I am unable to reproduce the issue.

20190411_120053157_iOS
hidenmind commented 5 years ago

Yes the GUI libs is installed, I can run other GUI applications such as nautilus and gvim, this issue is only in Code.

crramirez commented 5 years ago

Hello

After installing mesa-utils did you try again :

env -u LIBGL_ALWAYS_INDIRECT code

Also

env -u LIBGL_ALWAYS_INDIRECT glxgears

Regards

hidenmind commented 5 years ago

After installing mesa-utils env -u LIBGL_ALWAYS_INDIRECT glxgears runs ok, but code still not running.

There is a message that always appears when I start Pengwin, I think it might be part of the problem.

/usr/local/bin/cmd-exe: line 3: wslpath: command not found -bash: wslpath: command not found ln: failed to create symbolic link '/home/diego/winhome' -> '': No such file or directory

crramirez commented 5 years ago

I am thinking that you don't have wslpath because your Windows version is "Windows 10 - 1709 ". So, we need to think about how to solve it in this case.

About Code please run it like this to see if the error message have changed:

env -u LIBGL_ALWAYS_INDIRECT code --verbose --log trace

Regards

hidenmind commented 5 years ago

Issue resolved updating windows from 1709 to 1809.

sirredbeard commented 5 years ago

We will be moving minimum version to 1809 based on your feedback. Thank you.

naoey commented 5 years ago

I'm having the same issue and I'm already on 1809. I installed Pengwin today. glxgears is appearing fine, however code doesn't bring up anything. Doing a ps aux | grep code shows that the code process is actually running in the background but there is no window.

crramirez commented 5 years ago

Please install vscode again trough pengwin-setup --debug and send us the result. Also, install the package mesa-utils via apt, then run:

env -u LIBGL_ALWAYS_INDIRECT code --verbose --log trace

And send us the result

Regards

erikellsinger commented 5 years ago

I am on Windows 1809, fresh installation, and have the same issue.

Result from running pengwin-setup in debug:

Running in debug/verbose mode
++ shift
++ [[ 0 -gt 0 ]]
+++ cmd-exe /c 'echo %HOMEDRIVE%%HOMEPATH%'
+++ tr -d '\r'
++ readonly 'wHomeWinPath=C:\Users\erik'
++ wHomeWinPath='C:\Users\erik'
+++ wslpath -u 'C:\Users\erik'
++ readonly wHome=/mnt/c/Users/erik
++ wHome=/mnt/c/Users/erik
++ readonly CANCELLED=CANCELLED
++ CANCELLED=CANCELLED
++ SetupDir=/usr/local/pengwin-setup.d
++ readonly GOVERSION=1.12
++ GOVERSION=1.12
+ WelcomePrompt
+ whiptail --title 'Welcome to Pengwin' --msgbox 'Thank you for supporting sustainable independent open source development.\n
Pengwin comes with a core set of useful packages pre-installed, such as curl, git, and wslu.\n
pengwin-setup allows you to install additional hand-curated selections for Pengwin and configure optional WSL-specific settings. \n
Many more packages are available via the apt package manager and optional pip, npm, and RubyGems package managers.' 17 80
+ continue_prompt
+ confirm --title 'Continue setup?' --yesno 'Would you like to continue pengwin-setup?' 8 45
+ [[ ! -n '' ]]
+ whiptail --title 'Continue setup?' --yesno 'Would you like to continue pengwin-setup?' 8 45
+ return 0
+ echo 'Starting pengwin-setup.'
Starting pengwin-setup.
+ CheckUpgrades
+ echo 'Updating package database'
Updating package database
+ sudo apt-get update
[sudo] password for erik:
Hit:5 https://packages.microsoft.com/repos/vscode stable InRelease
Hit:1 https://cdn-aws.deb.debian.org/debian testing InRelease
Get:2 https://cdn-aws.deb.debian.org/debian testing-updates InRelease [46.8 kB]
Hit:3 https://cdn-aws.deb.debian.org/debian-security testing/updates InRelease
Hit:4 https://cdn-aws.deb.debian.org/debian unstable InRelease
Ign:6 https://cdn-aws.deb.debian.org/debian stable InRelease
Hit:8 https://cdn-aws.deb.debian.org/debian stable Release
Hit:7 https://packagecloud.io/whitewaterfoundry/pengwin-base/debian buster InRelease
Hit:9 https://packagecloud.io/whitewaterfoundry/pengwin-setup/debian buster InRelease
Hit:10 https://packagecloud.io/whitewaterfoundry/wslu/debian buster InRelease
Fetched 46.8 kB in 8s (6,159 B/s)
Reading package lists... Done
+ '[' -f /etc/apt/.dist-upgrade ']'
+ echo 'Running upgrade check...'
Running upgrade check...
++ sudo apt-get upgrade --show-upgraded --assume-no
++ grep pengwin
+ UPGRD_CHECK=
+ [[ '' == *\p\e\n\g\w\i\n* ]]
+ echo 'Holding pengwin-base & pengwin-setup to ensure no changes while operating'
Holding pengwin-base & pengwin-setup to ensure no changes while operating
+ sudo apt-mark hold pengwin-base pengwin-setup
+ install_menu --debug
++ menu --title pengwin-setup --checklist --separate-output '\nHand-curated add-ons [SPACE to select, ENTER to confirm]:' 15 99 6 EDITORS 'Install text editors neovim, emacs, or Visual Studio Code (requires X)    ' off MAINTENANCE 'Various maintenance tasks like home backup' off PROGRAMMING 'Install various programming languages support' off SETTINGS 'Change various settings in Pengwin' off SERVICES 'Enable services support (SSH, rc.local)' off TOOLS 'Install applications or servers' off
++ local menu_choice
+++ whiptail --title pengwin-setup --checklist --separate-output '\nHand-curated add-ons [SPACE to select, ENTER to confirm]:' 15 99 6 EDITORS 'Install text editors neovim, emacs, or Visual Studio Code (requires X)    ' off MAINTENANCE 'Various maintenance tasks like home backup' off PROGRAMMING 'Install various programming languages support' off SETTINGS 'Change various settings in Pengwin' off SERVICES 'Enable services support (SSH, rc.local)' off TOOLS 'Install applications or servers' off
++ menu_choice=EDITORS
++ local exit_status=0
++ [[ 0 != 0 ]]
++ [[ -z EDITORS ]]
++ echo EDITORS
+ local menu_choice=EDITORS
+ echo Selected: EDITORS
Selected: EDITORS
+ [[ EDITORS == \C\A\N\C\E\L\L\E\D ]]
+ local exit_status
+ [[ EDITORS == *\E\D\I\T\O\R\S* ]]
+ echo EDITORS
EDITORS
+ bash /usr/local/pengwin-setup.d/editors.sh --debug
Running in debug/verbose mode
++ shift
++ [[ 0 -gt 0 ]]
+++ cmd-exe /c 'echo %HOMEDRIVE%%HOMEPATH%'
+++ tr -d '\r'
++ readonly 'wHomeWinPath=C:\Users\erik'
++ wHomeWinPath='C:\Users\erik'
+++ wslpath -u 'C:\Users\erik'
++ readonly wHome=/mnt/c/Users/erik
++ wHome=/mnt/c/Users/erik
++ readonly CANCELLED=CANCELLED
++ CANCELLED=CANCELLED
++ SetupDir=/usr/local/pengwin-setup.d
++ readonly GOVERSION=1.12
++ GOVERSION=1.12
+ editor_menu --debug
++ menu --title 'Editor Menu' --checklist --separate-output 'Custom editors (nano and vi included)\n[SPACE to select, ENTER to confirm]:' 12 55 3 NEOVIM Neovim off EMACS Emacs off CODE 'Visual Studio Code (requires X)   ' off
++ local menu_choice
+++ whiptail --title 'Editor Menu' --checklist --separate-output 'Custom editors (nano and vi included)\n[SPACE to select, ENTER to confirm]:' 12 55 3 NEOVIM Neovim off EMACS Emacs off CODE 'Visual Studio Code (requires X)   ' off
++ menu_choice=CODE
++ local exit_status=0
++ [[ 0 != 0 ]]
++ [[ -z CODE ]]
++ echo CODE
+ local editor_choice=CODE
+ [[ CODE == \C\A\N\C\E\L\L\E\D ]]
+ [[ CODE == *\N\E\O\V\I\M* ]]
+ [[ CODE == *\E\M\A\C\S* ]]
+ [[ CODE == *\C\O\D\E* ]]
+ code_install
+ confirm --title CODE --yesno 'Would you like to download and install Code from Microsoft?' 8 65
+ [[ ! -n '' ]]
+ whiptail --title CODE --yesno 'Would you like to download and install Code from Microsoft?' 8 65
+ return 0
+ echo 'Installing CODE'
Installing CODE
+ createtmp
+ echo 'Saving current directory as $CURDIR'
Saving current directory as $CURDIR
++ pwd
+ CURDIR=/home/erik
++ mktemp -d
+ TMPDIR=/tmp/tmp.rLPzv0Cfsw
+ echo 'Going to $TMPDIR: /tmp/tmp.rLPzv0Cfsw'
Going to $TMPDIR: /tmp/tmp.rLPzv0Cfsw
+ cd /tmp/tmp.rLPzv0Cfsw
+ echo 'Downloading and unpacking Microsoft'\''s apt repo key with curl and gpg'
Downloading and unpacking Microsoft's apt repo key with curl and gpg
+ curl https://packages.microsoft.com/keys/microsoft.asc
+ gpg --dearmor
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   983  100   983    0     0   4488      0 --:--:-- --:--:-- --:--:--  4488
+ echo 'Moving Microsoft'\''s apt repo key into place with mv'
Moving Microsoft's apt repo key into place with mv
+ sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
+ echo 'Adding Microsoft apt repo to /etc/apt/sources.list.d/vscode.list with echo'
Adding Microsoft apt repo to /etc/apt/sources.list.d/vscode.list with echo
+ sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
+ cleantmp
+ echo 'Returning to /home/erik'
Returning to /home/erik
+ cd /home/erik
+ echo 'Cleaning up /tmp/tmp.rLPzv0Cfsw'
Cleaning up /tmp/tmp.rLPzv0Cfsw
+ sudo rm -r /tmp/tmp.rLPzv0Cfsw
+ echo 'deb https://deb.debian.org/debian stable main'
+ sudo tee /etc/apt/sources.list.d/stable.list
deb https://deb.debian.org/debian stable main
+ sudo apt-mark hold udev libudev1
udev was already set on hold.
libudev1 was already set on hold.
+ sudo apt-get update
Hit:1 https://packages.microsoft.com/repos/vscode stable InRelease
Hit:2 https://cdn-aws.deb.debian.org/debian testing InRelease
Hit:3 https://cdn-aws.deb.debian.org/debian testing-updates InRelease
Hit:5 https://cdn-aws.deb.debian.org/debian-security testing/updates InRelease
Hit:6 https://cdn-aws.deb.debian.org/debian unstable InRelease
Ign:7 https://cdn-aws.deb.debian.org/debian stable InRelease
Hit:4 https://packagecloud.io/whitewaterfoundry/pengwin-base/debian buster InRelease
Hit:8 https://cdn-aws.deb.debian.org/debian stable Release
Hit:9 https://packagecloud.io/whitewaterfoundry/pengwin-setup/debian buster InRelease
Hit:10 https://packagecloud.io/whitewaterfoundry/wslu/debian buster InRelease
Reading package lists... Done
+ sudo apt-get install -y -q --allow-downgrades --allow-change-held-packages -t stable udev=232-25+deb9u8 libudev1=232-25+deb9u8
Reading package lists...
Building dependency tree...
Reading state information...
E: Version '232-25+deb9u8' for 'udev' was not found
E: Version '232-25+deb9u8' for 'libudev1' was not found
+ sudo apt-mark hold udev libudev1
udev was already set on hold.
libudev1 was already set on hold.
+ echo 'Installing code with dependencies: $ sudo apt-get install -y -q code libxss1 libasound2 libx11-xcb-dev'
Installing code with dependencies: $ sudo apt-get install -y -q code libxss1 libasound2 libx11-xcb-dev
+ sudo apt-get install -y -q code libxss1 libasound2 libx11-xcb-dev
Reading package lists...
Building dependency tree...
Reading state information...
libasound2 is already the newest version (1.1.8-1).
libx11-xcb-dev is already the newest version (2:1.6.7-1).
libxss1 is already the newest version (1:1.2.3-1).
code is already the newest version (1.33.1-1554971066).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+ sudo apt-get install -y -q -t stable libssl1.0.2
Reading package lists...
Building dependency tree...
Reading state information...
libssl1.0.2 is already the newest version (1.0.2r-1~deb9u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+ exit_status=0
+ [[ EDITORS == *\M\A\I\N\T\E\N\A\N\C\E* ]]
+ [[ EDITORS == *\P\R\O\G\R\A\M\M\I\N\G* ]]
+ [[ EDITORS == *\S\E\T\T\I\N\G\S* ]]
+ [[ EDITORS == *\S\E\R\V\I\C\E\S* ]]
+ [[ EDITORS == *\T\O\O\L\S* ]]
+ [[ 0 != 0 ]]
+ echo 'Unholding pengwin-base & pengwin-setup'
Unholding pengwin-base & pengwin-setup
+ sudo apt-mark unhold pengwin-base pengwin-setup
+ ByeMessage
+ whiptail --title 'Setup is complete.' --msgbox 'You may run pengwin-setup again any time by typing $ pengwin-setup\n\nYou may open a browser link to get help any time by typing: $ pengwin-help' 8 80
+ exit 0

And result of: env -u LIBGL_ALWAYS_INDIRECT code --verbose --log trace

shared memfd open() failed: Function not implemented
crramirez commented 5 years ago

Hello @erikellsinger ,

Please do this:

UdevVersion="$(apt-cache madison udev | grep ' stable' | cut -d'|' -f2 | sed 's| ||g')"
Libudev1Version="$(apt-cache madison libudev1 | grep ' stable' | cut -d'|' -f2 | sed 's| ||g')"
sudo apt-get install -y -q --allow-downgrades --allow-change-held-packages -t stable udev=$UdevVersion libudev1=$Libudev1Version
sudo apt-mark hold udev libudev1

Regards

jvanderberg commented 5 years ago

Hello @erikellsinger ,

Please do this:

UdevVersion="$(apt-cache madison udev | grep ' stable' | cut -d'|' -f2 | sed 's| ||g')"
Libudev1Version="$(apt-cache madison libudev1 | grep ' stable' | cut -d'|' -f2 | sed 's| ||g')"
sudo apt-get install -y -q --allow-downgrades --allow-change-held-packages -t stable udev=$UdevVersion libudev1=$Libudev1Version
sudo apt-mark hold udev libudev1

Regards

This fixed the same issue for me.

erikellsinger commented 5 years ago

Yes that solved it, thanks!