Huny's Dev Blog
huny.dev

Restart WSL Safely: shutdown vs terminate and Configuration Changes

Choose between stopping one WSL distribution and shutting down the VM, then apply wsl.conf or .wslconfig changes safely.

Hun Jang
Hun Jang Nov 11, 2026

When a WSL configuration change or a stuck Linux environment calls for a restart, choose the scope first. Use wsl --terminate for one distribution and wsl --shutdown to restart the WSL 2 virtual machine or apply a .wslconfig change. Both can interrupt active work, so save files and stop services first.

AI-generated illustration of terminal windows and a restart

Check running distributions first

Run these commands in Windows PowerShell or Command Prompt. From a Linux shell, use wsl.exe instead of wsl.

The first command lists installed distributions, their running state, and whether they use WSL 1 or 2. The second lists running distributions. Use the name exactly as shown. Microsoft: basic WSL commands

Save edits and finish active builds; stop databases, development servers, and other services using their normal shutdown procedures. VPNs, SSH sessions, and port forwarding running inside WSL may disconnect. Check the impact on programs such as Docker Desktop that use WSL.

Stop one distribution

For example, if the list contains Ubuntu, run the following. Quote a name that contains spaces.

The first command stops the named distribution. Check its state with the next command, then start it again with the last one. This command does not directly stop other distributions. Replace the example name Ubuntu with your own.

Shut down all of WSL

--shutdown immediately terminates all running distributions and the WSL 2 lightweight utility virtual machine. Start the distribution you need afterward; the command does not automatically restart every distribution. The list reports state at the moment it is checked, and another application may start WSL again. Microsoft: shutdown

Which command applies configuration changes?

/etc/wsl.conf applies to an individual distribution. The distribution must fully stop and restart before changes take effect. Microsoft notes that its subsystem may still run immediately after you close a shell. You can terminate the affected distribution with --terminate, start it again, and verify the result.

.wslconfig in the Windows user profile holds global WSL 2 VM settings. To apply a change such as a memory limit, finish dependent work, shut down the VM with wsl --shutdown, and start a distribution again. .wslconfig does not configure WSL 1 distributions. Microsoft: advanced settings

Stopping is different from deleting

--terminate and --shutdown stop distributions without unregistering them. By contrast, wsl --unregister permanently removes the specified distribution and its associated data, settings, and software. Do not use it to restart WSL. Unsaved work can still be lost when stopping. Microsoft: unregister warning

This explanation is based on Microsoft documentation checked on November 11, 2026. The examples were not executed in a Windows WSL environment.

한국어 버전 · WSL 재시작: shutdown과 terminate 차이와 안전한 설정 적용WSL 재시작: shutdown과 terminate 차이와 안전한 설정 적용

추천 글