Giter VIP home page Giter VIP logo

Comments (26)

mviereck avatar mviereck commented on July 18, 2024 2

Ok, likely I found the issue:
WSL1 mounts the Windows partitions in e.g. /mnt/c. But WSL2 mounts them in /c.
Of course runx could not find /mnt/c/Program\ Files/VcXsrv/vcxsrv.exe because it does not exist in WSL2.

I've uploaded a fixed version. Hopefully I did not introduce any syntax error.
Please update and try again.

from runx.

Jawabiscuit avatar Jawabiscuit commented on July 18, 2024 1

from runx.

Jawabiscuit avatar Jawabiscuit commented on July 18, 2024 1

I had time to try out runx --vcxsrv -- emacs and run --gpu --xwin -- emacs and they both work. I'm going to try x11docker later now that I got this working.

I couldn't get this Emacs docker image to display a GUI with just runx even though a GUI will display if I run vcxsrv before hand.

from runx.

eine avatar eine commented on July 18, 2024

Running other GUI programs: startlxde or emacs work without using runx.

Do you mean after executing vcxsrv or xwin manually? Or is built-in X support available in WSL2?

from runx.

mviereck avatar mviereck commented on July 18, 2024

Thank you for the report!

So far I have no experience with WSL2.
Unfortunately I cannot test it myself because I have Windows in a VM only. Hyper-V is needed for WSL2 and does not work in the VM. So I depend on some information of you.


Probably runx would work in WSL2 if it could recognice it. Do you know how a linux program can detect WSL2?
WSL is checked with uname -r:

  uname -r | grep -q Microsoft                    && Winsubsystem="WSL"

Could you show me uname -a in WSL2?


Is the WSL2 file system accessible in Windows? E.g. somewhere visible in the file explorer? (WSL1 is somewhat hidden, but detectable). If not, runx could not provide cookie authentication and would run with --no-auth only.
With some luck the same trickery as for WSL1 will work in WSL2, too.


Are the Windows partitions still mounted as /c or /d like in WSL1?


Running other GUI programs: startlxde or emacs work without using runx.

That is quite interesting. Did you do some setup for this? If not, can you please show me the output of:

echo $DISPLAY
echo $XAUTHORITY
ls -l /tmp/.X11-unix
ps aux | grep X

from runx.

Jawabiscuit avatar Jawabiscuit commented on July 18, 2024

My pleasure, happy to help!

Running other GUI programs: startlxde or emacs work without using runx.

Do you mean after executing vcxsrv or xwin manually? Or is built-in X support available in WSL2?

Yes

uname -r | grep -q Microsoft && Winsubsystem="WSL"

That works

Are the Windows partitions still mounted as /c or /d like in WSL1?

Yes

That is quite interesting. Did you do some setup for this? If not, can you please show me the output of:

This is how I need to set the display on WSL2 for it to work:
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0

172.26.64.1:0

There is essentially no output for any of the other commands.

My wsl.conf:

[automount]
enabled = true
mountFsTab = true
root = /
options = "metadata"

# Enable DNS  even though these are turned on by default, we ll specify here just to be explicit.     [network]
# Generate /etc/hosts, a static map of hostnames and their IP addresses
generateHosts = true
# Generate /etc/resolve.conf, to resolve hostname to its IP address
generateResolvConf = true

# [interop]
# Setting this key will determine whether WSL will suport launching Windows processes
# enabled = true
# WSL will add Windows path elements to the $PATH environment variable
# appendWindowsPath = true

Windows cmd.exe command I used to launch vcxsrv, the -ac is important to allow public connections with WSL2.

"C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -clipboard -wgl -ac

from runx.

eine avatar eine commented on July 18, 2024

Do you mean after executing vcxsrv or xwin manually? Or is built-in X support available in WSL2?

Yes

Is that an answer to the first question or the second?

from runx.

mviereck avatar mviereck commented on July 18, 2024

My pleasure, happy to help!

Great!

uname -r | grep -q Microsoft && Winsubsystem="WSL"

That works

That's odd. In that case WSL would be detected and the reported error message should not appear:

runx ERROR: runx is designed to run on MS Windows in WSL, Cygwin or MSYS2.
Did not detect WSL, Cygwin or MSYS2.

Could you please show me the output of:

uname -a

?

from runx.

Jawabiscuit avatar Jawabiscuit commented on July 18, 2024

