1. Information

2. Preparation

  • Open Programs and Features.

  • Select Turn Windows Features on or off.

  • Check Virtual Machine Platform.

  • Check Windows Subsystem for Linux.

  • Click OK.

  • Close Programs and Features.

  • Restart the computer.

  • Enter the following commands at a Command Prompt with administrative privileges.

    dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
    dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
    :: Restart the computer.
    
    where.exe wsl           # C:\Windows\System32\wsl.exe
    where.exe wslconfig     # C:\Windows\System32\wslconfig.exe
    where.exe wslg          # C:\Windows\System32\wslg.exe
    wsl.exe --help
    wsl.exe --version       # 2.6.2.0
    
    wsl.exe --update
    wsl.exe --set-default-version 2
    wsl.exe --status
    
    :: List available distributions.
    wsl.exe --list --online
    powershell.exe wsl.exe -- ip -o -4 -json addr list eth0

3. Installation

Windows user    WSL instance name       Linux hostname  Linux username  Linux password  Linux IP address
--------------  -----------------       --------------  --------------  --------------  ----------------
Administrator   Admin-Main-Wsl          admin-main-wsl  admin           <level 1>       172.22.88.1
Delta           Delta-Main-Wsl          delta-main-wsl  delta           <level 2>       172.22.88.10
Douwe           Douwe-Main-Wsl          douwe-main-wsl  douwe           <level 3>       172.22.88.100
  • Enter the following commands at a Command Prompt with standard privileges.

    :: Installation of Debian distribution for DELTA-CA-WSL Certificate Authority server.
    wsl.exe --list --all --verbose
    wsl.exe --install --location C:\WSL\Admin-Main-Wsl --name Admin-Main-Wsl --distribution Debian
    wsl.exe --install --location C:\WSL\Delta-Main-Wsl --name Delta-Main-Wsl --distribution Debian
    wsl.exe --install --location C:\WSL\Douwe-Main-Wsl --name Douwe-Main-Wsl --distribution Debian
    :: Enter new UNIX username: <username>
    :: New password: <password>
    :: Retype new password: <password>
  • Optional: Close the Welcome to Windows Subsystem for Linux window.

  • Enter the following commands at a Command Line.

    # Update.
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get dist-upgrade
    sudo apt-get autoremove
    sudo apt-get autoclean
    
    # Set SSH port number.
    sudo apt-get install openssh-server
    sudo sed -i "s/#Port 22/Port 222/" /etc/ssh/sshd_config
    
    # Set hostname.
    host=<hostname>
    cat << EOF | sed -e "s/^  //" | sudo tee --append "/etc/wsl.conf"
    
      [network]
      hostname=${host}
      generateHosts=false
    EOF
    cat /etc/wsl.conf
    
    # Fix temporary failure in name resolution.
    cat /etc/hosts
    sudo sed -i "s/<windows hostname>/<linux hostname>/g" /etc/hosts
    cat /etc/hosts
    
    # Shut down WSL instance.
    exit
  • Enter the following commands at a Command Prompt with standard privileges.

    :: Wait about 8 seconds.
    wsl.exe --list --all --verbose
    
    :: Show IP address.
    wsl.exe --distribution DELTA-CA-WSL hostname -I
    :: Start specific WSL instance.
    wsl.exe --distribution Delta-Main-Wsl
    
    # Shut down all instances.
    wsl.exe --shutdown
    
    # Shut down a specific instance.
    wsl.exe --terminate Delta-Main-Wsl

4. Uninstallation

  • Enter the following commands at a Command Prompt with standard privileges.

    wsl.exe --list --all --verbose
    wsl.exe --unregister Debian
    wsl.exe --unregister Delta-Main-Wsl

5. Start

  • Enter the following commands at a Command Prompt with standard privileges.

    :: Start default WSL instance.
    wsl.exe
    
    :: Start specific WSL instance.
    wsl.exe -- distribution Douwe-Main-Wsl
    
    :: Start specific WSL instance for other Windows user.
    ssh.exe -i id_ed25519-auto delta@127.0.0.2
    wsl.exe -- distribution Delta-Main-Wsl
    
    :: Start specific WSL instance for other Windows user in background.
    Start-BackgroundJob wsl.exe '--distribution $Delta-Main-Wsl'

6. Configuration

  • Enter the following commands at a Command Line.

    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get dist-upgrade
    sudo apt-get autoremove
    sudo apt-get autoclean
    
    cat /etc/debian_version
    sudo apt-get install openssh-server

