Windows (WSL 2)
Install devmagic-panel on Windows 10 or 11 with its setup: the panel runs in Ubuntu under WSL 2, and your Windows browsers open its sites.
- Runs on
- Windows 10 22H2 and 11, in Ubuntu under WSL 2
- Needs
- Virtualization on, about 10 GB, an administrator or their password
- Install
devmagic-panel-setup-<version>.exefrom the latest release
On this page
On Windows the panel is the same one as on Ubuntu, inside a Linux distro under WSL 2. Apache, PHP, MySQL, the root scripts and your sites all live in that distro, and your Windows browsers reach them through WSL's localhost forwarding.
One setup program does all of it, the Linux side and the Windows side, from one window.
Before you start
- Virtualization on. WSL 2 runs a small virtual machine. Task Manager, Performance, CPU says "Virtualization: Enabled" when it is on. When it says Disabled, turn on Intel VT-x or AMD's SVM Mode in the computer's BIOS or UEFI setup (the key shows at power-on, often F2, F10, Del or Esc). The setup checks this first and stops with these steps before it changes anything.
- WSL: nothing to do. When it is off, the setup turns it on (Windows asks with UAC) and offers the one restart Windows needs. Once you sign in again, the setup starts by itself and goes on from where it stopped.
- About 10 GB free on the drive that holds your user folder.
- An administrator: your Windows user, or the password of one for the UAC questions.
Run the setup
- Download
devmagic-panel-setup-<version>.exefrom the Assets of the latest release (opens in a new tab). - Run it. It runs as you, not as an administrator. If Windows warns about it, see below.
- Let it check Windows, virtualization, WSL and what is already in place.
- Pick where the panel runs:
- a new distro of its own, Ubuntu 24.04, named
devmagic-panelor a name you choose; - the
devmagic-paneldistro, when it is there already; - one of your own WSL 2 distros running Ubuntu or Debian. Its sites and
files stay; the setup turns systemd on (the distro restarts), stops WSL
from rewriting its
/etc/hosts, keeps Apache on127.0.0.1and keeps the distro running.
- a new distro of its own, Ubuntu 24.04, named
- Give your Linux account, a user name and its password, when the distro has none. Then pick the panel password.
- Follow the install under Details. For a new distro it imports Ubuntu 24.04, checked against Canonical's SHA-256, makes your Linux user as Ubuntu's own first start would, and installs the panel in it as on Ubuntu.
- Once it checks that
https://local.devmagicanswers, open it and log in.
What it sets up in Windows
- Its helper, in
C:\Program Files\devmagic-panel. - A logon task that keeps the distro running, with no window.
- Trust in the panel's local CA for your Windows user (Windows asks you to confirm once).
- The panel's names in Windows' hosts file (with UAC).
- If you like, Open devmagic-panel on the desktop and in Start. WSL adds a Start entry of its own for the distro, which opens a terminal there.
Run it again to repair
Run the setup again any time: it skips what is in place, so it also repairs. A repair goes to the distro the panel is installed in, and keeps the panel password you have.
Every run is logged in %LOCALAPPDATA%\devmagic-panel\logs.
Note Passwords never stay on disk. The setup hands them to the distro in a file only you can read, deleted as soon as it is read, and never on a command line.
When Windows warns about the setup
The setup is not signed yet, so Windows does not know who published it. Your browser may first ask whether to keep the download, as it does for programs few people have downloaded: keep it. Then Microsoft Defender SmartScreen may say "Windows protected your PC", with only Don't run:
- Click More info.
- Check that the app is
devmagic-panel-setup-<version>.exeand the publisher is Unknown publisher. - Click Run anyway.
Check the checksum
To be sure the file is the one the release built, compare its SHA-256 with
devmagic-panel-setup-<version>.exe.sha256 from the same release. In
PowerShell, in your Downloads folder:
(Get-FileHash .\devmagic-panel-setup-<version>.exe -Algorithm SHA256).Hash
The two must match. PowerShell prints capitals, the .sha256 file lower case.
When there is no Run anyway
Windows 11 with Smart App Control on, and computers whose company allows only approved apps, give no Run anyway. There the setup cannot run until it is signed: install by hand, or ask your administrator.
Updates never meet this question: the panel downloads and checks them itself.
Updates
Updates come from the panel's Updates page, as on Ubuntu. The setup is only for the first install and repairs.
- A release that leaves the Windows part alone updates the panel only. Apps and features shows the new version by itself.
- A release that changes the Windows part (the helper, the setup, its shortcuts or uninstall steps) says so on the Updates page. Its Update runs that release's setup, which updates both in one go. Windows may ask with UAC, the panel restarts for about a minute, and the page loads again once it answers.
- Machine checks show Windows part, with Update the Windows part, whenever Windows has another release's part than the panel, after you switch releases for example.
For the Windows part, the helper downloads the setup from GitHub, checks it
against the .sha256 published with it and runs it with no window, so
SmartScreen does not ask.
Notifications
When a new release is out, Windows shows a notification from devmagic-panel, once per release. It opens the Updates page. The panel looks every six hours.
Turn them off in Windows' Settings, System, Notifications, devmagic-panel.
Uninstall
Open Apps and features, pick devmagic-panel and click Uninstall. It takes the Windows side back: the hosts lines, nginx's relays, the logon task, the CA and the helper.
Then it asks what to do with the distro the setup made, which holds every site and database:
| Choice | What happens |
|---|---|
| Keep it (the default) | The distro, its sites and databases stay in WSL |
| Remove it after a copy | A copy goes to %LOCALAPPDATA%\devmagic-panel first; wsl --import brings it back |
| Remove it with no copy | The distro and everything in it are gone |
A distro of your own always stays. To remove the panel from it too, run
~/.local/share/devmagic-panel/current/install.sh --uninstall in that distro
(see Uninstall).
What is different under WSL
- Hosts lines. Windows' hosts file follows every site change, as
/etc/hostsdoes in the distro. - nginx. It answers for Windows too: Windows relays its
127.0.0.2to nginx in WSL. - Open in terminal opens Windows Terminal at the site's folder in the distro.
- Open in VS Code opens the folder through VS Code's WSL remote, and offers its WSL extension the first time.
- Your sudo password is the Linux password you chose in the setup.
- Machine checks have a WSL on Windows group: whether WSL leaves
/etc/hostsalone, Apache is on127.0.0.1, lingering is on, the sites are on the distro's own disk and Windows programs can start. On the Windows side it checks the hosts lines, the CA, the logon task, nginx's relays and the Windows part. Each has its fix (see Aura).
Warning Keep your sites on the distro's own disk, never under
/mnt/c: a Windows drive is 20 to 350 times slower from WSL. The installer refuses sites there.
What the installer changes in the distro
The setup runs the panel's usual installer in the distro, and so does an install by hand. Under WSL 2 it also:
- adds
generateHosts = falseunder[network]in/etc/wsl.conf, keeping every other line, so WSL stops writing/etc/hostsanew at each start and the panel's lines stay; - keeps Apache on
127.0.0.1(dmp-root apache-local, with the originalports.confkept in/var/lib/devmagic-panel/apache-local). WSL forwards an Apache on every address to Windows on::1only, and Windows' hosts lines point at127.0.0.1; - keeps the panel running after the last WSL window closes (lingering, with
no question), and installs Mailpit with
--yestoo; - adds the CA to no Linux browser store, unless the distro has a browser of its own;
- refuses WSL 1, a distro without systemd, and sites on a Windows drive.
Updating the panel, or running the installer again, puts the first three right again.
Install by hand
Without the setup, for example where Smart App Control blocks it:
-
In PowerShell, install Ubuntu, or a distro of its own for the panel. Run one of these;
--nameneeds a recent WSL, so runwsl --updatefirst:wsl --install Ubuntu-24.04 wsl --install Ubuntu-24.04 --name devmagic-panelUbuntu's WSL image runs systemd, which the panel needs. Open the distro once to make your Linux user.
-
In the distro, install the panel as on Ubuntu.
-
In Windows, once, as an administrator, add the panel's name to
C:\Windows\System32\drivers\etc\hosts. Add each site's names the same way later, one name per line, since Windows reads only the first 9 names of a line:127.0.0.1 local.devmagic -
Trust the local CA for your Windows user, so Chrome, Edge and Firefox accept the panel's certificates. Windows asks you to confirm once:
Import-Certificate -FilePath \\wsl.localhost\Ubuntu-24.04\etc\ssl\localcerts\devmagic-panel-ca\ca.pem -CertStoreLocation Cert:\CurrentUser\Root -
Keep the distro running. WSL stops it a few minutes after its last window or command ends, however busy Apache is. Put a shortcut in your Startup folder (
shell:startupin the Run dialog) with this target, which opens no window:conhost.exe --headless wsl.exe -d Ubuntu-24.04 --exec sleep infinity
Use your distro's name in place of Ubuntu-24.04 in steps 4 and 5.
Good to know
-
curl from Windows. Windows'
curl.exeneeds--ssl-no-revokefor the panel's certificates, which name no revocation server. Browsers do not mind.curl.exe --ssl-no-revoke https://local.devmagic -
Keep a page file. On a Windows without one, WSL can run out of memory and stop. Keep "Automatically manage paging file size" on, in System Properties, Advanced, Performance, Virtual memory.
Checked against devmagic-panel 1.70.0.