Linux vrexton 4.19.84-microsoft-standard #1 SMP Wed Nov 13 11:44:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

from runx.

mviereck avatar mviereck commented on July 18, 2024

Thanks. Ok, WSL2 shows microsoft while WSL1 shows Microsoft.
I've uploaded a new commit that detects both variations.
Could you please update and check again?
If it fails, please also try with --no-auth.

from runx.

Jawabiscuit avatar Jawabiscuit commented on July 18, 2024
jonas@vrexton:~/runx$ runx --verbose --no-auth -- emacs
runx note: Script is being sourced yes/no: no

runx note: Host IP adress: 10.0.75.1

runx note: Found X servers:



runx ERROR: No X server found.
  Please either install X server VcXsrv:
      https://sourceforge.net/projects/vcxsrv
  or install Cygwin with packages xinit and xauth to provide XWin:
      https://www.cygwin.com/

runx note: Exitcode: 1

runx note: Exitcode: 0

jonas@vrexton:~/runx$ cat /etc/resolv.conf | grep nameserver | awk '{print $2}'
172.26.64.1

jonas@vrexton:~/runx$ ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        inet6 fe80::42:4dff:fef2:b816  prefixlen 64  scopeid 0x20<link>
        ether 02:42:4d:f2:b8:16  txqueuelen 0  (Ethernet)
        RX packets 6850  bytes 4154356 (4.1 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8574  bytes 3947181 (3.9 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.26.67.7  netmask 255.255.240.0  broadcast 172.26.79.255
        inet6 fe80::215:5dff:fe76:6f0a  prefixlen 64  scopeid 0x20<link>
        ether 00:15:5d:76:6f:0a  txqueuelen 1000  (Ethernet)
        RX packets 517666  bytes 717716770 (717.7 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 127350  bytes 20612603 (20.6 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 6  bytes 300 (300.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6  bytes 300 (300.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

You are using ipconfig.exe, maybe check that?

from runx.

mviereck avatar mviereck commented on July 18, 2024

It seems runx does not detect vcxsrv.exe.
Can you show me:

echo $PATH
ls -l /c
ls -l "/c/Program Files/VcXsrv/vcxsrv.exe"
ls -l "/c/Program\ Files/VcXsrv/vcxsrv.exe"

How/Where did you install VcXsrv?
Is it somewhere different than ls -l "C:/Program Files/VcXsrv/vcxsrv.exe"?

You are using ipconfig.exe, maybe check that?

runx/ipconfig.exe found the IP of the Windows docker daemon 10.0.75.1. That should be ok.

from runx.

Jawabiscuit avatar Jawabiscuit commented on July 18, 2024
jonas@vrexton:/c/Users/Jonas$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/c/ProgramData/DockerDesktop/version-bin:/c/Program Files/Docker/Docker/resources/bin:/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0/bin:/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0/libnvvp:/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.1/bin:/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.1/libnvvp:/c/Windows:/c/Windows/System32:/c/Windows/System32/wbem:/c/Windows:/c/Windows/System32:/c/Windows/System32/wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/c/Program Files/Microsoft MPI/Bin/:/c/ProgramData/Oracle/Java/javapath:/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/c/Program Files/MATLAB/R2016b/bin:/c/Program Files/Geth:/c/Program Files/dotnet/:/c/Program Files/Microsoft SQL Server/130/Tools/Binn/:/c/Program Files/PostgreSQL/10/bin:/c/Program Files (x86)/GnuPG/bin:/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit/:/c/Program Files/nodejs/:/c/Program Files (x86)/Yarn/bin:/c/Users/Jonas/Anaconda3:/c/Users/Jonas/Anaconda3/Scripts:/c/cudnn-9.0-windows10-x64-v7/cuda/bin:/c/Program Files (x86)/Calibre2/:/c/Program Files/Git/cmd:/c/Program Files/MiKTeX 2.9/miktex/bin/x64/:/c/Program Files/apache-ant-1.10.5/bin:/c/Program Files (x86)/Pico Technology/PicoScope6/:/c/Program Files/Git LFS:/c/Windows/System32/OpenSSH/:/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/c/Windows/System32:/c/Windows:/c/Windows/System32/wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/c/Windows/System32/OpenSSH/:/c/Users/Jonas/AppData/Local/Microsoft/WindowsApps:/c/Users/Jonas/AppData/Roaming/npm:/c/Users/Jonas/AppData/Local/Yarn/bin:/c/Users/Jonas/AppData/Local/Pandoc/:/snap/bin
jonas@vrexton:/c/Users/Jonas$ ls -l /c
ls: /c/DumpStack.log: Permission denied
ls: cannot access '/c/DumpStack.log.tmp': Permission denied
ls: cannot access '/c/hiberfil.sys': Permission denied
ls: cannot access '/c/pagefile.sys': Permission denied
ls: cannot access '/c/swapfile.sys': Permission denied
ls: '/c/System Volume Information': Permission denied
total 396
drwxrwxrwx 1 jonas jonas    512 Apr  1  2018  82ace7d6-0197-474d-bf4b-a2043e72329b
drwxrwxrwx 1 jonas jonas    512 Jul  5  2018  Autodesk
drwxrwxrwx 1 jonas jonas    512 Mar 31  2019  blur
-r-xr-xr-x 1 jonas jonas 384322 Jul 16  2016  bootmgr
-r-xr-xr-x 1 jonas jonas      1 Jul 16  2016  BOOTNXT
-rwxrwxrwx 1 jonas jonas     80 Sep 30 08:58  bootTel.dat
drwxrwxrwx 1 jonas jonas    512 Nov 25 21:06  cygwin64
drwxrwxrwx 1 jonas jonas    512 Nov 18  2018  Desktop
lrwxrwxrwx 1 jonas jonas      8 Nov 26  2016 'Documents and Settings' -> /c/Users
---------- 1 jonas jonas   8192 Jan  5 16:40  DumpStack.log
-????????? ? ?     ?          ?            ?  DumpStack.log.tmp
drwxrwxrwx 1 jonas jonas    512 Nov 27  2016  eclipse
drwxrwxrwx 1 jonas jonas    512 Jan  5 12:09  ESD
drwxrwxrwx 1 jonas jonas    512 Nov 18  2018  Fortnite
drwxrwxrwx 1 jonas jonas    512 Feb 22  2018 '$GetCurrent'
-r-xr-xr-x 1 jonas jonas   4214 Sep  5  2017  git-flow
-????????? ? ?     ?          ?            ?  hiberfil.sys
drwxrwxrwx 1 jonas jonas    512 Nov 27  2016  Intel
-r-xr-xr-x 1 jonas jonas   1031 Nov 20  2017  ipaddresses.txt
drwxrwxrwx 1 jonas jonas    512 Jun  4  2018  Microsoft
drwxrwxrwx 1 jonas jonas    512 Mar 31  2018  MongoDB
drwxrwxrwx 1 jonas jonas    512 Jan  5 09:55 'NVIDIA Corporation'
drwxrwxrwx 1 jonas jonas    512 Feb 17  2017  Octave
-????????? ? ?     ?          ?            ?  pagefile.sys
drwxrwxrwx 1 jonas jonas    512 Nov 27 03:34  PerfLogs
drwxrwxrwx 1 jonas jonas    512 Jan  5 17:53  ProgramData
dr-xr-xr-x 1 jonas jonas    512 Jan  5 18:21 'Program Files'
dr-xr-xr-x 1 jonas jonas    512 Jan  5 18:21 'Program Files (x86)'
drwxrwxrwx 1 jonas jonas    512 Jan 16  2019  qt_win_release_intel64_v140_shared
dr-xr-xr-x 1 jonas jonas    512 Jan  5 15:22  Recovery
drwxrwxrwx 1 jonas jonas    512 Mar 12  2018 '$Recycle.Bin'
drwxrwxrwx 1 jonas jonas    512 Jun 28  2017  solidangle
-????????? ? ?     ?          ?            ?  swapfile.sys
dr-xr-xr-x 1 jonas jonas    512 Nov 26  2016 '$SysReset'
d--x--x--x 1 jonas jonas    512 Jan  7 21:20 'System Volume Information'
drwxrwxrwx 1 jonas jonas    512 Apr 28  2018 'Telegram Desktop'
drwxrwxrwx 1 jonas jonas    512 Apr 30  2018  tmp
drwxrwxrwx 1 jonas jonas    512 Mar  9  2017 'Tor Browser'
dr-xr-xr-x 1 jonas jonas    512 Jan  5 15:23  Users
drwxrwxrwx 1 jonas jonas    512 Oct  4  2017  wamp
dr-xr-xr-x 1 jonas jonas    512 Jan  5 16:00  Windows
dr-xr-xr-x 1 jonas jonas    512 Feb 22  2018  Windows10Upgrade
drwxrwxrwx 1 jonas jonas    512 Jan  5 15:30  Windows.old
-r-xr-xr-x 1 jonas jonas     34 Jun 20  2017  windows-version.txt
dr-xr-xr-x 1 jonas jonas    512 Jan  5 12:04 '$Windows.~WS'
drwxrwxrwx 1 jonas jonas    512 Mar 15  2017  ZeroNet
jonas@vrexton:/c/Users/Jonas$ ls -l "/c/Program Files/VcXsrv/vcxsrv.exe"
-r-xr-xr-x 1 jonas jonas 3644928 Jul 27 11:21 '/c/Program Files/VcXsrv/vcxsrv.exe'
jonas@vrexton:/c/Users/Jonas$ ls -l "/c/Program\ Files/VcXsrv/vcxsrv.exe"
ls: cannot access '/c/Program\ Files/VcXsrv/vcxsrv.exe': No such file or directory

from runx.

Jawabiscuit avatar Jawabiscuit commented on July 18, 2024

It seems runx does not detect vcxsrv.exe.
Can you show me:

echo $PATH
ls -l /c
ls -l "/c/Program Files/VcXsrv/vcxsrv.exe"
ls -l "/c/Program\ Files/VcXsrv/vcxsrv.exe"

How/Where did you install VcXsrv?
Is it somewhere different than ls -l "C:/Program Files/VcXsrv/vcxsrv.exe"?

You are using ipconfig.exe, maybe check that?

runx/ipconfig.exe found the IP of the Windows docker daemon 10.0.75.1. That should be ok.

Oh, I'm not running windows docker daemon! You don't need to with WSL2.

jonas@vrexton:/c/Users/Jonas$ docker version
Client: Docker Engine - Community
 Version:           19.03.5
 API version:       1.40
 Go version:        go1.12.12
 Git commit:        633a0ea838
 Built:             Wed Nov 13 07:29:52 2019
 OS/Arch:           linux/amd64
 Experimental:      false

from runx.

Jawabiscuit avatar Jawabiscuit commented on July 18, 2024
jonas@vrexton:/c/Users/Jonas$ docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

from runx.

mviereck avatar mviereck commented on July 18, 2024

Oh, I'm not running windows docker daemon! You don't need to with WSL2.

ok, cool. Than that works indeed. I'll have to implement support for this in x11docker.

jonas@vrexton:/c/Users/Jonas$ ls -l "/c/Program Files/VcXsrv/vcxsrv.exe"
-r-xr-xr-x 1 jonas jonas 3644928 Jul 27 11:21 '/c/Program Files/VcXsrv/vcxsrv.exe'

It is odd that runx does not detect VcXsrv. Can you please check:

command -v "/c/Program Files/VcXsrv/vcxsrv.exe"

Can you directly execute:

/c/Program\ Files/VcXsrv/vcxsrv.exe

from runx.

Jawabiscuit avatar Jawabiscuit commented on July 18, 2024

Yes, I would like to use x11docker too.

jonas@vrexton:/c/Users/Jonas$ command -v "/c/Program Files/VcXsrv/vcxsrv.exe"

/c/Program Files/VcXsrv/vcxsrv.exe

I can execute /c/Program\ Files/VcXsrv/vcxsrv.exe

from runx.

mviereck avatar mviereck commented on July 18, 2024

I am entirely confused why runx has an issue to detect vcxsrv.exe. Everything looks right.
Can you please run bash -x runx? That will give a lot of output. You can catch it in a file with:

runx >runx.log 2>&1

from runx.

Jawabiscuit avatar Jawabiscuit commented on July 18, 2024
jonas@vrexton:/c/Users/Jonas$ bash -x runx
+ Version=v0.2.8
+ trap finish EXIT
+ declare_variables
+ Desktopmode=no
+ Screensize=
+ Shareclipboard=yes
+ Sharegpu=no
+ Verbose=no
+ Xauthentication=yes
++ printf '\033'
+ Esc=$'\E'
+ Colblue=''
+ Colyellow=''
+ Colgreen=''
+ Colgreenbg=''
+ Colred=''
+ Colredbg=''
+ Coluline=''
+ Colnorm=''
+ Exitcode=
+ Hostip=
+ Newdisplaynumber=
+ Sourced=
+ Vcxsrvexe=
+ Xserverwinpid=
+ Winsubmount=
+ Winsubpath=
+ Xcommand=
+ Xready=
+ Xserver=
+ Xserverexe=
+ Xserverpid=
+ Xwinexe=
+ parse_options
+ local Shortoptions Longoptions Parsererror
+ Shortoptions=dghv
+ Longoptions=cleanup,clipboard::,desktop,display:,gpu,help,no-auth,size:,vcxsrv,verbose,version,xwin ++ getopt --options dghv --longoptions cleanup,clipboard::,desktop,display:,gpu,help,no-auth,size:,vcxsrv,verbose,version,xwin --name runx --
+ Parsedoptions=' --'
+ '[' -e /tmp/runx_parsererror ']'
++ cat /tmp/runx_parsererror
+ Parsererror=
+ rm /tmp/runx_parsererror
+ '[' '' ']'
+ eval set -- ' --'
++ set -- --
+ verbose ' --'
+ '[' no = yes ']'
+ return 0
+ '[' 1 -gt 0 ']'
+ case "${1:-}" in
+ shift
+ Hostcommand=
+ break
+ check_host
+ command -v cygcheck.exe
+ uname -r
+ grep -q -i Microsoft
+ Winsubsystem=WSL
+ '[' runx = /usr/local/bin/runx ']'
+ Sourced=yes
+ verbose 'Script is being sourced yes/no: yes'
+ '[' no = yes ']'
+ return 0
+ case $Winsubsystem in
+ Winsubmount=/mnt
+ grep -q Windows
+++ getwslpath
+++ local RUN_ID= BASE_PATH=
++++ mcookie
+++ RUN_ID=/tmp/f593795d4b1b5a25b8be1c713aa9dc06
+++ touch /tmp/f593795d4b1b5a25b8be1c713aa9dc06
+++ powershell.exe -Command '(Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | ForEach-Object {Get-ItemProperty $_.PSPath}).BasePath.replace(":", "").replace("\", "/")'
+++ IFS=
+++ read -r BASEPATH
+++ BASEPATH=C/Users/Jonas/AppData/Local/Packages/CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc/LocalState
+++ BASEPATH=/mnt/c/Users/Jonas/AppData/Local/Packages/CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc/LocalState/rootfs
+++ ls /mnt/c/Users/Jonas/AppData/Local/Packages/CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc/LocalState/rootfs
+++ echo /mnt/c/Users/Jonas/AppData/Local/Packages/CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc/LocalState/rootfs
+++ break
+++ rm /tmp/f593795d4b1b5a25b8be1c713aa9dc06
+++ return 0
++ convertpath --unix /mnt/c/Users/Jonas/AppData/Local/Packages/CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc/LocalState/rootfs
++ local Mode= Path= Drive= Readwritemode=
++ Mode=--unix
++ Path=/mnt/c/Users/Jonas/AppData/Local/Packages/CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc/LocalState/rootfs
+++ echo /mnt/c/Users/Jonas/AppData/Local/Packages/CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc/LocalState/rootfs
+++ rev
+++ cut -c1-3
+++ rev
++ Readwritemode=tfs
+++ cut -c1
++ '[' t = : ']'
++ Readwritemode=:rw
+++ sed s%~%/home/jonas%
++ Path=/mnt/c/Users/Jonas/AppData/Local/Packages/CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc/LocalState/rootfs
++ '[' -z WSL ']'
+++ tr '\\' /
++ Path=/mnt/c/Users/Jonas/AppData/Local/Packages/CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc/LocalState/rootfs
++ Path=/c/Users/Jonas/AppData/Local/Packages/CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc/LocalState/rootfs
+++ cut -c1,3
++ '[' // = // ']'
+++ cut -c2
++ Drive=c
+++ cut -c3-
++ Path=/Users/Jonas/AppData/Local/Packages/CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc/LocalState/rootfs
+++ cut -c2
++ '[' U = : ']'
++ Drive=c
++ '[' WSL = WSL ']'
++ '[' -z c ']'
++ case $Drive in
++ case $Mode in
++ echo /c/Users/Jonas/AppData/Local/Packages/CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc/LocalState/rootfs
++ return 0
+ Winsubpath=/c/Users/Jonas/AppData/Local/Packages/CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc/LocalState/rootfs
++ ipconfig.exe
++ rmcr
++ case "${1:-}" in
++ grep -A6 DockerNAT
++ grep IPv4
+++ printf '\r'
++ rev
++ sed $'s/\r//g'
++ cut '-d ' -f1
++ rev
+ Hostip=10.0.75.1
+ '[' 10.0.75.1 ']'
+ '[' 10.0.75.1 ']'
+ verbose 'Host IP adress: 10.0.75.1'
+ '[' no = yes ']'
+ return 0
+ return 0
+ check_dependencies
+ local Line
+ case "$Winsubsystem" in
+ '[' WSL = MSYS2 ']'
+ '[' yes = yes ']'
+ check_dependency xauth
+ '[' xauth ']'
+ command -v xauth
+ return 0
++ command -v vcxsrv.exe
+ Vcxsrvexe=
+ '[' '' ']'
+++ convertpath --subsystem 'C:/Program Files/VcXsrv/vcxsrv.exe'
+++ local Mode= Path= Drive= Readwritemode=
+++ Mode=--subsystem
+++ Path='C:/Program Files/VcXsrv/vcxsrv.exe'
++++ echo 'C:/Program Files/VcXsrv/vcxsrv.exe'
++++ rev
++++ cut -c1-3
++++ rev
+++ Readwritemode=exe
++++ cut -c1
+++ '[' e = : ']'
+++ Readwritemode=:rw
++++ sed s%~%/home/jonas%
+++ Path='C:/Program Files/VcXsrv/vcxsrv.exe'
+++ '[' -z WSL ']'
++++ tr '\\' /
+++ Path='C:/Program Files/VcXsrv/vcxsrv.exe'
+++ Path='C:/Program Files/VcXsrv/vcxsrv.exe'
++++ cut -c1,3
+++ '[' C/ = // ']'
++++ cut -c2
+++ '[' : = : ']'
++++ cut -c1
+++ Drive=C
++++ cut -c3-
+++ Path='/Program Files/VcXsrv/vcxsrv.exe'
+++ Drive=c
+++ '[' WSL = WSL ']'
+++ '[' -z c ']'
+++ case $Drive in
+++ case $Mode in
+++ echo '/mnt/c/Program Files/VcXsrv/vcxsrv.exe'
+++ return 0
++ command -v '/mnt/c/Program Files/VcXsrv/vcxsrv.exe'
+ Vcxsrvexe=
++ command -v XWin
+ Xwinexe=
+ '[' -z '' ']'
+ '[' WSL = WSL ']'
+ for Drive in /mnt/*
++ command -v /mnt/c/cygwin64/bin/XWin.exe
+ Xwinexe=
+ '[' '' ']'
++ command -v /mnt/c/cygwin32/bin/XWin.exe
+ Xwinexe=
+ '[' '' ']'
+ for Drive in /mnt/*
++ command -v /mnt/q/cygwin64/bin/XWin.exe
+ Xwinexe=
+ '[' '' ']'
++ command -v /mnt/q/cygwin32/bin/XWin.exe
+ Xwinexe=
+ '[' '' ']'
+ for Drive in /mnt/*
++ command -v /mnt/s/cygwin64/bin/XWin.exe
+ Xwinexe=
+ '[' '' ']'
++ command -v /mnt/s/cygwin32/bin/XWin.exe
+ Xwinexe=
+ '[' '' ']'
+ for Drive in /mnt/*
++ command -v /mnt/wsl/cygwin64/bin/XWin.exe
+ Xwinexe=
+ '[' '' ']'
++ command -v /mnt/wsl/cygwin32/bin/XWin.exe
+ Xwinexe=
+ '[' '' ']'
+ verbose 'Found X servers:

  '
+ '[' no = yes ']'
+ return 0
+ '[' -z '' ']'
+ '[' -n '' ']'
+ '[' -z '' ']'
+ Xserver=vcxsrv
+ '[' WSL = MSYS2 ']'
+ case "$Xserver" in
+ Xserverexe=
+ '[' -z '' ']'
+ case $Winsubsystem in
+ error 'No X server found.
  Please either install X server VcXsrv:
      https://sourceforge.net/projects/vcxsrv
  or install Cygwin with packages xinit and xauth to provide XWin:
      https://www.cygwin.com/'
+ echo -e 'runx ERROR: No X server found.
  Please either install X server VcXsrv:
      https://sourceforge.net/projects/vcxsrv
  or install Cygwin with packages xinit and xauth to provide XWin:
      https://www.cygwin.com/
'
runx ERROR: No X server found.
  Please either install X server VcXsrv:
      https://sourceforge.net/projects/vcxsrv
  or install Cygwin with packages xinit and xauth to provide XWin:
      https://www.cygwin.com/

+ Exitcode=1
+ return 0
+ for Line in cmd.exe ipconfig.exe powershell.exe tasklist.exe taskkill.exe
+ check_dependency cmd.exe
+ '[' cmd.exe ']'
+ command -v cmd.exe
+ return 0
+ for Line in cmd.exe ipconfig.exe powershell.exe tasklist.exe taskkill.exe
+ check_dependency ipconfig.exe
+ '[' ipconfig.exe ']'
+ command -v ipconfig.exe
+ return 0
+ for Line in cmd.exe ipconfig.exe powershell.exe tasklist.exe taskkill.exe
+ check_dependency powershell.exe
+ '[' powershell.exe ']'
+ command -v powershell.exe
+ return 0
+ for Line in cmd.exe ipconfig.exe powershell.exe tasklist.exe taskkill.exe
+ check_dependency tasklist.exe
+ '[' tasklist.exe ']'
+ command -v tasklist.exe
+ return 0
+ for Line in cmd.exe ipconfig.exe powershell.exe tasklist.exe taskkill.exe
+ check_dependency taskkill.exe
+ '[' taskkill.exe ']'
+ command -v taskkill.exe
+ return 0
+ '[' '' = yes ']'
+ '[' -z 1 ']'
+ finish 1
+ verbose 'Exitcode: 1'
+ '[' no = yes ']'
+ return 0
+ case "$Sourced" in
+ unset -f usage finish
+ unset -f error warning note verbose
+ unset -f rmcr getwslpath escapestring convertpath
+ unset -f check_host check_dependency check_dependencies setup_cookie generate_xcommand
+ unset -f cleanup
+ unset -f declare_variables parse_options main
+ unset Desktopmode Screensize Shareclipboard Sharegpu Verbose Xauthentication
+ unset Esc Colblue Colyellow Colgreen Colgreenbg Colred Colredbg Coluline Colnorm
+ unset Exitcode Hostip Newdisplaynumber Sourced Vcxsrvexe Xserverwinpid Winsubmount Winsubpath Xcommand Xready Xserver Xserverexe Xserverpid Xwinexe
+ finish
/usr/local/bin/runx: line 1: finish: command not found

from runx.

mviereck avatar mviereck commented on July 18, 2024

Does runx work now?

I've adjusted x11docker, too. Could you please check it, too? If it fails, please run it with --debug and open a ticket at x11docker.

from runx.

mviereck avatar mviereck commented on July 18, 2024

I had time to try out runx --vcxsrv -- emacs and run --gpu --xwin -- emacs and they both work.

Great!

I couldn't get this Emacs docker image to display a GUI with just runx even though a GUI will display if I run vcxsrv before hand.

The command example of this emacs image only regards DISPLAY, but not XAUTHORITY. It will likely work if you either run runx --no-auth or run xhost+SI:localuser:$USER after runx.

from runx.

mviereck avatar mviereck commented on July 18, 2024

I've opened a WSL2 ticket at x11docker: mviereck/x11docker#214

@eine: Could you please try out, too? Some checks in x11docker have been changed that also affect MSYS2/Cygwin/WSL1. I hope I did not break anything. Ideally you should not note any difference. If it works well in one of them, the others should be ok, too, so one check would be enough.

from runx.

eine avatar eine commented on July 18, 2024

Hi @mviereck! I just pulled latest master of runx and x11docker. As you expected, nothing seems to have changed on MSYS2. The following command works: /t/runx/runx --no-auth -- /t/x11docker/x11docker --user=0 -i ghdl/ext bash. Unfortunately, that seems not to be true on Cygwin or WSL1:

$ /cygdrive/t/x11docker/x11docker --user=0 -i ghdl/ext bash
x11docker note: Using X server option --xwin

x11docker note: Windows firewall settings can forbid application access
  to the X server. If no application window appears, but no obvious error
  is shown, please check your firewall settings. Compare issue #108 on github.

x11docker note: Option --user=root: Enabling option --sudouser.

x11docker WARNING: Option --sudouser severly reduces container security.
  Container gains additional capabilities to allow sudo and su.
  If an application breaks out of container, it can harm your system
  in many ways without you noticing. Password: x11docker

x11docker note: Option --sudouser: Enabling option --newprivileges=yes.
  You can avoid this with --newprivileges=no

x11docker WARNING: Option --newprivileges=yes: x11docker does not set
  docker run option --security-opt=no-new-privileges.
  That degrades container security.
  However, this is still within a default docker setup.


x11docker ERROR: waitforlogentry(): dockerrc: Timeout waiting for entry "xinitrc is ready" in xinit.log
  Last lines of xinit.log:
winPointerWarpCursor - Discarding first warp: 1920 1080
(--) 5 mouse buttons found
(--) Setting autorepeat to delay=500, rate=31
(--) Windows keyboard layout: "0000040A" (0000040a) "Spanish", type 4
(--) Found matching XKB configuration "Spanish (Spain,Traditional Sort)"
(--) Model = "pc105" Layout = "es" Variant = "none" Options = "none"
Rules = "base" Model = "pc105" Layout = "es" Variant = "none" Options = "none"
winInitMultiWindowWM - DISPLAY=:2188.0
winMultiWindowXMsgProc - DISPLAY=:2188.0
winProcEstablishConnection - Clipboard is not enabled, returning.

  Type 'x11docker --help' for usage information
  Debug options: '--verbose' (full log) or '--debug' (log excerpt).
  Logfile will be: /home/eine/.cache/x11docker/x11docker.log
  Please report issues at https://github.com/mviereck/x11docker

Hitting Ctrl+C is ignored. I need to close the terminal window. Moreover, the X server seems not to be closed. I need to do it manually from the task manager.

$ /mnt/t/runx/runx --no-auth -- /mnt/t/x11docker/x11docker --user=0 -i ghdl/ext bash
runx note: Using random X display number :1623.
  If this display number is already in use, X server startup  will fail.
  You can specify a display number N with option '--display N'.

runx note: Windows firewall settings can forbid application access
  to the X server. If no application window appears, but no obvious error
  is shown, please check your firewall settings.
  Compare:   https://github.com/mviereck/x11docker/issues/108

runx WARNING: Option --no-auth: Cookie authentication is disabled!
      SECURITY RISC!
  Your X server xwin listens on TCP connections without any protection.
  Others could try to access your system through network connections.
  Please use option --no-auth for debugging only.

DISPLAY=10.0.75.1:1623

x11docker ERROR: Cache root folder must not contain whitespaces.
  '//wsl$/Debian/home/eine'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
C:/Users/eine/x11docker/cache

  Type 'x11docker --help' for usage information
  Debug options: '--verbose' (full log) or '--debug' (log excerpt).
  Logfile will be:
  Please report issues at https://github.com/mviereck/x11docker

SUCCESS: The process with PID 18716 has been terminated.

In this case, the process is terminated alone and the X server is closed.

Let me know if this makes any sense to you. I'll get a full debug log otherwise.

from runx.

mviereck avatar mviereck commented on July 18, 2024

@eine Thank you for the tests!
It seems that runx works so far but I've introduced issues in x11docker.
Could you please open two tickets at x11docker, one for Cygwin and one for WSL1?
Both with a logfile attached.

Note that -i, --interactive is not supported in Cygwin and WSL because winpty is needed. I am surprised that x11docker does not give a note. The check in x11docker is:

      [ "$Winsubsystem" ] && {
        Winpty="$(command -v winpty)"
        Winpty="$(escapestring "$Winpty")"
        [ "$Winpty" ] || {
          note "Option -i, --interactive: On MS Windows you need 'winpty'
  to run x11docker in interactive mode. MSYS2 provides winpty as a package.
  On Cygwin it can be compiled from source. WSL isn't supported yet.
  Fallback: disabling option --interactive."
          Interactive="no"
        }
      }

Do you have winpty in Cygwin or WSL?
Please run your tests without -i for now.

from runx.

eine avatar eine commented on July 18, 2024

Do you have winpty in Cygwin or WSL?
Please run your tests without -i for now.

Done. No, I don't have winpty in any of Cygwin or WSL1. It is only available in MSYS2.

from runx.

mviereck avatar mviereck commented on July 18, 2024

I assume that runx works in all setups now.

from runx.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.