Note: I posted this on the KiCAD forum, and was encouraged to cross post here.
Note: This borders on bug report, but I am not quite sure if it is truly an issue with KiCAD, or rather an instance of PEBCAK!
Hello,
I hope all reading this are doing well.
Background
I am trying to get a nice, open source, version controlled, and integrated “Toolchain” up and running to help organize the experimental business of the physics lab I am a part of. The main goal is to create something standard, with straightforward and concise setup instructions (allowing new students to quickly access the major tools related to our research) while also being easily hackable/extensible. The research in question (quantum materials and such) is fairly diverse and so while we already use KiCAD, it will be just one multiple tools in this toolchain. Many of these other tools, particularly ones oriented towards semiconductors and VLSI are only available on Linux. However, the aforementioned students (and PI of the lab) use windows. Fortunately WSL and NixOS exist; so a linux system that can run standalone or within windows is really only a half dozen clicks away. So, far so good, all software runs just fine in a remote desktop (x11) on WSL. Everything except KiCAD.
Issue
For some reason KiCAD refuses to launch inside the remote desktop and will instead run as a linux application inside windows environment. This behavior is not necessarily bad; it is a valid and much touted capability of WSL, but it is not what I am trying to accomplish. I want KiCAD to run inside the remote desktop because it offers a more consistent, intuitive feel. Again, all the other applications I have installed on the NixOS distribution and launch from the remote desktop behave. Curiously, there seem to be three instances of KiCAD, one entirely within windows (and behaving exactly as it is supposed - only launching through the windows GUI), one launched from inside the remote desktop, and matching the selected KDE plasma theme, and one that seems to live halfway in between. The halfway-in-between instance shows up when I launch from the windows terminal while in WSL but outside the remote desktop. It (the halfway-in-between one) does not match the remote desktop theme but the graphical behavior and functionality is more or less okay (however it does not tile like other windows applications making it cumbersome on a laptop). The one launched from within the remote desktop, while matching the local theme does not seem to live locally. Instead, like the halfway-in-between one, it also lives detached from the remote desktop and seemingly associated to the main windows desktop despite the KiCAD being momentarily present in the plasma system-tray/taskbar. Furthermore, the supposedly-remote-but-not-really KiCAD instance is non-functional: Every time I try to create a new project it obscures half the screen with a dark-mode void and crashes everything when I kill it.
I know that KiCAD does not play nicely with Wayland and so I have ensured that wayland is not being used as the window manager.
echo $XDG_SESSION_TYPE
which yields
x11
I would really, really like this to work, and if it does it will introduce kicad to many new users (and likely future contributors). Having spent the last week or so trying to figure this out to no avail, I think it is worthwhile to post here (or in the bug report section, if that is where it should go instead). If this is indeed a bug and requires some development work, I would be willing to contribute to that bugfix (although I will need some onboarding).
Thank you for your time,
Andy Grzybowski
Recreating the issue
I am going to copy the instructions that will be given to students (how about that for verification! Also for the sake of being through), so please bear with me if some parts are trivial. I assume that this is being attempted on Windows 11.
- Install WSL
Navigate to the windows shell and execute the command:
wsl --install
- Install NixOS within WSL
Download NixOS file: https://github.com/nix-community/NixOS-WSL/releases/tag/2505.7.0 (scroll to the very bottom of page and choose the .wsl file)
once downloaded, click icon to execute. Windows terminal should launch WSL and show an ASCII status bar. When this is complete, NixOS should be launched within the terminal.
- Setup text editor (I used vim, but anything else will work)
In the NixOS terminal execute the command:
nix-env -iA nixos.vim
- Configure NixOS and install other software
In the NixOS terminal execute the command
sudo vim /etc/nixos/configuration.nix
This will open a file with some existing text. Replace existing text with the following nix-language code: (to enter edit/insert mode vim press i)
{ config, lib, pkgs, ... }: { system.stateVersion = "25.05"; #Enable useful stuff nix.settings.experimental-features = ["nix-command" "flakes"]; #WSL Compadibility imports = [ # include NixOS-WSL modules <nixos-wsl/modules> ]; wsl.enable = true; wsl.defaultUser = "nixos"; #Service Configuration for KDE Plasma 6 services.xserver.enable = true; services.xserver.displayManager.sddm.enable = true; services.xserver.desktopManager.plasma6.enable = true; services.xserver.xkb.layout = "us"; services.xserver.xkb.variant = ""; #Remote desktop services.xrdp.enable = true; services.xrdp.openFirewall = true; services.xrdp.defaultWindowManager = "startplasma-x11"; #System software environment.systemPackages = with pkgs; [ #Stuff for Desktop Enviroment pkgs.xrdp #Remote Desktop (RDP) Server kdePackages.sddm-kcm #Toolchain pkgs.freecad pkgs.kicad pkgs.magic-vlsi pkgs.git pkgs.git-graph pkgs.emacs ]; #Create a User (Required for Remote Access) users.users.name= { #Replace the text 'name' with desired username isNormalUser = true; home = "/home/name"; #Replace the text 'andy' with the desired username, same as above extraGroups = ["wheel" "networkManager"]; }; }to save and exit:
press esc
then type
:qw
You should now be back in the NixOS terminal. Enter the following command for those changes made to the configuration.nix file to take effect:
sudo nixos-rebuild switch
This step may take some time, and a lot of text will appear in the terminal. Once the terminal prompt (green colored text) reappears, move on to the next step
- Set password of the user declared in the configuration.nix file. This is required for a later step (Connection to remote desktop).
Enter the following command into the terminal, but replace the text “user“ with whatever name was chosen in the previous step:
sudo password user
Enter a memorable password. Be sure to write it down somewhere safe! Note: the password does note need to be particularly long, for connivence a single letter will do. That would however, be obviously insecure - be lazy at your own risk.
- Acquire networking information for remote desktop connection
Enter the following command into the terminal:
ip a
Under eth0, copy the first section of purple text.
- Connect the remote desktop
In the windows search bar enter Remote Desktop Connection. Click it.
A little window with a text field should pop up
Paste the address from the previous step into this text box and click YES
Another window should pop up
Fullscreen this window
There should be a prompt titled XRDP asking for a username and password
Provide the username and password configured in previous steps. Again click enter.
KDE Plasma should show up
- Open KiCAD
In KDE launcher open KiCAD
- You should now see what I described earlier