mviereck / x11docker

Run GUI applications and desktops in docker and podman containers. Focus on security.
MIT License
5.63k stars 378 forks source link

[WSL1] Cache root folder must not contain whitespaces #216

Closed eine closed 4 years ago

eine commented 4 years ago

Coming form mviereck/runx#2

 /mnt/t/runx/runx -- /mnt/t/x11docker/x11docker --debug x11docker/xfce xfce4-terminal
runx note: Using random X display number :262.
  If this display number is already in use, X server startup  will fail.
  You can specify a display number N with option '--display N'.

'\\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.
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 note: If you get application error messages like 'Cannot open display'
  or 'Invalid MIT-MAGIC-COOKIE', the X authentication cookie might be broken.
  You can remove old cookies and stop running X servers with: runx --cleanup

DISPLAY=10.0.75.1:262 XAUTHORITY=/home/eine/runx_Xauthority
DEBUGNOTE[18:49:55,211]: check_host(): ps can watch root processes: yes
DEBUGNOTE[18:49:55,375]: traperror: Command at Line 6147 returned with error code 1:
  logname 2> /dev/null
  8203 - ::check_hostuser::main::main
DEBUGNOTE[18:49:55,401]: time to say goodbye (traperror)
DEBUGNOTE[18:49:55,431]: traperror: Command at Line 6147 returned with error code 1:
  Lognameuser="$(logname 2>/dev/null)"
  8203 - ::check_hostuser::main::main
DEBUGNOTE[18:49:55,457]: time to say goodbye (traperror)

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

DEBUGNOTE[18:49:55,848]: time to say goodbye (error)
DEBUGNOTE[18:49:55,894]: traperror: Command at Line 432 returned with error code 1:
  [ -e "$Timetosaygoodbyefifo" ]
  7064 - ::error::create_cachefiles::main::main
DEBUGNOTE[18:49:55,923]: time to say goodbye (traperror)
DEBUGNOTE[18:49:55,958]: traperror: Command at Line 434 returned with error code 1:
  return 1
  7064 - ::error::create_cachefiles::main::main
DEBUGNOTE[18:49:55,991]: time to say goodbye (traperror)
DEBUGNOTE[18:49:56,026]: Terminating x11docker.
DEBUGNOTE[18:49:56,057]: time to say goodbye (finish)
DEBUGNOTE[18:49:56,092]: traperror: Command at Line 510 returned with error code 1:
  [ -e "$Timetosaygoodbyefifo" ]
  439 - ::finish::error::create_cachefiles::main::main
DEBUGNOTE[18:49:56,125]: time to say goodbye (traperror)
DEBUGNOTE[18:49:56,401]: x11docker exit code: 0
SUCCESS: The process with PID 4396 has been terminated.

I cannot post the full log, as x11docker fails to generate it precisely because the error is related to the path of the cache folder.

mviereck commented 4 years ago

Thank you for the bug report!

x11docker adds an error message of cmd.exe to the desired path:

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

The result should only be C:/Users/eine/x11docker/cache. I've made a fix in https://github.com/mviereck/x11docker/commit/99eae4027a772c652d58854e7856cf72bb061145, please try out.

eine commented 4 years ago

It works. The error is still shown, but it is no longer in the path:

$ /mnt/t/runx/runx -- /mnt/t/x11docker/x11docker x11docker/xfce xfce4-terminal
runx note: Using random X display number :394.
  If this display number is already in use, X server startup  will fail.
  You can specify a display number N with option '--display N'.

'\\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.
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 note: If you get application error messages like 'Cannot open display'
  or 'Invalid MIT-MAGIC-COOKIE', the X authentication cookie might be broken.
  You can remove old cookies and stop running X servers with: runx --cleanup

DISPLAY=10.0.75.1:394 XAUTHORITY=/home/eine/runx_Xauthority
'\\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.
x11docker note: Using X server option --hostdisplay

x11docker note: Per default x11docker stores its cache files on drive C:.
  docker setup may not allow to share files from drive C:.
  If startup fails with an 'access denied' error,
  please either allow access to drive C: or specify a custom folder for cache
  storage with option '--cachebasedir D:/some/cache/folder'.
  Same issue can occur with option '--home'.
  Use option '--homebasedir D:/some/home/folder' in that case.

x11docker note: To allow protection against X security leaks,
  please install 'xinit' and one or more of:
    xpra, Xephyr, nxagent, weston+Xwayland, kwin_wayland+Xwayland or Xnest,
  or run a second Xorg server with option --xorg.

x11docker WARNING: Option --hostdisplay allows less security hardening.
  It is recommended to use another X server option like --nxagent or --xephyr.

'\\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.

(xfce4-terminal:126): dbind-WARNING **: 20:13:57.775: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
Failed to connect to session manager: Failed to connect to the session manager: SESSION_MANAGER environment variable not defined
/mnt/t/x11docker/x11docker: line 862:   826 Terminated              watchmessagefifo
SUCCESS: The process with PID 4452 has been terminated.