Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save oleksis/459ec563b7d11a2a1856cec6c35d286e to your computer and use it in GitHub Desktop.
Save oleksis/459ec563b7d11a2a1856cec6c35d286e to your computer and use it in GitHub Desktop.
Instalar WSL en Windows 10 y Distros: openSUSE Leap 15.2 y Qt5

Instalar WSL en Windows 10 y Distros: openSUSE Leap 15.2

Abrir powershell como administrador

Todos los comandos se ejecutar en powershell como administrador

> PS D:

Habilitar la caracteristica WSL en Windows 10 y luego reiniciar

> Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Reiniciar el sistema para que WSL inicie en un ambiente de ejecucion verdadero y seguro

Chequear que WSL este habilitado

> Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Descargar una Distro Linux para WSL

https://docs.microsoft.com/en-us/windows/wsl/install-manual

Descargar openSUSE Leap 15.2 para WSL

> wget https://download.opensuse.org/repositories/Virtualization:/WSL/openSUSE_Leap_15.2/openSUSE-Leap-15.2-x64-Build26.65.appx

Extraer el contenido del package .appx

> Rename-Item .\openSUSE-Leap-15.2-x64-Build26.appx .\openSUSE-Leap-15.2-x64-Build26.zip
> Expand-Archive .\openSUSE-Leap-15.2-x64-Build26.zip .\openSUSE-Leap-15.2

Cambiar al directorio y ejecutar .exe

> cd .\openSUSE-Leap-15.2\
> .\openSUSE-Leap-15.2.exe

Esperar que installe el sistema y entrar user y password inicial

>> Installing, this may take a few minutes...
>> Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
>> Enter new UNIX username: oleksis
>> Enter new UNIX password:
>> Retype new UNIX password:
passwd: password updated successfully
Installation successful!

Deshabilitar Repositorio Oficial

$ sudo zypper lr
$ sudo zypper mr -d 1  # 5,6,9,10
$ sudo zypper mr -d 2

Adicionar Repositorios Nacionales

$ sudo zypper addrepo https://repos.uclv.edu.cu/opensuse/15.2/repo/oss/ uclv_oss
$ sudo zypper addrepo https://repos.uclv.edu.cu/opensuse/15.2/repo/non-oss/ uclv_non-oss

Actualizar Repositorio

$ sudo zypper ref

Instalar Qt5

$ sudo zypper install --type pattern devel_basis  # Choose from above solutions by number or cancel
$ sudo zypper ps -s
$ sudo zypper --non-interactive install libqt5-qtbase-devel

Chequear qmake

$ qmake-qt5 --version
QMake version 3.1
Using Qt version 5.12.6 in /usr/lib64

Compilar Proyecto

$ qmake-qt5 -config release <proyecto>.pro -spec linux-g++-64
$ make clean
$ make -j2

Adicionar DISPLAY variable de entorno para VcXsrv

$ echo "" >> .bashrc && echo 'export DISPLAY="`grep nameserver /etc/resolv.conf | sed 's/nameserver //'`:0"' >> .bashrc
$ echo 'export XDG_RUNTIME_DIR=~/' >> .bashrc
$ echo 'export RUNLEVEL=3'  >> .bashrc

Opcional

Actualizar GCC

$ sudo zypper --non-interactive up gcc

Chequear gcc in openSUSE

$ gcc --version

Actualizar GNU Binutils

sudo zypper --non-interactive up binutils

Instalar MC

sudo zypper in mc

Instalar KDE para Aplicaciones GUI

$ sudo zypper install --type pattern kde
@RafaelLinux
Copy link

La última línea, referente a instalar KDE ¿eso permitiría ejecutar en Windows por ejemplo KDEnlive??? Tenía entendido que WSL no permite correr entornos de escritorio.

@oleksis
Copy link
Author

oleksis commented Mar 23, 2023

Con WSL2 en las últimas versiones integra WSLg: https://github.com/microsoft/wslg

@RafaelLinux
Copy link

¡¡Pues habrá que probarlo!! (por curiosidad, nada de quedarse en Windows .... ups). ¡¡¡Gracias!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment