I'd really hate to go back to having to run a linux VM on windows just to get perl to use a database--it takes a whopping amount of space to do it this way, not to mention the added layers of complexity with accessing it via the VM.

By coincidence, just the other day I installed Ubuntu on my Windows 11 laptop. I seem to have fluked a clean Ubuntu WSL2 install with a single wsl --install command, to install the default Ubuntu distribution of Linux from the Microsoft Store. It required a couple of reboots IIRC. I started with 148 GB free of 237 GB. I now have 131 GB free, i.e. Ubuntu on WSL2 took around 17 GB.

I am now happily running WSL2 Linux: Ubuntu 22.04.1 LTS (GNU/Linux 5.15.90.1-microsoft-standard-WSL2 x86_64). All I've done on it so far is run some basic Perl programs and compile and run some C++ programs with g++ and clang++. It seems to be just a basic core Perl v5.34, so you'll need to install DBD/DBI and other modules from CPAN. Update: I later built perl v5.36 from source (update: improved build perl v5.38 notes) and played around with many Linux C++ libraries, including boost, Catch2 and Abseil.

For WSL2, I believe you must first upgrade to Windows 11 (or at least the latest version of Windows 10) -- more detail on this topic can be found at WSL2 on wikipedia or perhaps by ringing Microsoft Support. Disclaimer: I am not an expert on this topic just throwing it out there in case it helps. (AFAIK, the main alternative to WSL2 is to install VMware, followed by multiple different Linux distros).

References Added Later

Scrappy WSL Ubuntu Notes

Steps to Install Ubuntu on WSL2 on Windows 11:

See : How to install WSL on Windows 11

To see the version of WSL you are running (e.g. WSL2) enter the command : wsl -l -v. For example, I see:

C:\> wsl -l -v
  NAME      STATE           VERSION
* Ubuntu    Stopped         2

or:

* Ubuntu    Running         2

To see alternative versions:

C:\>wsl -l -o
The following is a list of valid distributions that can be installed.
Install using 'wsl.exe --install <Distro>'.

NAME                                   FRIENDLY NAME
Ubuntu                                 Ubuntu
Debian                                 Debian GNU/Linux
kali-linux                             Kali Linux Rolling
Ubuntu-18.04                           Ubuntu 18.04 LTS
Ubuntu-20.04                           Ubuntu 20.04 LTS
Ubuntu-22.04                           Ubuntu 22.04 LTS
Ubuntu-24.04                           Ubuntu 24.04 LTS
OracleLinux_7_9                        Oracle Linux 7.9
OracleLinux_8_7                        Oracle Linux 8.7
OracleLinux_9_1                        Oracle Linux 9.1
openSUSE-Leap-15.6                     openSUSE Leap 15.6
SUSE-Linux-Enterprise-15-SP5           SUSE Linux Enterprise 15 SP5
SUSE-Linux-Enterprise-Server-15-SP6    SUSE Linux Enterprise Server 15 SP6
openSUSE-Tumbleweed                    openSUSE Tumbleweed

To install WSL2:

Misc Notes:

Right clicking on CMD and selecting Ubuntu, starts it up with:

Welcome to Ubuntu 22.04.1 LTS (GNU/Linux 5.15.153.1-microsoft-standard-WSL2 x86_64)

TODO: upgrade to Ubuntu-24.04?

See Also


In reply to Re^3: Perl XAMPP DB Connect issue (Windows/Strawberry?) - Perl on Windows/WSL References by eyepopslikeamosquito
in thread Perl XAMPP DB Connect issue (Windows/Strawberry?) by Polyglot

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.