Skip to content

Instantly share code, notes, and snippets.

@tdcosta100
tdcosta100 / WSL2GUIWSLg-XWayland-pt_br.md
Last active September 3, 2024 14:09
Tutorial para utilizar interface gráfica no WSL2/WSLg, substituindo o Xorg pelo Xwayland, permitindo ao WSL trabalhar como se fosse Linux nativo, incluindo tela de login

WSL2 com interface gráfica utilizando WSLg (XWayland)

Note

Caso você queira utilizar o WSLg de uma forma mais simples, você pode tentar o tutorial com o WSLg (Wayland).

Nesse tutorial, iremos configurar a interface gráfica no WSL2. Nenhum software adicional fora do WSL é necessário (como o VcXsrv ou GWSL). Você vai achar esse tutorial muito parecido com o que substitui o Xorg pelo Xvnc. De fato, é praticamente o mesmo, com algumas poucas mudanças.

Os componentes-chave que precisamos instalar são o metapackage do desktop que você desejar (GNOME, KDE, Xfce, Budgie, etc) e o xwayland, e depois disso, substituiremos o Xorg padrão por um script que chama o Xwayland em seu lugar.

Para essa configuração irei utilizar Ubuntu 24.04, e irei instalar o GNOME Desktop. Infelizmente versões mais antigas do Ubuntu não possuem algumas coisas fundamentais, então infelizmente não conseguimos reproduzir essa configuração em versões mais

@tdcosta100
tdcosta100 / WSL2GUIWSLg-XWayland-en.md
Last active September 17, 2024 17:19
A tutorial to use GUI in WSL2/WSLg replacing original Xorg by Xwayland, allowing WSL to work like native Linux, including login screen

Full desktop shell in WSL2 using WSLg (XWayland)

Note

If you want to use Wayland in WSLg in a simpler setup, you can try the WSLg (Wayland) tutorial.

In this tutorial, we will setup GUI in WSL2. No additional software outside WSL (like VcXsrv or GWSL) is required. You will find this tutorial very similar to the one that replaces Xorg with Xvnc. Indeed, it's pretty much the same tutorial, with some few changes.

The key component we need to install is the desktop metapackage you want (GNOME, KDE, Xfce, Budgie, etc), and after that, replace the default Xorg by a script that calls Xwayland instead.

For this setup, I will use Ubuntu 24.04, and install GNOME Desktop. Unfortunately older versions of Ubuntu lack some fundamental things, so we cannot reproduce it in older versions (at least not fully). Since the key components aren't bound to Ubuntu or GNOME, you can use your favorite distro and GUI. Check the [Sample screenshot

@tdcosta100
tdcosta100 / WSL2GUIWSLg-Wayland-pt_br.md
Last active August 3, 2024 17:42
Utilizando o desktop shell completo no WSL2 (Wayland)

Shell desktop completo no WSL2 utilizando o WSLg (Wayland)

Note

Caso você deseje uma experiência mais completa e já utilizou o tutorial do Xvnc, talvez você deva tentar o tutorial de WSLg (Xwayland) ao invés deste.

Warning

Esse tutorial está em desenvolvimento, portanto as alterações propostas nele podem interferir nas funcionalidades existentes. Proceda com cautela!

Nesse tutorial, vamos instalar e utilizar o ambiente desktop do GNOME no WSL2, sem nenhuma utilização de software externo. A única exigência é o WSLg instalado e funcionando. Atualmente, as instruções são somente para as distribuições do Ubuntu (20.04, 22.04 e 24.04) e GNOME, mas você pode solicitar que eu teste outras distribuições e ambientes desktop.

@tdcosta100
tdcosta100 / WSL2GUIWSLg-Wayland-en.md
Last active September 6, 2024 13:27
Using full desktop shell in WSL2 using WSLg (Wayland)

Full desktop shell in WSL2 using WSLg (Wayland)

Note

If you want a more complete experience and already tried the Xvnc tutorial, maybe you should try the WSLg (Xwayland) instead.

Warning

This is a work in progress tutorial. Things done here may break existing functionality, so be careful!

In this tutorial, we will install and use a full GNOME Desktop environment in WSL2, without any external software. The only requirement is a working WSLg installation. At the moment, the instructions are only for Ubuntu (20.04, 22.04 and 24.04) distros and GNOME, but you can request me to test other distros and desktop environments.

@tdcosta100
tdcosta100 / QEMU-Ubuntu-22.04-WHPX.bat
Last active February 2, 2024 03:20
QEMU 7.0.0 configuration for Ubuntu 22.04 (LTS) with WHPX acceleration
:: In order to make Ubuntu 22.04 to work with WHPX acceleration without crashes, you have to activate the following CPU features:
:: -aes
:: -avx
:: -sse4.1
:: -sse4.2
:: -ssse3
:: -x2apic
:: -xsave
::
:: You can change every other option, only CPU and WHPX options are mandatory.
@tdcosta100
tdcosta100 / WSL2GUIXvnc-pt_br.md
Last active August 6, 2024 15:55
Tutorial para utilizar interface gráfica no WSL2, substituindo XServer pelo Xvnc, permitindo ao WSL trabalhar como se fosse Linux nativo, incluindo tela de login

WSL2 com interface gráfica utilizando Xvnc

Note

Caso você queira utilizar o WSLg puro, você pode tentar o novo tutorial com o WSLg (Xwayland) ou o tutorial com o WSLg (Wayland).

Nesse tutorial, iremos configurar a interface gráfica no WSL2, e acessá-la utilizando o VNC. Nenhum software adicional fora do WSL é necessário (como o VcXsrv), exceto, claro um VNC Viewer (RealVNC, TightVNC, TigerVNC, UVNC, etc, todos devem funcionar perfeitamente).

Os componentes-chave que precisamos instalar são o metapackage do desktop que você desejar (GNOME, KDE, Xfce, Budgie, etc) e o tigervnc-standalone-server.

Para essa configuração irei utilizar Ubuntu (20.04, 22.04 e 24.04 funcionam), e irei instalar o GNOME Desktop. Uma vez que os comp

@tdcosta100
tdcosta100 / WSL2GUIXvnc-en.md
Last active September 17, 2024 10:45
A tutorial to use GUI in WSL2 replacing original XServer by Xvnc, allowing WSL to work like native Linux, including login screen

WSL2 with GUI using Xvnc

Note

If you want to use pure WSLg, you can try the new WSLg (XWayland) tutorial or the WSLg (Wayland) tutorial.

In this tutorial, we will setup GUI in WSL2, and access it using VNC. No additional software outside WSL (like VcXsrv) is required, except, of course, a VNC Viewer (RealVNC, TightVNC, TigerVNC, UVNC, etc, all of them might work flawlessly).

The key component we need to install is the desktop metapackage you want (GNOME, KDE, Xfce, Budgie, etc) and tigervnc-standalone-server.

For this setup, I will use Ubuntu (20.04, 22.04 and 24.04 are working), and install GNOME Desktop. Since the key components aren't bound to Ubuntu or GNOME, you can use your favorite distro and GUI. Check the [Sample

@tdcosta100
tdcosta100 / NeedlemanWunsch.cs
Last active August 21, 2019 15:21
Needleman-Wunsch algorithm
using System;
using System.Collections.Generic;
using System.Linq;
namespace Algorithms
{
public class NeedlemanWunsch
{
private enum CorrespondenceType
{