diff --git a/x11docker b/x11docker index b3162758..76db25fd 100755 --- a/x11docker +++ b/x11docker @@ -873,10 +873,17 @@ depends() { # check dependencies on host for X server option $1 [ -z "$Winsubsystem" ] && Return=1 && $Message "${1:-}: X server VcXsrv is available on MS Windows only." [ "$Return" = "1" ] || { export PATH="$PATH:$Vcxsrvpath" - Hostip="$(ipconfig.exe | grep 'IPv4' | head -n1 | grep -o '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*' | grep "^10\.0\.*")" } ;; esac + case $Xserver in + --vcxsrv|--xwin) + Hostip="$(ipconfig.exe | grep 'IPv4' | head -n1 | grep -o '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*' | grep "^10\.0\.*")" + [ "$Hostip" ] || { + warning "Failed to get host IP for $Xserver." + Return=1 + } ;; + esac case ${1:-} in --weston|--xpra-xwayland|--weston-xwayland|--xdummy-xwayland) command -v "weston" >/dev/null || { @@ -2122,7 +2129,7 @@ $(cowsay "$Wisdom" 2>/dev/null || echo "Wanda the fish says: $Wisdom")" depends $Xserver || { case $Winsubsystem in - "") error "Did not find a possibility to provide a display. + "") error "Did not find a possibility to provide a display. Recommendations: To run within an already running X server, install one or all of: Xephyr xpra nxagent @@ -2130,7 +2137,10 @@ $(cowsay "$Wisdom" 2>/dev/null || echo "Wanda the fish says: $Wisdom")" weston and Xwayland, optionally also: xpra and xdotool To run from TTY or within Wayland, install: weston and Xwayland" ;; - *) error "Did not find a possibility to provide a display. + CYGWIN) error "Did not find a possibility to provide a display. + Please install Xwin (xinit package) in Cygwin, + or VcXsrv on Windows host." ;; + MSYS2|WSL) error "Did not find a possibility to provide a display. Please install X server VcXsrv on Windows host." ;; esac } @@ -3869,6 +3879,8 @@ esac --vcxsrv|--xwin) [ "$Xserver" = "--vcxsrv" ] && Xcommand="$(escapestring "$Vcxsrvpath")/vcxsrv.exe :$Newdisplaynumber" [ "$Xserver" = "--xwin" ] && Xcommand="$(command -v Xwin) :$Newdisplaynumber" + [ "$Xserver" = "--xwin" ] && Customenvironment="DISPLAY=$Hostip:$Newdisplaynumber +$Customenvironment" Xcommand="$Xcommand \\ $Xserveroptions \\ @@ -4985,7 +4997,6 @@ DefaultEnvironment=DISPLAY=$Newdisplay XAUTHORITY=$Cshare/Xclientcookie $(IFS=$' echo "ls -l /X$Newdisplaynumber" echo "ls -l $Newxsocket" } - [ "$Xserver" = "--xwin" ] && echo "note \"shared X unix socket: \$(ls -l /X$Newdisplaynumber)\"" echo "" [ "$Hostlocaltime" ] && {