7. Networking

  • Contents of C:\Users\<User>\.wslconfig file.

    [wsl2]
    #vmSwitch="WSL (Hyper-V firewall)"
    #networkingMode=bridged
    #networkingMode=nat
    networkingMode=mirrored
    
    # Explicitly enable DNS tunneling behavior to improve name resolution under complex host networking.
    dnsTunneling=true
    
    # Tell WSL to adopt Windows' HTTP proxy settings automatically.
    autoProxy=true
    
    # Ensure WSL traffic is subject to the Hyper‑V firewall integration (recommended unless you have a specific reason to disable it).
    firewall=true

8. Configuration

  • See https://linux-training.be/security/ch06.html.

  • See https://linux-training.be/security/ch07.html.

  • See https://linux-training.be/security/ch08.html.

  • Enter the following commands at a Command Line.

    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get dist-upgrade
    sudo apt-get autoremove
    sudo apt-get autoclean
    
    cat /etc/debian_version
    
    sudo useradd --comment "Delta"         --create-home --shell /bin/bash delta
    sudo useradd --comment "Douwe"         --create-home --shell /bin/bash douwe
    sudo useradd --comment "Douwe Kiestra" --create-home --shell /bin/bash douwe
    sudo passwd delta
    sudo passwd douwe
    
    # See https://unix.stackexchange.com/questions/507571/how-to-allow-folder-permission-for-another-user-in-linux
    # Create a group shared and add users delta and douwe to it.
    sudo groupadd shared
    sudo usermod --append --groups shared delta
    sudo usermod --append --groups shared douwe
    sudo usermod --append --groups shared www-data
    
    sudo mkdir --parents          /home/data
    sudo chmod 2770               /home/data
    sudo chgrp --recursive shared /home/data
    
    sudo mkdir --parents           /var/www/html/docs
    sudo chmod 2770                /var/www/html/docs
    sudo chgrp ---recursive shared /var/www/html/docs
    scp -p delta@10.10.1.2:/media/Windows/Software/_Delta/delta-linux-tools-1.9.1-1-all.deb .
    sudo dpkg -i delta-linux-tools-1.9.1-1-all.deb
    
    sudo delta config bash                          # Configure bash shell for each user.
    sudo delta config cron                          # Configure cron jobs.
    sudo delta config editor                        # Set default editor to vim.tiny for each user.
    sudo delta config locale                        # Configure locale settings.
    
    sudo delta setup openssh                        # Install and configure openssh server.
    
    sudo passwd                                     # Set root password.
    sudo delta setup sudo                           # Install and configure sudo for each user.
    
    sudo delta setup ntp                            # Install and configure network time.
    sudo delta setup rsyslog                        # Install and configure rsyslog logging daemon.
    sudo delta setup timezone                       # Install and configure time zone.
    sudo delta setup basic-tools                    # Install basic commands like curl and wget.
    sudo delta setup ufw                            # Install and configure uncomplicated firewall.
    sudo delta setup vim                            # Install and configure vim editor for each user.
  • Restart the computer.

9. Documentation

  • Enter the following commands at a Command Line.

    sudo apt-get --yes install devscripts           # Needed for checkbashisms.
    sudo apt-get --yes install gawk                 # Needed for ansi2html.
    sudo apt-get --yes install make
    sudo apt-get --yes install python3
    sudo apt-get --yes install shellcheck           # Needed for shellcheck.
    sudo apt-get --yes install colorized-logs       # Needed for ansi2html, used by search.
    sudo apt-get --yes install fonts-thai-tlwg      # Thai fonts.
    
    
    sudo delta setup apache                         # Install and configure apache http server.
    sudo apt-get --yes install libharfbuzz0b        # Needed  for jre-headless.
    
    sudo delta setup jre-headless                   # Needed for diagrams support.
    sudo delta setup php                            # Needed for search.
    sudo delta setup ruby                           # Needed for asciidoctor.
    
    
    # Manual.
    sudo apt-get install --yes default-jre-headless
    sudo apt-get install --yes php php-curl php-gd php-mbstring php-mysql php-pgsql php-xml
    sudo apt-get install --yes ruby
    
    # Save file with list of pre-installed gems.
    file="/root/rubygems.org"
    if [ ! -f "${file}" ]; then
      gem list > "${file}"
    fi
    
    
    
    sudo delta setup vim                            # Install and configure vim editor for each user.
    sudo    delta config vim powershell             # Add powershell syntax highlighting.
    
    sudo    delta setup asciidoctor
    sudo    delta update asciidoctor
    
    
    # Manual.
    gem install asciidoctor
    gem install asciidoctor-diagram
    gem install asciidoctor-diagram-ditaamini
    gem install --prerelease asciidoctor-pdf
    gem install --prerelease asciidoctor-tabs
    gem install gem-path
    gem install pygments.rb
    
    gem update asciidoctor
    gem update asciidoctor-diagram
    gem update asciidoctor-diagram-ditaamini
    gem update --prerelease asciidoctor-pdf
    gem update --prerelease asciidoctor-tabs
    gem update gem-path
    gem update pygments.rb
    
    
    which asciidoctor asciidoctor-pdf
    asciidoctor --version                           # 2.0.26
    asciidoctor-pdf --version                       # 2.3.24
    
    sudo mkdir -p /var/www/html/docs
    ls -ald /var/www/html/docs                              # drwxr-xr-x 2 root root 4096 2026-04-06 19:46:35 /var/www/html/docs
    curl --silent http://localhost | grep -i "it works!"    # It works!
    sudo make clean
    sudo make                                               # make: check-adoc-links: No such file or directory
                                                            # make: check-adoc-syntax: No such file or directory
    # Temp fix for missing check-adoc-links and check-adoc-syntax commands.
    sudo touch    /usr/local/bin/check-adoc-links
    sudo touch    /usr/local/bin/check-adoc-syntax
    sudo chmod +x /usr/local/bin/check-adoc-links
    sudo chmod +x /usr/local/bin/check-adoc-syntax
    
    
    
    
    sudo ufw allow http
    sudo ufw status verbose
    # Browse to http://185.62.58.28
    # Browse to http://185.62.58.28/docs
    # Browse to http://deltasoftware.frl
    # Browse to http://deltasoftware.frl/docs
    
    
    
    
    sudo delta setup git
    mkdir -p ~delta/github/git/delta-software-labs
    cd ~delta/github/git/delta-software-labs
    mkdir -p /home/data/github/git/delta-software-labs
    cd /home/data/github/git/delta-software-labs
    git clone https://delta-software-labs@github.com/delta-software-labs/Documentation.git
    # Type the GitHub - PAT (Personal Access Token) stored in KeePass Password Manager.
    
    cd ~delta/github/git/delta-software-labs/Documentation
    make clean; make
    make check

10. Proton Mail

11. Change User Name

  • Enter the following commands at a Command Prompt with standard privileges.

    wsl.exe -d Debian -u root usermod -l delta smru
    wsl.exe -d Debian -u root groupmod -n delta smru
    wsl.exe -d Debian -u root usermod -d /home/delta -m delta

12. Problems

See *https://support.atlassian.com/bitbucket-cloud/kb/git-command-returns-fatal-error-detected-dubious-ownership[^].

+

# Log in as douwe.
cd /home/data/github/git/delta-software-labs/Documentation
ls -ald
# Notice that directory is owned by user delta.
git status
# Notice the fatal error.

+

drwxrwsr-x 35 delta shared 4096 2026-02-10 11:45:30 .

fatal: detected dubious ownership in repository at '/home/data/github/git/delta-software-labs/Documentation'
To add an exception for this directory, call:

        git config --global --add safe.directory /home/data/github/git/delta-software-labs/Documentation

13. Cosmic DE

  • Enter the following commands at a Command Prompt with administrative privileges.

    wsl.exe --update
  • See https://software.opensuse.org/download/package?package=cosmic-osd&project=home%3Anomispaz%3Adebian%3Acosmic-desktop

    apt-get install curl gpg
    
    echo 'deb http://download.opensuse.org/repositories/home:/nomispaz:/debian:/cosmic-desktop/Debian_13/ /' |
      sudo tee /etc/apt/sources.list.d/home:nomispaz:debian:cosmic-desktop.list
    curl -fsSL https://download.opensuse.org/repositories/home:nomispaz:debian:cosmic-desktop/Debian_13/Release.key |
      gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/home_nomispaz_debian_cosmic-desktop.gpg > /dev/null
    sudo apt update
    sudo apt install cosmic-session
  • Install VirtualBox Guest Additions.

    mkdir -p /mnt/cdrom
    mount -t iso9660 -o ro /dev/sr0 /mnt/cdrom
    cp -a /mnt/cdrom/VBoxLinuxAdditions.run /opt
    umount /mnt/cdrom
    apt-get install gcc make perl
    apt-get install linux-headers-$(uname -r)
  • Restart the computer.

  • See https://github.com/olafkfreund/cosmic-ext-rdp-server.

    sudo apt install libpipewire-0.3-dev libei-dev libwayland-dev libxkbcommon-dev \
      libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libssl-dev \
      libfontconfig-dev libfreetype-dev libgl-dev libegl-dev \
      libvulkan-dev libdbus-1-dev clang
    
    sudo apt install libpipewire-0.3-dev libei-dev libwayland-dev libxkbcommon-dev \
      libglib2.0-dev libfontconfig-dev libfreetype-dev libgl-dev libegl-dev \
      libvulkan-dev libdbus-1-dev libgbm-dev clang
    
    sudo apt install libwayland-dev libxkbcommon-dev libinput-dev libegl-dev \
      libgl-dev libseat-dev libei-dev libsystemd-dev libfontconfig-dev \
      libpixman-1-dev libdisplay-info-dev clang
    
    sudo apt-get install just
    just  --version                 # just 1.40.0
    
    # The cosmic-ext-rdp-server repo needs rustc => 1.89
    # The cosmic-ext-comp-rdp repo needs rustc => 1.90
    
    # See https://linuxcapable.com/how-to-install-rust-on-debian-linux
    sudo apt install curl ca-certificates build-essential
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    # Type 1 or press Enter to accept the default stable toolchain.
    # Type 2 if you want to customize the installation profile or default toolchain.
    # Type 3 to cancel without changing the system.
    source ~/.cargo/env
    
    cargo --version                 # cargo 1.94.0 (85eff7c80 2026-01-15)
    rustc --version                 # rustc 1.94.0 (4a4ef493e 2026-03-02)
    
    mkdir -p ~/debian/source
    cd ~/debian/source
    git clone https://github.com/olafkfreund/cosmic-ext-rdp-server.git
    git clone https://github.com/olafkfreund/xdg-desktop-portal-cosmic.git
    git clone https://github.com/olafkfreund/cosmic-ext-comp-rdp.git
    
    cd ~/debian/source/cosmic-ext-rdp-server
    cargo build --release
    ls -al target/release
    sudo just install-all
    
    cd ~/debian/source/xdg-desktop-portal-cosmic
    cargo build --release
    ls -al target/release
    sudo make install
    
    cd ~/debian/source/cosmic-ext-comp-rdp
    cargo build --release
    ls -al target/release
    sudo install -Dm0755 target/release/cosmic-comp /usr/bin/cosmic-comp
    
    # Create folder for configuration.
    mkdir -p .config/cosmic-ext-rdp-server
  • Contents of the ~/.config/cosmic-ext-rdp-server/config.toml file.

    # Network
    bind = "0.0.0.0:3389"
    
    # TLS (omit for self-signed)
    # cert_path = "/etc/cosmic-ext-rdp-server/cert.pem"
    # key_path = "/etc/cosmic-ext-rdp-server/key.pem"
    
    # Static blue screen mode (for testing)
    static_display = false
    
    # NLA Authentication (CredSSP)
    [auth]
    #enable = false
    #username = ""
    #password = ""
    enable = true
    username = "delta"
    password = "<level 2>"
    # domain = "WORKGROUP"
    
    # Screen capture
    [capture]
    fps = 30
    channel_capacity = 4
    multi_monitor = false
    swap_colors = true    # R/B channel swap for COSMIC portal (default: true)
    
    # Video encoding
    [encode]
    encoder = "auto"       # "auto", "vaapi", "nvenc", or "software"
    preset = "ultrafast"
    bitrate = 10000000     # bits per second
    
    # Clipboard sharing
    [clipboard]
    enable = true
    
    # Audio forwarding (RDPSND)
    [audio]
    enable = true
    sample_rate = 44100
    channels = 2
  • Quick start.

    # Start the server with defaults (binds to 0.0.0.0:3389, self-signed TLS).
    cosmic-ext-rdp-server
    
    # Start with a static blue screen (for testing, no portal needed).
    cosmic-ext-rdp-server --static-display
    
    cosmic-ext-rdp-server --addr 0.0.0.0 --port 3389
    2026-03-18T13:14:41.869459Z  INFO rdp_dbus::config: Configuration loaded path="/home/delta/.config/cosmic-ext-rdp-server/config.toml"
    2026-03-18T13:14:41.877720Z  INFO cosmic_ext_rdp_server::dbus: D-Bus server started service="io.github.olafkfreund.CosmicExtRdpServer"
    2026-03-18T13:14:41.878060Z  INFO cosmic_ext_rdp_server::tls: Generating self-signed TLS certificate
    2026-03-18T13:14:41.887884Z  INFO cosmic_ext_rdp_server: NLA authentication enabled username=delta
    2026-03-18T13:14:41.887920Z  INFO cosmic_ext_rdp_server: Starting cosmic-ext-rdp-server bind=0.0.0.0:3389
    2026-03-18T13:14:42.336180Z  WARN cosmic_ext_rdp_server: Failed to start screen capture: ScreenCast portal session failed
    2026-03-18T13:14:42.336223Z  INFO cosmic_ext_rdp_server: Falling back to static blue screen display
    2026-03-18T13:14:42.336229Z  INFO cosmic_ext_rdp_server: Clipboard sharing enabled
    2026-03-18T13:14:42.336231Z  INFO cosmic_ext_rdp_server: Audio forwarding enabled (RDPSND) channels=2 sample_rate=44100
    2026-03-18T13:14:42.337011Z  INFO cosmic_ext_rdp_server::egfx: EGFX: event sender configured
    2026-03-18T13:14:42.337036Z  INFO cosmic_ext_rdp_server::server: NLA credentials configured username=delta
    2026-03-18T13:14:56.996262Z  WARN rustls::msgs::handshake: Illegal SNI extension: ignoring IP address presented as hostname (3137322e32322e38382e313030)
    2026-03-18T13:14:57.157629Z  INFO ironrdp_cliprdr: CLIPRDR(clipboard) virtual channel has been initialized
    2026-03-18T13:14:57.157702Z  INFO cosmic_ext_rdp_server::clipboard: CLIPRDR channel ready
    2026-03-18T13:14:57.163897Z  INFO cosmic_ext_rdp_server::sound: Starting audio capture for RDPSND channels=2 sample_rate=44100
    2026-03-18T13:14:57.168373Z  INFO rdp_capture::audio_stream: PipeWire audio stream connected channels=2 sample_rate=44100
    2026-03-18T13:14:57.171839Z  WARN cosmic_ext_rdp_server::clipboard: Failed to write to local clipboard: Unknown error while interacting with the clipboard: X11 server connection timed out because it was unreachable
    2026-03-18T13:14:57.561716Z  INFO cosmic_ext_rdp_server::egfx: EGFX: channel ready negotiated=V10 { flags: CapabilitiesV10Flags(0x0) }

sudo systemctl --type=service ● cosmic-greeter.service loaded failed failed COSMIC Greeter * Comment out the Restart lines in the /usr/lib/systemd/system/cosmic-greeter.service file.

14. Nix

  • See https://nixos.org/download.

    sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon
  • Restart the computer.

    nix --version                   # nix (Nix) 2.34.1
    nix-env --version               # nix-env (Nix) 2.34.1
    nix-channel --version           # nix-channel (Nix) 2.34.1
    
    nix-channel --help
    nix-channel --list
    nix-channel --add https://nixos.org/channels/nixpkgs-unstable
    nix-channel --list
    
    mkdir -p ~/.config/nix
  • Contents of the ~/.config/nix/nix.conf file.

    extra-experimental-features = flakes
    extra-experimental-features = nix-command
    cd ~/debian/source/cosmic-ext-rdp-server
    nix develop             # Enter dev shell with all dependencies.
    just build-release      # Build release binary.
    just test               # Run tests.
    ls -al target/release
    sudo just install-all
    
    cd ~/debian/source/xdg-desktop-portal-cosmic
    nix develop             # Enter dev shell with all dependencies.
    make                    # Build release binary.
    ls -al target/release
    sudo make install
    
    cd ~/debian/source/cosmic-ext-comp-rdp
    nix develop             # Enter dev shell with all dependencies.
    cargo build --release   # Build release binary.
    ls -al target/release
    
    # See https://nix-community.github.io/home-manager/index.xhtml#sec-install-standalone
    cat config1
    cat config2
    cat config3
    ???
    
    sudo install -Dm0755 target/release/cosmic-comp /usr/bin/cosmic-comp