Windows 10 wsl2 kde

Время на прочтение9 мин

Количество просмотров99K

Введение

Данная статья предназначена вниманию системных администраторов, которые подготавливают типовые рабочие места на компьютерах под управлением ОС Windows 10, в том числе для разработчиков ПО.

Следует отметить, что существует определенная проблема, связанная с невозможностью интеграции ПО, полученного в on-line магазине Microsoft Store для использования в пользовательском образе Windows 10. Не вдаваясь в подробности уточню, что данная проблема связана с тем, что установленные из Microsoft Store программы связываются со служебной учетной записью Administrator, и при завершении создания пользовательского образа утилитой sysprep возникают обусловленные этим обстоятельством ошибки.

Рассмотренный в данной статье способ позволить избежать такой проблемы при подготовке образа ОС Windows 10 с предварительно настроенной подсистемой WSL2, а также с заранее подготовленным и настроенным образом ОС Ubuntu 20.04 с GUI KDE Plasma, который в свою очередь может иметь свой набор пользовательского ПО.

В сети Интернет имеется большое количество примеров и руководств по настройке подсистем WSL (т.е. WSL1 и сравнительно новой WSL2), с настройкой GUI интерфейса для linux систем на базе ОС начиная с версии Ubuntu 16.04 и заканчивая Ubuntu 20.04, но в основном это касалось рабочих столов на основе т.н. «легковесного» xfce4, имеющий вполне объяснимые ограничения в пользовательских настройках. Но что касается GUI KDE Plasma для Ubuntu 20.04, в сети не нашлось какой-либо существенной информации. Но именно этот вариант предоставляет конечному пользователю практически неограниченный набор настроек как внешнего вида системы, так и настроек оборудования, конечно с учетом текущих возможностей интеграции linux-систем, реализованных в подсистеме WSL2.

Установка требуемого набора ПО и настройка WSL2

Проверяем текущую версию Windows, для этого в строке поиска Windows вводим команду winver и получаем примерно следующее:

Важно, чтобы ОС имела версию 1903 или 1909 (указанные версии ОС должны быть с установленным накопительным обновлением KB4566116), либо 2004 (номер сборки не менее чем 19041), остальная информация не имеет значения. Если номер версии меньше, то для корректного повторения результатов, изложенных в данной статье, рекомендуется обновиться до последней версии Windows.

Для удобства дальнейших действий устанавливаем бесплатный Windows Terminal, используя Microsoft Store (также существует возможность загрузки из других источников):

Устанавливаем X Server X410 через тот же Microsoft Store, это ПО платное, но имеется бесплатный период в 15 дней, что вполне достаточно для проведения различных тестов.

В качестве бесплатной альтернативы X410 скачиваем и устанавливаем X-сервер VcXsrv.

В любом удобном месте на диске создаем каталог, в котором будем хранить наши файлы. В качестве примера создадим каталог C:\wsl.

Скачиваем и устанавливаем автономный установщик Ubuntu 20.04, распаковываем полученный файл с помощью архиватора (например 7-zip). Переименовываем распакованный каталог с длинным именем Ubuntu_2004.2020.424.0_x64 во что-то более приемлемое, например Ubuntu-20.04 и копируем его в каталог C:\wsl (далее по тексту просто \wsl).

Скачиваем и распаковываем в каталог \wsl кроссплатформенный звуковой сервер PulseAudio v.1.1., также вносим исправления в его конфигурационные файлы.

В файле \wsl\pulseaudio-1.1\etc\pulse\default.pa в разделе Load audio drivers statically редактируем строку:

load-module module-waveout sink_name=output source_name=input record=0

а в разделе Network access редактируем строку:

load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1

В файле \wsl\pulseaudio-1.1\etc\pulse\daemon.conf раскомментируем и изменяем строку

exit-idle-time = -1

Настраиваем подсистему WSL2 в соответствии с документацией Microsoft. Единственное замечание — дистрибутив Ubuntu мы уже скачали, и устанавливать его будем на следующем шаге. В основном, настройка сводится к включению дополнительных компонентов «Подсистема Windows для Linux» и «Платформа виртуальной машины», и последующей перезагрузки для применения изменений в настройках компьютера:

При необходимости скачиваем и устанавливаем пакет обновлений для ядра Linux в WSL2.
Запускаем Windows Terminal и выбираем режим работы Command Prompt нажатием клавиш Ctrl+Shift+2.

В первую очередь устанавливаем режим работы WSL2, для этого вводим команду:

wsl  --set-default-version 2

Переходим в каталог с автономным загрузчиком Ubuntu 20.04, в моем случае это \wsl\Ubuntu-20.04 и запускаем файл ubuntu2004.exe. При появлении запроса имени пользователя указываю имя engineer (можно ввести любое другое имя), ввести свой пароль и подтвердить введенный пароль для указанной учетной записи:

Появилась строка приглашения терминала, ядро Ubuntu 20.04 установлено. Проверим правильность настройки режима WSL2, для этого в Windows Terminal выбираем закладку Windows PowerShell и вводим команду:

wsl -l -v

результат выполнения должен быть такой:

Настраиваем брандмауэр Microsoft Defender, т.е. отключаем его для общедоступной сети:

Настройка Ubuntu 20.04

В Windows Terminal снова выбираем закладку Command Prompt и устанавливаем обновления для Ubuntu 20.04. Для этого в командной строке вводим:

sudo apt update && sudo apt upgrade –y

Устанавливаем рабочий стол KDE Plasma:

sudo apt install kubuntu-desktop -y

установка занимает до 30 минут в зависимости от производительности компьютера и пропускной способности канала доступа в Internet, при появлении запроса установщика подтверждаем OK.
Устанавливаем русскую локализацию и словари Ubuntu 20.04. Для этого в командной строке вводим:

sudo apt install language-pack-ru language-pack-kde-ru -y
sudo apt install libreoffice-l10n-ru libreoffice-help-ru -y
sudo apt install hunspell-ru mueller7-dict -y
sudo update-locale LANG=ru_RU.UTF-8
sudo dpkg-reconfigure locales # примечание: выбираем ru_RU.UTF-8 UTF-8, см. скриншоты ниже.
sudo apt-get install --reinstall locales

Добавляем последнюю версию рабочего стола KDE Plasma:

sudo add-apt-repository ppa:kubuntu-ppa/backports
sudo apt update && sudo apt full-upgrade -y

Добавляем свой набор консольных приложений, например mc и neofetch:

sudo apt install mc neofetch -y

Проверяем, что получилось, вводим в командную строку neofetch, см. скриншот:

Редактируем конфигурационный файл WSL /etc/wsl.conf:

sudo nano /etc/wsl.conf

в открывшееся пустое окно текстового редактора копируем текст:

[automount]
enabled = true
root = /mnt
options = «metadata,umask=22,fmask=11»
mountFsTab = true
[network]
generateHosts = true
generateResolvConf = true
[interop]
enabled = true
appendWindowsPath = true

сохраняем изменения (Ctrl+O), подтверждаем операцию и выходим из текстового редактора (Ctrl+X).

Экспортируем настроенный образ Ubuntu-20.04 в созданный нами каталог \wsl. Для этого в Windows Terminal снова выбираем закладку Windows PowerShell и вводим команду:

wsl --export Ubuntu-20.04 c:\wsl\Ubuntu-plasma-desktop

созданный образ поможет нам автоматизировать операции запуска/переустановки настроенной Ubuntu 20.04, при необходимости позволит легко перенести на другой компьютер.

Подготовка bat-файлов и ярлыков на рабочий стол Windows

С помощью редактора Notepad++ создаем bat-файлы (обязательно в кодировке OEM-866 для корректного вывода символов кириллицы):
Файл Install-Ubuntu-20.04-plasma-desktop.bat — предназначен для автоматизации первоначальной установки созданного образа Ubuntu 20.04 на компьютере с уже настроенной подсистемой WSL2 и X-сервером. Если имя пользователя и пароль отличается от указанных в примере, то необходимо внести соответствующие изменения в этот bat-файл:

@echo off
wsl --set-default-version 2
cls
echo Ожидайте окончания установки дистрибутива Ubuntu-20.04...
wsl --import Ubuntu-20.04 c:\wsl c:\wsl\Ubuntu-plasma-desktop
wsl -s Ubuntu-20.04
cls
echo Дистрибутив Ubuntu-20.04 успешно установлен!
echo Не забудьте сменить учетную запись по умолчанию «root» на существующую учетную запись пользователя,
echo либо используйте предустановленную учетную запись «engineer», пароль: «password».
pause

Файл Reinstall-Ubuntu-20.04-plasma-desktop.bat — предназначен для переустановки подготовленного образа Ubuntu 20.04 на компьютере.

@echo off
wsl --unregister Ubuntu-20.04
wsl --set-default-version 2
cls
echo Ожидайте окончания переустановки дистрибутива Ubuntu-20.04...
wsl --import Ubuntu-20.04 c:\wsl c:\wsl\Ubuntu-plasma-desktop
wsl -s Ubuntu-20.04
cls
echo Дистрибутив Ubuntu-20.04 успешно переустановлен!
pause

Файл Set-default-user.bat — для установки пользователя «по умолчанию».

@echo off
set /p answer=Введите существующую учетную запись в Ubuntu (engineer):
c:\wsl\Ubuntu-20.04\ubuntu2004.exe config --default-user %answer%
cls
echo Учетная запись пользователя %answer% в Ubuntu-20.04 установлена по умолчанию!
pause

Файл Start-Ubuntu-20.04-plasma-desktop.bat — собственно запуск рабочего стола KDE Plasma.

@echo off
echo ===================================== Внимание! ============================================
echo  Для корректной работы GUI Ubuntu 20.04 в WSL2 необходимо использовать X Server.
echo  Примечание: в случае использования VcXsrv Windows X Server необходимо раскомментировать
echo  строки в файле Start-Ubuntu-20.04-plasma-desktop.bat, содержащие "config.xlaunch" и
echo  "vcxsrv.exe", и закомментировать все строки, содержащие "x410".
echo ============================================================================================
rem start "" /B "c:\wsl\vcxsrv\config.xlaunch" > nul
start "" /B x410.exe /wm /public > nul
start "" /B "c:\wsl\pulseaudio-1.1\bin\pulseaudio.exe" --use-pid-file=false -D > nul
c:\wsl\Ubuntu-20.04\Ubuntu2004.exe run "if [ -z \"$(pidof plasmashell)\" ]; then cd ~ ; export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0 ; setxkbmap us,ru -option grp:ctrl_shift_toggle ; export LIBGL_ALWAYS_INDIRECT=1 ; export PULSE_SERVER=tcp:$(grep nameserver /etc/resolv.conf | awk '{print $2}') ; sudo /etc/init.d/dbus start &> /dev/null ; sudo service ssh start ; sudo service xrdp start ; plasmashell ; pkill '(gpg|ssh)-agent' ; fi;"
rem taskkill.exe /F /T /IM vcxsrv.exe > nul
taskkill.exe /F /T /IM x410.exe > nul
taskkill.exe /F /IM pulseaudio.exe > nul

Файл Start-Ubuntu-20.04-terminal.bat — запуск графического терминала без рабочего стола KDE Plasma.

@echo off
echo ===================================== Внимание! ============================================
echo  Для корректной работы GUI Ubuntu 20.04 в WSL2 необходимо использовать X Server.
echo  Примечание: в случае использования VcXsrv Windows X Server необходимо раскомментировать
echo  строки в файле Start-Ubuntu-20.04-plasma-desktop.bat, содержащие "config.xlaunch" и
echo  "vcxsrv.exe", и закомментировать все строки, содержащие "x410".
echo ============================================================================================
rem start "" /B "c:\wsl\vcxsrv\config.xlaunch" > nul
start "" /B x410.exe /wm /public > nul
start "" /B "c:\wsl\pulseaudio-1.1\bin\pulseaudio.exe" --use-pid-file=false -D > nul
c:\wsl\Ubuntu-20.04\Ubuntu2004.exe run "cd ~ ; export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0 ; export LIBGL_ALWAYS_INDIRECT=1 ; setxkbmap us,ru -option grp:ctrl_shift_toggle ; export PULSE_SERVER=tcp:$(grep nameserver /etc/resolv.conf | awk '{print $2}') ; sudo /etc/init.d/dbus start &> /dev/null ; sudo service ssh start ; sudo service xrdp start ; konsole ; pkill '(gpg|ssh)-agent' ;"
taskkill.exe /F /T /IM x410.exe > nul
rem taskkill.exe /F /T /IM vcxsrv.exe > nul
taskkill.exe /F /IM pulseaudio.exe > nul

Также для удобства использования в каталоге \wsl подготавливаем ярлыки, указывающие на соответствующие bat-файлы. После чего содержимое каталога \wsl выглядит следующим образом:

Запуск рабочего стола KDE Plasma

Проверяем, что все подготовительные действия выполнены, пробуем запустить ярлык Plasma-desktop. Появляется запрос пароля, вводим пароль для учетной записи и… окно закрывается. В первый раз это нормально. Пробуем еще раз — и видим знакомую панель задач KDE Plasma. Настраиваем требуем внешний вид панели задач, на примере для удобства использования панель переносится в правую часть экрана и центрируется. Проверяем настройки локализации, при необходимости добавляем русский язык:

При необходимости выносим ярлыки для установленных linux-приложений на панель задач KDE Plasma.

Если Ubuntu 20.04 требует выйти из учетной записи пользователя для применения изменений в настройках, или Вам необходимо перезагрузить ОС, для этого в Windows Terminal введите команду:

wsl -d Ubuntu20.04 --shutdown

С помощью ярлыка Plasma-desktop или Konsole можно запустить GUI KDE Plasma Ubuntu 20.04. Например, установим с помощью Konsole графический редактор GIMP:

После окончания установки запускаем из Konsole графический редактор GIMP:

GIMP работает, что и требовалось проверить.
А вот как работают различные linux-приложения в KDE Plasma в WSL2:

настроенная панель задач KDE Plasma находится в правой части экрана. а видео в окне Firefox воспроизводится со звуком.

При необходимости можно настроить доступ к Ubuntu20.04 по SSH и RDP, для этого необходимо установить соответствующие службы командой:

sudo apt install ssh xrdp -y

примечание: для включения парольного доступа по SSH необходимо отредактировать файл /etc/ssh/sshd_config, а именно параметр PasswordAuthentication no необходимо установить в значение PasswordAuthentication yes, сохранить изменения и перезагрузить Ubuntu20.04.

При каждом запуске Ubuntu20.04 меняется внутренний ip-адрес, перед настройкой удаленного доступа необходимо уточнить текущий ip-адрес с помощью команды ip a:

Соответственно, этот ip-адрес необходимо внести в настройки сессий SSH и RDP перед запуском.
Вот так выглядит удаленный доступ по SSH с помощью MobaXterm:

А вот так выглядит удаленный доступ по RDP:

Использование X-сервера vcxsrv вместо x410

Запускаем и настраиваем vcxsrv, внимательно устанавливаем соответствующие флажки:

Сохраняем настроенную конфигурацию в каталоге \wsl\vcxsrv со стандартным именем config.xlaunch.

Редактируем bat-файлы Start-Ubuntu-20.04-plasma-desktop.bat и Start-Ubuntu-20.04-terminal.bat в соответствии с имеющимися в них инструкциями.

Запускаем ярлык Plasma-desktop, и вот что получаем:

Рабочий стол KDE Plasma полностью закрывает рабочий стол Windows, для переключения между окнами linux- и windows-приложений используем известную комбинацию клавиш Alt+Tab, что не совсем удобно.
Кроме того, выяснилась неприятная особенность X-сервера vcxsrv – он «падает» при запуске некоторых приложений, в частности того же GIMP или LibreOffice Writer. Возможно следует подождать, когда разработчики уберут замеченные «баги», но это не точно… Так что для получения приемлемых результатов лучше использовать X Server Microsoft x410.

Заключение

Все-таки надо отдать должное компании Microsoft, продукт WSL2 получился вполне рабочим, и на мой неискушенный взгляд — весьма удачным. И насколько мне известно, разработчики продолжают усиленно его «допиливать», и возможно — через годик-другой, данная подсистема предстанет во всей своей функциональной полноте.

Installing KDE on WSL2

Inspiration:
https://www.most-useful.com/kde-plasma-on-wsl.html

Setup

  1. Update WSL
    • In windows command prompt run: wsl --update
  2. Add systemd to ubuntu
    • In ubuntu prompt run: sudo nano /etc/wsl.conf
    • Add the following to the file:
      [boot]
      systemd=true
      
    • Save and exit by pressing ctrl + o and then ctrl + x
    • Shutdown WSL by running the following in the windows command prompt: wsl --shutdown
    • Restart WSL by opening a new terminal session for Ubuntu

Installing KDE

sudo apt update

sudo apt install kubuntu-desktop

Select SDDM as display manager during setup

sudo apt install lightdm

During installation, select lightdm as default display manager using arrow keys

Edit the lightdm configuration as follows:

sudo nano /etc/lightdm/lightdm.conf

Add the following text

[Seat:*]
user-session=plasma

[LightDM]
start-default-seat=false

[XDMCPServer]
enabled=true
port=177

Save and exit by pressing ctrl + o and then ctrl + x

Setting up x server

Download and install this software for windows:

https://sourceforge.net/projects/vcxsrv/

Launch Desktop

  • From windows open the XLaunch program
  • Select the One window without titlebar option and click Next
  • Selct Open session via XDMCP and click next
  • In your ubuntu terminal you need to get the ip address of the wsl2 instance:
    • Run: sudo apt install net-tools
    • Run: ifconfig eth0 | grep inet
    • The ip address will be listed after the inet item and usually looks like 172.xxx.xxx.xxx
  • Copy the ip address above and paste into the text box next to Connect to host in the XLaunch window and click next
  • Modify the default settings to uncheck Native opengl and check Disable access control
  • Click Next
  • Click Save configuration and save the file to your desktop and name the file whatever you want
  • VITALLY IMPORTANT: When you first run VcXSrv (or XLaunch) you’ll get a Windows Firewall popup. You will need to allow it to accept connections on both the PRIVATE and PUBLIC networks. If you don’t allow PUBLIC networks you will not get a connection as the WSL Virtual Network is considered to be PUBLIC
  • Click Finish

Speeding up KDE

Fixing rendering

  • From the KDE desktop, click the start menu, go to Computer then click System Settings
  • Underneath Hardware in the left panel, click Display and Monitor
  • Select Compositor from the left panel
  • Change the rendering backend to XRender
  • Check Enable compositor on startup
  • Click Apply

Cover image for Setting up Arch Linux with KDE Plasma in Windows Subsystem for Linux 2

Yup, you read that right. Sounds crazy, I know. But entirely possible, and surprisingly usable. Pretty easy too.

Enabling Windows Subsystem for Linux

Follow this official guide — Windows Subsystem for Linux Installation Guide for Windows 10 — to enable WSL on Windows. Make sure you follow till step 5 of the manual method to have WSL2 as default. Everything is explained in great detail in the guide.

Now, there are two ways to install Arch — the first one is extremely easy and preferable, and the second is for those who like to have more fine-grain control over stuff.

Installing Arch Linux — Method I

Arch Linux used to be an official app on the Windows Store some time ago, but the Arch community isn’t onboard with the concept of WSL, or they aren’t exactly comfortable with how easy WSL makes Linux installations for Windows users. Not to worry though, since both Arch Linux and the WSL kernel are open source, you can just easily install it manually too. Follow the steps given in this short guide How to Setup | ArchWSL Documentation.

Installing Arch Linux — Method II

We will use a tool called LxRunOffline to install and manage WSLs on our system. Open up Administrator CMD and run the following commands:

cd %USERPROFILE%\Downloads
curl -LO https://github.com/DDoSolitary/LxRunOffline/releases/download/v3.5.0/LxRunOffline-v3.5.0-msvc.zip
powershell -c Expand-Archive LxRunOffline-v3.5.0-msvc.zip
cd LxRunOffline-v3.5.0-msvc
copy LxRunOffline.exe C:\Windows

Enter fullscreen mode

Exit fullscreen mode

The last line copies the LxRunOffline.exe file to a location which is included in PATH environment variable, so that we can call this from anywhere. Here, for example, it copies this to ‘C:\Windows’ (this is why elevated access is required).

Now, we have to download Arch rootfs. In CMD, run:

cd %USERPROFILE%\Downloads
curl -LO https://mirrors.edge.kernel.org/archlinux/iso/2020.12.01/archlinux-bootstrap-2020.12.01-x86_64.tar.gz

Enter fullscreen mode

Exit fullscreen mode

Once the download is complete, we can instruct LxRunOffline to start the extraction:

mkdir D:\WSL\Arch
LxRunOffline i -n Arch -d D:\WSL\Arch\ -f %USERPROFILE%\Downloads\archlinux-bootstrap-2020.12.01-x86_64.tar.gz -r root.x86_64

Enter fullscreen mode

Exit fullscreen mode

Instead of ‘D:\WSL\Arch\’, you can specify any location path. Also, make sure the path doesn’t have any spaces (Linux doesn’t like spaces). This can take a bit of time.

After that, run:

wsl --set-version Arch 2
wsl ~ -d Arch

Enter fullscreen mode

Exit fullscreen mode

By default, Arch is installed as an instance of WSL1. We don’t want that, so the first line fixes that. The second line runs the Arch distribution (the ‘~’ tells it to open in the default home directory).

Now the rootfs we downloaded was an absolute minimal install, and includes nothing by default. To add to the problem, the package manager pacman wouldn’t run because all the mirrors in ‘/etc/pacman.d/mirrorlist’ are commented by default, and we don’t even have a text editor to uncomment them! To fix this, we just open it in notepad (life hack!):

notepad.exe /etc/pacman.d/mirrorlist

Enter fullscreen mode

Exit fullscreen mode

Uncomment the three worldwide mirrors (or the ones based on your location). After that, we will install the basic utilities and a terminal text editor:

pacman-key --init
pacman-key --populate archlinux
pacman -Sy base base-devel nano

Enter fullscreen mode

Exit fullscreen mode

Next we’d want to add a non-root user. Run the following to create a user username and give it a password:

useradd -m -G wheel username
passwd username
EDITOR=nano visudo

Enter fullscreen mode

Exit fullscreen mode

Here, uncomment the line that says %wheel ALL=(ALL) ALL, save and exit the editor.

Exit Arch. To make this new user the default user of Arch, run this in CMD:

LxRunOffline su -n Arch -v 1000

Enter fullscreen mode

Exit fullscreen mode

The next time you start Arch, it’ll start as username.

Installing KDE Plasma

After you’ve created a non-root user, run the following commands in Arch’s bash shell to update existing packages and install the KDE Plasma desktop environment:

sudo pacman -Syu plasma

Enter fullscreen mode

Exit fullscreen mode

Now there are multiple ways of enabling displays in WSL2 — X display forwarding, Virtual Network Computing and Remote Desktop Protocol. We’ll cover two of them, first X and second VNC. While I was able to set up RDP connections in Debian-based WSLs, I couldn’t get it to work in Arch.

The first method is extremely easy — just a few clicks — and doesn’t involve inputting commands. However, it might not be as responsive and reliable (when you might have multiple WSL distros) as the second. The second method requires heavy use of the commandline — for installing packages and editing configs.

Enabling GUI display — Method I

Configuring a proper X-server for WSL was always a pain, until now. Enter GWSL, a preconfigured X-server that uses VcXsrv under the hood. Since it is a general purpose X-server, it can be used for making graphical SSH connections, launching individual Linux apps and other cool stuff. Here we’ll just press a couple of buttons to start KDE in Arch.

First run

Go to the Store page or pull down the latest release from its releases page and install it. Upon first launch, it’ll ask for Firewall permissions; give it both Public and Private access. Once that’s done, right click on the icon on the taskbar and set the Default Window Mode to ‘Single Window Mode’. This is done because we want to launch the DE as a whole; this can be skipped if you just want to run Linux app GUIs in their own separate windows, through the Linux apps option in GWSL dashboard (after exporting the display variable).

Export environment variable

Once that’s done, left-click on the same icon to pull up the GWSL Dashboard. From there, select GWSL Distro Tools (and select Arch from there if you have multiple distros). Click on ‘Auto-Export Display’. It’ll automatically restart Arch for the changes to take effect.

Command shortcut

Now we need to tell GWSL how to launch KDE. Open up the dashboard again and select Shortcut Creator. In this window:

  • Put a name of your choice in the ‘Shortcut Label’ field, for example KDE-Plasma.
  • The ‘Shortcut Command’ is dbus-launch startplasma-x11.
  • For the ‘Run In’ field, select Arch.

Click on ‘Add this to Start menu’ to finish.

Now launch this shortcut from the Start menu, and focus on the VcXsrv window. Viola, we’re in Plasma!

GWSL method

Enabling GUI display — Method II

VNC allows us to send input and receive graphical output over a network, and we’ll use TigerVNC server on our Arch subsystem and TigerVNC client on our Windows host system.

Configuring systemd

Arch Linux allows running VNC servers only as a system service, so we’ll have to make sure we have a usable systemd. This is also mentioned as an optional step in the How to Setup | ArchWSL Documentation page. We’ll use genie in this tutorial.

Installing genie would have been a lot easier, but unfortunately, because of reasons aforementioned, genie was pulled down from AUR. We can download and install the PKGBUILD (source) manually. The original PKGBUILD file has some license file issue, so I’ve modified the file and we’ll use that. Run the following in bash:

sudo pacman -S base-devel
curl -Lo PKGBUILD https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=daemonize
makepkg -si
rm PKGBUILD
curl -Lo PKGBUILD https://gist.githubusercontent.com/rashil2000/f148d5fd207eb30c43f269dcd4f7c6fb/raw/73db1b0a14634c23b35a01168b5068aee877b74c/PKGBUILD-release
makepkg -si
rm PKGBUILD

Enter fullscreen mode

Exit fullscreen mode

The first command installs the packages needed to build other packages manually (you might get a warning regarding fakeroot, press ‘n’ for that). The next three commands install daemonize, a dependency for genie. The last three install genie itself, from my modified PKGBUILD.

Installing VNC server

pacman can be used to install TigerVNC server, while we can directly download and run the Windows client binary.

sudo pacman -S tigervnc
curl -Lo ~/.local/bin/vncviewer.exe --create-dirs https://bintray.com/tigervnc/stable/download_file?file_path=vncviewer64-1.11.0.exe
chmod +x ~/.local/bin/vncviewer.exe
vncpasswd
sudo nano /etc/tigervnc/vncserver.users

Enter fullscreen mode

Exit fullscreen mode

You should immediately set a password for your VNC server using vncpasswd (you can skip view-only password). The last command opens up a config. file where you need to put a new line saying :1={username}, where username is the name of the non-root user you set earlier (remove the braces). See the examples given in that file if you’re confused.

Running VNC client

genie -i
genie -c sudo systemctl start vncserver@:1
~/.local/bin/vncviewer.exe -passwd ~/.vnc/passwd 127.0.0.1:1

Enter fullscreen mode

Exit fullscreen mode

The first command enables systemd. The second one starts up the VNC server as a service at the first VNC port. The third connects the Windows client to that server.

Viola, again! You’ll have to run these three commands every time you’d like to spin up the GUI.

VNC method

Enabling audio forwarding

coming soon

Again this is something that I was able to do only in Debian-based distros, through PulseAudio server. No luck in Arch yet…


This tutorial has been tested (somewhat) widely — on a 10-year-old PC, a modern gaming laptop and a current-gen Macbook (through Bootcamp).

Introduction


This article is intended for the attention of system administrators who prepare typical workplaces on computers running Windows 10, including software developers.


It should be noted that there is a certain problem related to the inability to integrate software obtained from the on-line Microsoft Store for use in a custom image of Windows 10. Without going into details, I will clarify that this problem is due to the fact that programs installed from the Microsoft Store are linked with the Administrator service account, and when the utility completes creating a custom image
sysprep, errors due to this circumstance occur.


The method discussed in this article to avoid such a problem when preparing an image of Windows 10 with a pre-configured WSL2 subsystem, as well as with a pre-prepared and configured image of Ubuntu 20.04 with the KDE Plasma GUI, which in turn may have its own set of custom software.


On the Internet there are a large number of examples and guides for configuring WSL subsystems (i.e. WSL1 and the relatively new WSL2), with configuring the GUI interface for linux systems based on OS starting from Ubuntu 16.04 and ending with Ubuntu 20.04, but mostly it concerned desktops based on the so-called.
«Lightweight» xfce4, which has understandable limitations in user settings. But as far as the KDE Plasma GUI for Ubuntu 20.04 is concerned, there was no substantial information on the net. But it is this option that provides the end user with an almost unlimited set of settings for both the appearance of the system and the hardware settings, of course, taking into account the current integration capabilities of linux systems implemented in the WSL2 subsystem.

Installing the required software suite and configuring WSL2


We check the current version of Windows, for this, in the Windows search bar, enter the command
winverand get something like the following:


It is important that the OS has version 1903 or 1909 (the specified OS versions must be with cumulative update KB4566116 installed), or 2004 (build number not less than 19041), the rest of the information does not matter.
If the version number is lower, then it is recommended to update to the latest version of Windows to correctly repeat the results presented in this article.


For the convenience of further actions, install the free Windows Terminal using the Microsoft Store (there is also the possibility of downloading from other sources):


We install X Server X410 through the same Microsoft Store, this software is paid, but there is a free period of 15 days, which is quite enough for various tests.


As a free alternative to X410,
download and install the VcXsrv X server.


In any convenient place on the disk, create a directory in which we will store our files.
Let’s create a directory as an example
C:\wsl.

Download

and install the Ubuntu 20.04 offline installer, unpack the resulting file using an archiver (for example 7-zip). We rename the unpacked directory with a long name Ubuntu_2004.2020.424.0_x64to something more acceptable, for example, Ubuntu-20.04and copy it to the directory C:\wsl(hereinafter simply \wsl).

Download

and unpack the \wslPulseAudio v.1.1 cross-platform sound server into the directory , and also make corrections to its configuration files.


In the file
\wsl\pulseaudio-1.1\etc\pulse\default.paunderLoad audio drivers statically edit the line:

load-module module-waveout sink_name=output source_name=input record=0


and in the section,
Network accessedit the line:

load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1


In the file,
\wsl\pulseaudio-1.1\etc\pulse\daemon.confuncomment and change the line

exit-idle-time = -1


We configure the WSL2 subsystem in accordance with the
Microsoft
documentation . The only note is that we have already downloaded the Ubuntu distribution, and we will install it in the next step. Basically, the configuration boils down to enabling additional components «Windows Subsystem for Linux» and «Virtual Machine Platform», and then rebooting to apply changes to the computer settings:


If necessary,
download and install the update package for the Linux kernel in WSL2.


Launch Windows Terminal and select Command Prompt mode by pressing the keys
Ctrl+Shift+2.


First of all, we set the WSL2 operating mode, for this we enter the command:

wsl  --set-default-version 2


Go to the directory with the offline bootloader Ubuntu 20.04, in my case, this is
\wsl\Ubuntu-20.04and run the file ubuntu2004.exe. When prompted for a username, I specify a name engineer(you can enter any other name), enter your password and confirm the entered password for the specified account:


A terminal prompt appears, Ubuntu 20.04 kernel is installed.
Let’s check the correctness of the WSL2 mode setting, for this, in the Windows Terminal, select the Windows PowerShell tab and enter the command:

wsl -l -v


the result of execution should be like this:


We configure the Microsoft Defender firewall, i.e.
disable it for the public network:

Setting up Ubuntu 20.04


In Windows Terminal, select the Command Prompt tab again and install updates for Ubuntu 20.04.
To do this, on the command line, enter:

sudo apt update && sudo apt upgrade –y


Installing the KDE Plasma desktop:

sudo apt install kubuntu-desktop -y


installation takes up to 30 minutes, depending on the performance of the computer and the bandwidth of the Internet access channel, when the installer’s request appears, we confirm
OK.


Installing Russian localization and dictionaries Ubuntu 20.04.
To do this, on the command line, enter:

sudo apt install language-pack-ru language-pack-kde-ru -y
sudo apt install libreoffice-l10n-ru libreoffice-help-ru -y
sudo apt install hunspell-ru mueller7-dict -y
sudo update-locale LANG=ru_RU.UTF-8
sudo dpkg-reconfigure locales # :  ru_RU.UTF-8 UTF-8, .  .
sudo apt-get install --reinstall locales


Add the latest version of the KDE Plasma desktop:

sudo add-apt-repository ppa:kubuntu-ppa/backports
sudo apt update && sudo apt full-upgrade -y


Adding a set of console applications, for example
mc, and neofetch:

sudo apt install mc neofetch -y


We check what happened, enter it into the command line
neofetch, see screenshot:


Editing the WSL configuration file
/etc/wsl.conf:

sudo nano /etc/wsl.conf


copy the text into the opened empty text editor window:

[automount]
enabled = true
root = /mnt
options = «metadata,umask=22,fmask=11»
mountFsTab = true
[network]
generateHosts = true
generateResolvConf = true
[interop]
enabled = true
appendWindowsPath = true


save the changes (
Ctrl+O), confirm the operation and exit the text editor ( Ctrl+X).


We export the customized Ubuntu-20.04 image to the directory we created
\wsl. To do this, in Windows Terminal, select the Windows PowerShell tab again and enter the command:

wsl --export Ubuntu-20.04 c:\wsl\Ubuntu-plasma-desktop


the created image will help us automate the start / reinstall operations of the configured Ubuntu 20.04, if necessary, it will allow us to easily transfer it to another computer.

Preparing bat files and shortcuts to the Windows desktop


Using the Notepad ++ editor, create bat-files (mandatory in the OEM-866 encoding for the correct display of Cyrillic characters):


File
Install-Ubuntu-20.04-plasma-desktop.bat— designed to automate the initial installation of the created Ubuntu 20.04 image on a computer with a WSL2 subsystem and an X server already configured. If the username and password differ from those specified in the example, then you need to make the appropriate changes to this bat file:

@echo off
wsl --set-default-version 2
cls
echo     Ubuntu-20.04...
wsl --import Ubuntu-20.04 c:\wsl c:\wsl\Ubuntu-plasma-desktop
wsl -s Ubuntu-20.04
cls
echo  Ubuntu-20.04  !
echo        «root»     ,
echo      «engineer», : «password».
pause


File
Reinstall-Ubuntu-20.04-plasma-desktop.bat— intended for reinstalling the prepared Ubuntu 20.04 image on the computer.

@echo off
wsl --unregister Ubuntu-20.04
wsl --set-default-version 2
cls
echo     Ubuntu-20.04...
wsl --import Ubuntu-20.04 c:\wsl c:\wsl\Ubuntu-plasma-desktop
wsl -s Ubuntu-20.04
cls
echo  Ubuntu-20.04  !
pause


File
Set-default-user.bat— to set the «default» user.

@echo off
set /p answer=     Ubuntu (engineer):
c:\wsl\Ubuntu-20.04\ubuntu2004.exe config --default-user %answer%
cls
echo    %answer%  Ubuntu-20.04   !
pause


The file
Start-Ubuntu-20.04-plasma-desktop.batis the actual launch of the KDE Plasma desktop.

@echo off
echo ===================================== ! ============================================
echo     GUI Ubuntu 20.04  WSL2   X Server.
echo  :    VcXsrv Windows X Server  
echo     Start-Ubuntu-20.04-plasma-desktop.bat,  "config.xlaunch" 
echo  "vcxsrv.exe",    ,  "x410".
echo ============================================================================================
rem start "" /B "c:\wsl\vcxsrv\config.xlaunch" > nul
start "" /B x410.exe /wm /public > nul
start "" /B "c:\wsl\pulseaudio-1.1\bin\pulseaudio.exe" --use-pid-file=false -D > nul
c:\wsl\Ubuntu-20.04\Ubuntu2004.exe run "if [ -z \"$(pidof plasmashell)\" ]; then cd ~ ; export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0 ; setxkbmap us,ru -option grp:ctrl_shift_toggle ; export LIBGL_ALWAYS_INDIRECT=1 ; export PULSE_SERVER=tcp:$(grep nameserver /etc/resolv.conf | awk '{print $2}') ; sudo /etc/init.d/dbus start &> /dev/null ; sudo service ssh start ; sudo service xrdp start ; plasmashell ; pkill '(gpg|ssh)-agent' ; fi;"
rem taskkill.exe /F /T /IM vcxsrv.exe > nul
taskkill.exe /F /T /IM x410.exe > nul
taskkill.exe /F /IM pulseaudio.exe > nul


File
Start-Ubuntu-20.04-terminal.bat— launches a graphical terminal without the KDE Plasma desktop.

@echo off
echo ===================================== ! ============================================
echo     GUI Ubuntu 20.04  WSL2   X Server.
echo  :    VcXsrv Windows X Server  
echo     Start-Ubuntu-20.04-plasma-desktop.bat,  "config.xlaunch" 
echo  "vcxsrv.exe",    ,  "x410".
echo ============================================================================================
rem start "" /B "c:\wsl\vcxsrv\config.xlaunch" > nul
start "" /B x410.exe /wm /public > nul
start "" /B "c:\wsl\pulseaudio-1.1\bin\pulseaudio.exe" --use-pid-file=false -D > nul
c:\wsl\Ubuntu-20.04\Ubuntu2004.exe run "cd ~ ; export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0 ; export LIBGL_ALWAYS_INDIRECT=1 ; setxkbmap us,ru -option grp:ctrl_shift_toggle ; export PULSE_SERVER=tcp:$(grep nameserver /etc/resolv.conf | awk '{print $2}') ; sudo /etc/init.d/dbus start &> /dev/null ; sudo service ssh start ; sudo service xrdp start ; konsole ; pkill '(gpg|ssh)-agent' ;"
taskkill.exe /F /T /IM x410.exe > nul
rem taskkill.exe /F /T /IM vcxsrv.exe > nul
taskkill.exe /F /IM pulseaudio.exe > nul


Also, for ease of use, we
\wslprepare shortcuts in the directory pointing to the corresponding bat files. After that, the contents of the directory \wsllooks like this:

Launching the KDE Plasma Desktop


We check that all the preparatory actions have been completed, we try to launch the shortcut
Plasma-desktop. A password request appears, enter the password for the account and … the window closes. It’s ok the first time. Trying again, we see the familiar KDE Plasma taskbar. We configure the required appearance of the taskbar, for example, for ease of use, the panel is moved to the right side of the screen and centered. We check the localization settings, if necessary, add the Russian language:


If necessary, put shortcuts for installed linux applications on the KDE Plasma taskbar.


If Ubuntu 20.04 requires you to log out of the user account to apply the changes to the settings, or you need to restart the OS, to do this, enter the command in Windows Terminal:

wsl -d Ubuntu20.04 --shutdown


Using the shortcut
Plasma-desktopor, Konsoleyou can launch the KDE Plasma Ubuntu 20.04 GUI. For example, let’s install using the KonsoleGIMP graphics editor:


After the installation is complete, run the
KonsoleGIMP graphic editor from the graphics editor:


The GIMP works, which is what you wanted to check.


And here’s how the various linux applications work in KDE Plasma in WSL2:


the customized KDE Plasma taskbar is on the right side of the screen.
and the video in the Firefox window plays with sound.


If necessary, you can configure access to Ubuntu20.04 by
SSHand RDP, for this you need to install the appropriate services with the command:

sudo apt install ssh xrdp -y


note: to enable password access by software,
SSHyou need to edit the file /etc/ssh/sshd_config, namely, the parameter PasswordAuthentication nomust be set to value PasswordAuthentication yes, save the changes and restart Ubuntu20.04.


Each time you start Ubuntu20.04, the internal ip-address changes, before configuring remote access, you need to specify the current ip-address using the command
ip a:


Accordingly, the ip-address is required in the session setup
SSHand RDPbefore starting.


This is how remote
SSHsoftware access looks like using MobaXterm:


And this is how remote access looks like
RDP:

Using vcxsrv X server instead of x410


Launch and configure
vcxsrv, carefully check the appropriate boxes:


We save the configured configuration in a directory
\wsl\vcxsrvwith a standard name config.xlaunch.


We edit bat-files
Start-Ubuntu-20.04-plasma-desktop.batand Start-Ubuntu-20.04-terminal.batin accordance with the instructions available in them.


We launch the shortcut
Plasma-desktop, and this is what we get:


The KDE Plasma desktop completely closes the Windows desktop, we use a well-known key combination to switch between windows of linux and windows applications
Alt+Tab, which is not very convenient.


In addition, an unpleasant feature of the X-server was revealed
vcxsrv— it crashes when launching some applications, in particular the same GIMP or LibreOffice Writer. Perhaps you should wait for the developers to remove the noticed «bugs», but this is not certain … So for obtaining acceptable results it is better to use Microsoft X Server x410.

Conclusion


Still, we must pay tribute to Microsoft, the WSL2 product turned out to be quite working, and, in my unsophisticated opinion, very successful.
And as far as I know, the developers continue to work hard to «finish» it, and perhaps — in a year or two, this subsystem will appear in all its functional completeness.

Why would you want to look at Artix on WSL? I’ve been investigating it because it’s built from the ground up not using SystemD. And SystemD is the biggest annoying factor of using a full desktop experience on WSL2. And in actually setting up Artix on WSL I’ve really enjoyed this Linux distro to the point where I might have to have a bit more of a play.

Incidentally, if you want a bit of a beginner friendly distribution (which Artix isn’t) then you can look at Devuan Linux which is a non-SystemD fork of Debian. I tried this installation initially but found that the KDE Plasma Desktop that came with Devuan for WSL was just way too old for my liking.

In my ramblings around this recently I’ve also found a MUCH better solution for running the Linux GUI applications in the form of GWSL. So this guide will talk about that too.

GWSL is available on the Microsoft Store for free, but the Store version has some limitations that are a bit of a pain on my nice shiny new HP Envy x360. So I ended up putting the downloadable full version on.

Prepare Windows for WSL2

Before you can do anything with WSL you’re going to need to prepare your Windows 10 installation for working with it. I’m not going to go into the details of how to do that because Microsoft are the authority there and I’ll defer to their far superior knowledge.

How to install WSL on Windows 10 (Microsoft official documentation).

At the moment it’s quite likely you’ll have to read the Manual Installation Steps unless you’re part of the Windows Insider Program. In which case you’ll probably know how to install WSL2 already 🙂

Download and Install Artix

So, with Ubuntu and Kali – and even to some extent the Fedora Spin for WSL, it’s fairly straight forward to install these distributions into WSL. But for other distributions it’s a little more awkward. Fortunately though, there’s plenty of people on GitHub who’ve created WSL instances of different distributions and created some rudimentary installers for them.

For Artix, go to https://github.com/hdk5/ArtixWSL and download the latest release. Follow the instructions for installing it and creating a WSL installation. Once you’ve finished you might need to convert it to a WSL 2 instance instead of a WSL1 instance.

To check open up a Powershell prompt and type

wsl -l -v

If your Artix installation is installed and registered it’ll tell you which version it is. If it’s Version 1 it’s best to convert it to WSL2 using the command;

wsl --set-version Artix 2

Once it’s converted you should be able to enter the Artix WSL by typing simply;

wsl -d Artix

from the Powershell prompt.

If you don’t yet have it, I’d highly recommend getting a copy of Windows Terminal from the Microsoft Store. It’s far superior to the standard Powershell or CMD console.

You should end up with something that’s similar to the prompt below;

Artix on WSL Terminal Prompt

Artix on WSL Terminal Prompt

Update Pacman and The PGP Keyrings

This distribution comes with almost nothing installed by default. That’s the way Artix (and Arch Linux) users like it. I’m no Arch or Artix expert, although I have been using Linux since around 1993 so if I get something wrong and you’re an Arch or Artix purist I apologise. Please let me know in the comments!

Nevertheless, before you can do anything else you’re going to need to set up Pacman which is the Arch Linux Package Manager. The first thing we need to do is setup the PGP keys that Pacman uses to determine that packages are indeed what they say they are. To do that issue the following commands;

pacman-key --init
pacman-key --populate archlinux
pacman-key --populate artix

Then, once that’s done we have the PGP keys setup, we need to update the repository databases and install a few things such as sudo (which we need because we don’t want to be doing everything as root) and Plasma Desktop.

pacman -Syu
pacman -S nano
pacman -S sudo
pacman -S plasma-desktop

Allow ‘wheel’ group access to Sudo

This may not be the best way to do this – if you have opinions I’d like to hear them in the comments. This is how I’ve done it for my WSL install but I’m acutely aware that I haven’t done anything this low level for a very long time and it simply may not be best practice any more.

But, in order to not have to login to the WSL distribution as root, we need to allow the sudo command to be operated by anyone who we deem acceptable to use it. Shortly we’re going to create one such user and we’re going to place them in the ‘wheel’ group. But all that will be for naught if we don’t first allow the ‘wheel’ group access to the sudo command. So, issue the following command;

nano /etc/sudoers

Then look for the lines that look like the following;

## Uncomment to allow members of group wheel to execute any command
# %wheel ALL=(ALL) ALL

It’ll be somewhere around Line 82-83. Remove the # from the front of the command and save the file. That’s all you need to do with sudo for now.

Create a Non Root User

We don’t want to access everything on our WSL instance as root (the superuser, or the user who can do everything including break stuff). So we’re going to create a normal user – but one who is allowed to use sudo to become the super user if they choose.

In the commands below replace [username] with whatever you want your user to be called. In my case I used ‘steve’ (without quotes of course).

useradd [username]
usermod -aG wheel [username]
passwd [username]
mkdir /home/[username]
chown -R [username].[username] /home/[username]

The commands above add a new user, then add them to the wheel group. Then we set a password for that new user (because you can’t use sudo if you don’t have a password). We then create a home directory for the user, and we make sure the user owns their own home directory.

Finally we’re going to set WSL up to automatically log us in as that user when we open a new WSL terminal prompt. To do that we need to edit /etc/wsl.conf and add the following lines.

[user]
default=[username]

Obviously replace the [username] with the username you chose above.

Download And Install GWSL

Don’t use the store version if you use a strange DPI and don’t want blurry screen. In my case on my HP Envy X360 my display scaling is set to 125% since the screen is a 1920 x 1080 resolution which is quite a high resolution on a laptop display. 100% is just a bit too small so I prefer (with my old eyes) the scaling set to the 125%. But with the scaling set to that, GWSL looks all blurry.

So, if you’re in the same position you’ll need to download the non-store, or full installation, version from the Github repository at https://opticos.github.io/gwsl/ – follow the links and choose the Traditional Windows Installer. Don’t choose the recommended Store version.

Install GWSL and then adjust the DPI settings if necessary by right clicking on the Start Menu item, choosing More and Open File Location. This will open Windows File Explorer and GWSL shortcut will be shown. Right click over that shortcut and choose Properties. Then choose Compatibility tab and put the tick in the Override High DPI Behaviour and make sure Application is set in the drop down box.

This will then make your Plasma Desktop responsible for the scaling, not GWSL. The result will be a nice sharp output.

For me, I setup my own GWSL profile and added -nodecoration to command line to get a nice full screen window with no title bar and with my windows taskbar still visible and usable. This means ultimately that you will be able to open Windows programs from the very bottom most taskbar and Plasma graphical apps from the task bar above it.

You may well also want to select the Auto-export DISPLAY option in GWSL. This will add some lines of code to your login scripts to automatically connect to your GWSL display server without you needing to know any intricacies. If you get an error you may need to install the ‘which’ package.

sudo pacman -S which

Set up DBUS

You will need a little Dbus tweaking. Primarily, you’ll need to set your WSL instance unique DBus machine-id.

To do this you’ll need to be root. For some reason sudo didn’t work properly for me trying to do this so I had to issue the following command first;

sudo -s

And then as root

dbus-uuidgen > /etc/machine-id

Additional D-Bus Stuff To Make Discover Work

So, if you’re wanting to use the Plasma package manager (instead of say, Octopi) then you’ll need to do a bit more to get D-Bus working properly. The above commands don’t actually make D-Bus run, they just seem to give most applications enough information to not complain.

Nevertheless, if you want any actual D-Bus traffic to flow it does seem that you need to do a bit more. Interestingly, even on a standard VM system I found that I couldn’t get Discover to work properly, so I wonder if Artix doesn’t properly start D-Bus even then? I doubt that – perhaps someone with more Artix knowledge could help me with that one?

Anyway. If you’re using GWSL you can create a shortcut to start Plasma on Artix which I’ll go into further down in the article – but to get it to work properly you will need to tell GWSL to start D-Bus. It’s a matter of ticking a box for GWSL, but behind the scenes you’re going to need to know that GWSL calls /etc/init.d/dbus as a script and expects that script to return as soon as D-Bus is started.

On Artix for WSL that script doesn’t exist. You can create it quite easily though.

Copy the run script from /etc/runit/sv/dbus to /etc/init.d and call it dbus (instead of run).

sudo -s
cp /etc/runit/sv/dbus/run /etc/init.d/dbus

Then you need to edit the file, using something like;

nano /etc/init.d/dbus

Remove the command line parameter ‘–nofork’ from the line that starts with exec

This will tell dbus to start in the background and return immediately. Runit doesn’t like things running this way, but we’re not actually using runit we’ve just borrowed one of its startup scripts.

Start Plasma for X11

There are missing applications from within KDE Plasma because Artix is a minimal install system, leaving you the option of installing only what you need. But you’ll probably want the following options – although at the time of writing I cannot get Discover to work properly as the packagekit-qt5 package cannot connect to PackageKit. I’ll come back and let you know when I fix it 🙂 See above for information about D-Bus for getting Discover to work.

pacman -S dolphin
pacman -S discover packagekit-qt5 flatpak

Choose the xdg-desktop-portal-kde package

Dolphin is the KDE File Manager. You’ll almost certainly want that one. You may also want the firefox package. And perhaps others too but that’s beyond the scope of this post – you can look up which packages you want. They’re all installed with pacman commands similar to above.

Add KDEPlasma-Addons

If you like things like the Bing wallpaper of the day, you’ll need to add the KDEPlasma-Addons package available on pacman.

pacman -S kdeplasma-addons

Start Plasma

Now you should be able to start Plasma. Make sure you have GWSL running already and that you can see the GWSL window. Open up a Windows terminal. You should see a prompt similar to the one pictured at the beginning of this post. The prompt should say something like;

[steve@STEVES-ENVY ~]$

Type

startplasma-x11

You should see a whole bunch of error messages which are largely irrelevant – then in your GWSL window you should see something like the screenshot below;

Artix on WSL with KDE running on GWSL

Artix on WSL with KDE running on GWSL

Note how you can see the Windows taskbar at the bottom, and then above that is the KDE task bar.

I’ll leave it as an exercise for the reader on customizing the desktop that you have.

But note, there is no SystemD-Genie installed – because on Artix we don’t need to emulate SystemD because SystemD is not present on Artix at all. KDE Plasma in this case is just another X-Windows program which runs as the user.

Artix Not For The Faint Of Heart Perhaps?

But what is interesting, I think at least, is that I found this at least as easy to setup as Ubuntu GUI on WSL because there’s no need for SystemD emulation, no need to setup LightDM or XDMCP and GWSL makes setting up the GUI pre-requisites really easy.

Now I’ve just got to figure out how to get KDE Discover working properly or stick with Pacman.

If you have any comments, feedback or questions please drop me a line in the comments! Thanks for reading and I hope you enjoy your new Artix on WSL installation.

P.S. I find Artix to be extremely fast on my HP Envy x360 with Ryzen 7 processor. Your mileage may vary of course, but it’s definitely quicker than Ubuntu was on the same machine. And uses a LOT less virtual memory. It’s a nifty little minimal install with all the features you might need just at the execution of a pacman command. Highly recommended.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Сбой a2dp сбой загрузки драйвера стереозвука windows 7
  • Как нарисовать график в windows forms
  • Бесплатная утилита для обновления драйверов windows 10
  • Яндекс диск после переустановки windows
  • Windows update error 0x800f081f windows