JessiBaughman / OpenVnmrJ_WSL

Script to install and configure Windows Subsystem for Linux and OpenVnmrJ on Windows 10+
MIT License
0 stars 0 forks source link

bug: Failed on Windows 10 #4

Closed DanIverson closed 1 day ago

DanIverson commented 5 days ago

I tried on Windows 10. The attached install_summary is the output. I removed stuff about installing packages etc. I then read step 4 of the installation instructions to install VcXsrc, which I did. I then tried again. Another failure. Output in install_again. Note the xhost failures trying to open the display.

install_summary.txt

install_again.txt

DanIverson commented 5 days ago

I tried to run xterm. It did not start. If I do export DISPLAY=:0.0 then xterm works. After doing the export DISPLAY=:0.0, then running load.nmr showed the installer window. After clicking "Install", the progress window did not appear, but the installation proceeded. By checking with "ps -ef" commands, I could tell when the installation completed. After killing the installation java process, load.nmr continued asking about installing walkup/service accounts, adding fidlib, etc. Running vnmrj then worked and I was able to rt fid1d and process the data.

DanIverson commented 5 days ago

Turns out the progress monitor "appears" but it is located off the screen, so one does not see it. Also, OVJ and OVJ admin windows come up with a reasonable height but their width is about 5 times too wide. Not sure if there is some WSLg option that controls this stuff.

JessiBaughman commented 4 days ago

VcXsrv might need a firewall rule (it's supposed to prompt on install). If you have an updated version of Windows 10 (21H2+), you can use WSLg, which doesn't use all the Xauthority stuff that VcXsrv uses to try to avoid those issues. I'm thinking maybe I should just take the VcXsrv option out. It's more error prone than what it's probably worth at this point. I'll push out the updated readme that clarifies VcXsrv is for W10 20H1-21H2.

Both VcXsrv and WSLg are prone to windows opening off screen, though I've had this issue much less with WSLg. That's more of a long-persistent, ironic Windows OS issue; poor windows management allowing windows to appear off screen. There are some workarounds mentioned in the WSLg Issue #332. Usually (not always), once you get a window on screen and close it, the next time it appears it will be at least mostly on screen and then clicking an edge (as if to resize) will bring it all the way on screen.

In your current Ubuntu 20.04 distro, is root your default account? Selecting to use a current distro assumes that you have a user account set as default and that it matches the one you enter in the initial panel. It also said in the initial install that vnmr1 already existed. Was this being installed in a distribution that already had OpenVnmrJ installed? It's not intended for upgrading, so maybe I'll add that clarification to the Readme and add a check in the script. If you already have OpenVnmrJ, it's best to just run the upgrade script from the installer. This script is intended for fresh installs of OpenVnmrJ.

Edit: Typed VcXsrc instead of VcSrv

DanIverson commented 4 days ago

I had tried wsl about a year ago. It installed OVJ but I was never able to get the graphics to work. I also tried cygwin, mingw, xming, and other stuff, so this PC may have conflicting pieces. Its current level is 22H2. I unregistered the Ubuntu distros and did wsl --uninstall. I ran wsl and it complained it needed a kernel update so I figured that that is where your tool starts its work. I got the following output:

Updating WSL Checking for updates. The most recent version of Windows Subsystem for Linux is already installed. Invalid distribution name: '--no-launch'. To get a list of valid distributions, use 'wsl.exe --list --online'. Error code: Wsl/InstallDistro/WSL_E_DISTRO_NOT_FOUND Starting WSL install .exe : The term '.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

DanIverson commented 4 days ago

I copied your installer to owsl and added the line Set-PSDebug -trace 2 at the top of the file. Attached is the debug output. I also ran wsl -l, which is where I think things go south. debug.txt

JessiBaughman commented 3 days ago

It seems this time it didn't set the variable for chosen distribution. Did it not prompt for one?

At this point, I think I'd recommend trying to "reset" your system as this is getting really obscure. So wsl --unregister <distro> for the you plan to use if needed. Then find it in the Start menu, and if still there, right-click and select uninstall. In PowerShell, manually run wsl --update, followed by wsl -l to see that it looks fine. Then maybe try the script again. After clicking ok, make sure you select a distro at the PowerShell prompt, otherwise abort.

I'll finish the Readme update and push it shortly so you can follow along with the updated step-by-step.

DanIverson commented 2 days ago

I have been playing a bit more with WSL. When I ran the script, I was not prompted for a distribution. I made a small change to your script that fixes that problem. It comments out an "if" conditional. Generally, things are working. I get a lot of Locator errors during OVJ installation,so I added a feature that avoids starting the Locator during installation. By doing  touch LocatorOff in the dvdimageOVJ directory, load.nmr will not try to start it. I made both of these changes to your script, which is attached. I made a new dvdimage zip file which has the changes in OVJ to fix the selinux problem, fixes the installer progress monitor from appearing off-screen, and now  recognizes a LocatorOff file in the dvdimageOVJ directory as a sign to not start the Locator. You can download this dvdimage zip file at: https://www.dropbox.com/scl/fi/agm74jhxrz0b8oi7n9e88/ovj32_ddr_jb.zip?rlkey=ixc8tzwqfkq9fmqq9u9hlk79b&st=0dlx6i47&dl=0

OVJ shortcut on desktop starts OVJ with the last OS (eg U24) that I installed. If I start a WSL from the Start menu in order to start OVJ manually, it starts the "Default" OS, which in my case is U22. Perhaps your script should do a "wsl -s $installDist" to select it as the default. I did not make that change to your script.

Your script works pretty well. I tried it with U22, U24, and Alma9. All worked. ovjwsl.zip

JessiBaughman commented 2 days ago

Thanks for looking into this. I was fighting getting the cups-pdf install via script to work the past few days. That If statement wasn't supposed to span that whole region, but since it's unnecessary, I took it out. I added the LocatorOff feature (Krish will like that) and added a prompt to ask if the user wants to set the chosen distribution to the WSL default. (e15617cf866691259c5b8f3d0daef28d8349db81)

I tested out the linked installer with the changes and had no install issues with any of the distros. However, after wsl restarts, the window opens small like below for both Ubuntu and Alma. I can resize it and it'll stay through multiple vnmrj opens/closes until wsl is shutdown, then it reopens small again. I think it's sizing the window to the splash screen image, because it's hit-or-miss if I see the splash on first load. This happens both when launched from the shortcut or directly from a WSL prompt. The beta3 installer always loaded the window at default size and centered on screen for me, but I've only tested on a single monitor, Windows 10 setup so far.

image

Out of curiosity, if you open the distro you installed with the script, is there anything in /etc/wsl.conf? That should have systemd=true under the [boot] section that would enable systemd to support Locator. If you run systemctl status does it show as active? And if systemd is active, can you turn the Locator back on without issue?

Also, did you follow the Readme instructions and just close the Admin panel when it opens during install, or did you manually perform any tasks first? It really shouldn't matter, but just wondering if that's why you saw Locator errors. I couldn't reproduce that, though it doesn't really matter now.

The script should have written the shortcuts with the same command that specifies the distribution selected. If you look at the properties of the shortcuts, do you see something like

C:\Windows\System32\wsl.exe -d Ubuntu-24.04 /bin/bash -lic "vnmrj; sleep 3"

in the Target field?

Currently, it will (or should) overwrite these shortcuts on each distro install. I could make the shortcuts unique to each distro if you thought that would be a good idea. I don't know how many (other) people will be installing multiple versions of OpenVnmrJ though.

DanIverson commented 1 day ago

I also sometimes see the splash screen come up as a blank window. My windows come up reasonably sized but I never do a wsl --shutdown, except when your script does it. The /etc/wsl.conf has [boot] systemd=true

systemctl status gives "running" and I can run dbsetup and it works correctly. I tried to follow your installation instructions but it is possible that by the time it got to running vnmrj admin, I went on autopilot. I manually updated the vnmr1 user and exited. I got the Locator / sql errors displayed in the installer progress monitor, before vnmrj admin starts. Some times there could be quite a few of them but if I wait long enough, eventually they stop and the installation continues. Yes, the shortcut target field is similar to what you showed. I think overwriting the shortcuts is best. Except for testing, I don't think people will install more than one distro. It is up to you, but I also think U22, U24, Alma8, and Alma9 are enough choices. U20 and unpinned Ubuntu could be dropped from the list. All in all, I think it works pretty well. I think we can close this issue.

JessiBaughman commented 1 day ago

Well, restarting your computer will have the same effect as wsl --shutdown, which is why I was testing that.

But it sounds like should someone want to turn the Locator on, it will be fine, so I'm happy with that. I like the idea of dropping those two Ubuntu options, so I'll do that.

Thanks again for testing, feedback, and contributions while being busy with OVJ3.2! I appreciate it.