Forum > Windows (32/64)

Installing Lazarus on WSL2?

<< < (2/2)

Wysardry:
I have only been using Debian for a couple of months or so on an older laptop and haven't installed much beyond markdown, code and text editors.

I have used both the Synaptic GUI package manager and the command line, but only by following instructions.

WSL2 seems a little harder to use so far, as it doesn't have a desktop environment. I have read that you can add one, but I'm not sure how easy that would be or if it would help.

It also wasn't made clear in the Microsoft articles that I should use the WSL shortcut not the Debian one, as the latter is set to en_US instead of en_GB.

Am I right in thinking that if you install anything from .deb files you have to update manually?

PascalDragon:

--- Quote from: PierceNg on September 13, 2023, 02:22:42 pm ---
--- Quote from: Wysardry on September 13, 2023, 08:16:18 am ---I'm using a Windows 10 build greater than 19044 so it should be able to run GUI apps via WSL2, according to the Microsoft page you linked to.

I was able to install (and run) X11 apps and GIMP without problems.

--- End quote ---

Ah, nice, MS has incorporated built-in X server into latest Windows 10.
--- End quote ---

No. They incorporated a way for Wayland applications to display using rootless remote desktop and X11 applications simply work through XWayland running on WSL2 (as can be seen here).

PierceNg:

--- Quote from: PascalDragon on September 13, 2023, 10:53:07 pm ---No. They incorporated a way for Wayland applications to display using rootless remote desktop and X11 applications simply work through XWayland running on WSL2 (as can be seen here).
--- End quote ---

Thanks for the link, very informative.

Since there is no direct X11 'over the wire' between WSLg and the Windows host, I started Cygwin/X on Windows and tried again. After setting DISPLAY and copying over Cygwin/X's .Xauthority file from Windows to Linux, X11 programs like gvim and Lazarus failed to connect to the X display server. Probably measures to protect the X server against network attacks. Or maybe I need to muck around with Windows firewall rules.

Anyways,, I started a 'local' (meaning on Windows Cygwin/X) xterm, ssh from it to WSL2 Ubuntu with X11 forwarding, then run 'startlazarus'. This time, the 'install / uninstall package' dialog box was usable, and I could select anchordockingdsgn and click 'rebuild IDE'.

BUT! When Lazarus restarted, it failed to paint its window properly, got stuck in partial full screen, was not responsive to mouse, and haphazardly responded to key presses. The xterm that started the app showed several lines "Gtk-critical: IA_gtk_window_set_keep_above: assertion GTK_IS_WINDOW (window) failed"


--- Quote from: Wysardry on September 13, 2023, 09:24:27 pm ---WSL2 seems a little harder to use so far, as it doesn't have a desktop environment. I have read that you can add one, but I'm not sure how easy that would be or if it would help.
--- End quote ---


Depends on how you use. When I tried it few months back, the full desktop X environment ran full screen, with its own login screen, just like running Linux-in-a-VM in full screen mode. Needed to press a hot key to escape from the X desktop to get back to Windows. Not for me. I prefer to be able to alt-tab through both Windows and X windows.   

But, given what I wrote on failing to run Lazarus in integrated windows mode, maybe you can try the full X desktop mode.


--- Quote from: Wysardry on September 13, 2023, 09:24:27 pm ---Am I right in thinking that if you install anything from .deb files you have to update manually?
--- End quote ---


Yes. You mentioned in your earlier post that you plan to build your own from source. Installing from the .deb files gives you the FPC for bootstrapping. Once you have built your own versions, you could uninstall the .deb version.

Wysardry:

--- Quote from: PierceNg on September 13, 2023, 02:22:42 pm ---Edit: First thing I do booting up the Lazarus IDE is to install the anchordockingdsgn package. Well, on WSL2 using Windows 10's built-in X server, the "install/uninstall packages" dialog box comes up, but I can't click on it! I also can't cycle to it using alt-tab. Pressing esc makes the dialog box go away though.

Hmm, doesn't look usable like this...

--- End quote ---
I installed everything (FPC, FPC source and Lazarus) from .deb files and had the same problem. The FP IDE seems to run okay, but I'm not sure that's any easier to live with.

It seems it's possible to use VSCode with WSL and there's a FreePascal Toolkit extension available.

Using Lazarus in native Windows with MSYS2 for the Git tools etc. or fpcupdeluxe would likely be a simpler setup though.

PierceNg:

--- Quote from: PierceNg on September 13, 2023, 02:22:42 pm ---Edit: First thing I do booting up the Lazarus IDE is to install the anchordockingdsgn package. Well, on WSL2 using Windows 10's built-in X server, the "install/uninstall packages" dialog box comes up, but I can't click on it! I also can't cycle to it using alt-tab. Pressing esc makes the dialog box go away though.

Hmm, doesn't look usable like this...

--- End quote ---

I just rebuilt Lazarus IDE with Qt5 widget set on WSL2 (this time on a Windows 11 machine):


--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---% make clean bigide LCL_PLATFORM=qt5
With Qt5, after starting the IDE for the first time, installing the anchordockingdsgn package worked as expected: I could navigate the dialog boxes to add the package, and upon rebuilding/restarting the IDE came up docked. More usable than with the default GTK2.

Navigation

[0] Message Index

[*] Previous page

Go to full version