-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't open GUI app from terminal #63
Comments
Seems likely that the export might be screwed up for the direct terminal. When that error shows up, in the same terminal, have you tried to execute You could also try |
Also, maybe check the application itself for any switches that change the display |
The display stuff didn't seem to work. The app doesn't seem to change the display stuff but here's it's code just in case #!/bin/sh
set -e
# All Feature Flags
export AVAILABLE_FEATURES="$(tr '\n' ' ' < /usr/share/minecraft-pi/client/features)"
# Print Feature Flags Option
if [ "$1" = "--print-features" ]; then
echo "${AVAILABLE_FEATURES}"
exit 0
fi
# Esnure User Is In docker Group
#if ! id -nGz | grep -qzxF 'docker'; then
# pkexec /usr/sbin/usermod -aG docker "$(id -un)"
#fi
# Export Important Variables
export ZENITY_CLASS='Minecraft - Pi edition'
export DOCKER_COMPOSE_YML="/usr/share/minecraft-pi/client/docker-compose.yml"
# Ensure Features Are Selected
if [ -z "${MCPI_FEATURES+x}" ]; then
MCPI_FEATURES="$(eval "zenity --class \"${ZENITY_CLASS}\" --list --checklist --width 400 --height 400 --column 'Enabled' --column 'Feature' ${AVAILABLE_FEATURES}")"
fi
if [ -z "${MCPI_RENDER_DISTANCE+x}" ]; then
MCPI_RENDER_DISTANCE="$(zenity --class "${ZENITY_CLASS}" --list --radiolist --width 400 --height 400 --text 'Minecraft Render Distance:' --column 'Selected' --column 'Name' FALSE 'Far' FALSE 'Normal' TRUE 'Short' FALSE 'Tiny')"
fi
if [ -z "${MCPI_USERNAME+x}" ]; then
MCPI_USERNAME="$(zenity --class "${ZENITY_CLASS}" --entry --text 'Minecraft Username:' --entry-text 'StevePi')"
fi
export MCPI_FEATURES
export MCPI_RENDER_DISTANCE
export MCPI_USERNAME
# Prepare Environment
export USER_HOME="${HOME}"
export USER_UID="$(id -u)"
export USER_GID="$(id -g)"
get_gid() {
echo "$(getent group "$1" | cut -d : -f 3)"
}
export USER_OTHER_GIDS="$(get_gid video) $(get_gid render)"
# Run
set +e
sg docker /usr/lib/minecraft-pi/pre-launch.sh
RET=$?
set -e
# Handle Crash
if [ ${RET} -ne 0 ]; then
zenity --class "${ZENITY_CLASS}" --error --no-wrap --text 'Minecraft: Pi Edition has crashed!\n\nExit Code: '${RET}'\n\n<a href="file:///tmp/minecraft-pi">Open Log Folder</a>\n<a href="https://gitea.thebrokenrail.com/TheBrokenRail/minecraft-pi-reborn/src/branch/master/docs/TROUBLESHOOTING.md">Open Troubleshooting Guide</a>'
exit ${RET}
fi |
Minecraft PI edition? Why are you trying to run that in WSL? Doing some coding projects with it? In any case, assuming you are virtualizing an ARM system within WSL, you're likely missing openGL drivers for the virtualization, that or something else is going wrong. |
Maybe line 3 ( Here's what I suggest, try replacing: set -e with display=$DISPLAY
set -e
export DISPLAY=$display in your script. |
I'm trying to run mcpi-reborn: https://gitea.thebrokenrail.com/TheBrokenRail/minecraft-pi-reborn. It's a mcpi mod that I want to get running on my win10 machine. I'm running a x86 virgl edition of it which quote, "Uses VirGL For Hardware Acceleration" so it probably doesn't use gl. |
Still the same issue sadly :/ |
how about maybe including this somwhere near the top? |
Only other thing I can think of, if that doesn't work, is maybe try changing the display mode in GWSL (to single window mode or full screen mode) and then see if your script works then. |
That is normal when no clients are connected. So did you update your .profile yet? Sorry. I missed what has been going on. (note I have never tested GWSL with docker) |
.profile? Whut? |
I am not sure how wsl works with docker but if you get in the docker's home directory if there is one what happens if you run |
|
try replacing |
Unable to init server: Could not connect: Connection refused (zenity:1508): Gtk-WARNING **: 18:53:26.630: cannot open display: 172.17.16.1 |
Did you allow GWSL through the windows firewall? Since you are running the beta you can fix it in the dashboard in the about screen |
Well now the ip has probably changed... What happens if you run |
It's still 172.17.16.1 |
Does GWSL's test xclock work? Dashboard --> About --> XClock? |
I found this. microsoft/WSL#2855 (comment) Create an xserver profile with the flags (Name it Minecraft or something) |
|
Yes |
Okay, I'm switched to the profile, I remove all my previous changes to .profile and /usr/bin/minecraft-pi so it would launch properly. Still the same error though. |
And if you keep that profile and put this in .profile |
And maybe restart wsl with wsl --shutdown |
Nope stll the same. |
I have no idea then :( sorry. I can't do anything to fix it in the backend either |
And also apprantly --shutdown wasn't a proper argument so I used the restart function in gwsl |
Thats ok. Some apps just don't work in WSL. I hope soon compatability will be better but for now its up to Microsoft. |
Wait wsl --shutdown didn't work? That is how GWSL restarts... Do you have the new wsl? If you get the builtin wsl help what are the available commands... Maybe it did not restart after all O_o |
I mean in cmd not bash :D |
Ohhh lol... well appratly |
It might of actually worked? I got |
Non beta and beta GWSL have no difference for the error btw. GWSL 1.3.8 is just better in other ways
hmmm |
Oh... ripp |
Just a quick question, gwsl does support openGL apps right? I've recently gotten a dockerless build of the game using qemu which I think might work better. |
It should. It works very well for me |
Also sorta unrelated but is GWSL compatible with Wsl 1? Something broke hyper v on my PC which means I can only run WSL 1. |
Yes, as long as you have the latest wsl updates for windows 1903 and up, you can use wsl 1. So if you had 2 and just made a new machine with one it will work. |
Alright, so I tested the game on WSL 1 and it crashed with Instead, I tested it on a different device that could run WSL 2, and lo and behold the game runs! One issue is that sometimes, the game window will randomly close, but the game itself is still running in terminal and doesn't crash, |
Much better still though lol |
I'm using wsl2. I'm running a docker app. I got this while running it in terminal directly without using any of the shortcut stuff or the linux apps menu:
[ERR]: GLFW Error: X11: Failed to open display unix172.17.16.1:0.0
(I've tested other apps like zenity which display perfectly.)
The text was updated successfully, but these errors were encountered: