# WSL2 - Install, move and use it A series of 6 article(s), in reading order. # Opening an RDP connection to the Linux local instance > Learn how to open an RDP connection to your WSLg Linux instance (Ubuntu) for a full graphical desktop environment. Follow this step-by-step guide to installing and configuring xrdp. --- ![Opening an RDP connection to the Linux local instance](/img/v2/wsl.webp) > > **TL;DR** This article shows how to RDP into a WSL2 Ubuntu instance: installing and starting `xrdp` (on a non-default port like 3390 to avoid conflicts), connecting from Windows via `mstsc.exe`, and installing a full Xfce desktop environment (`xubuntu-desktop`) with `startwm.sh` reconfigured to launch it, so the RDP session shows a full graphical desktop instead of just a console. When WSLg is enabled, it's possible to access the graphical user interface of your Linux distribution (in my case, it's Ubuntu). *This gives you the **whole desktop** of your WSL instance, and not just a window here and there. The Docker equivalent, if you'd rather not touch your WSL instance, is [starting a full lubuntu desktop in Docker](/blog/docker-lubuntu).* ## What an RDP session into WSL actually looks like By default, a WSL instance gives you a bash console. Here is the same instance, in a Windows RDP window, with a complete Xfce desktop: ![Desktop screen](./images/desktop.webp) Four commands and one configuration file below, and this is what you get. ## Get xrdp running If you don't have `xrdp` yet, you can install it by running: ```bash $ sudo apt update && sudo apt -y upgrade ... $ sudo apt-get install -y xrdp ... ``` Also consider changing the port number to `3390` by running the command below and making a few minor changes. *This seems to be required because, when using the default 3389 port number, you get the 'already in use' error with mstsc.* ```bash $ ( sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.bak sudo sed -i 's/3389/3390/g' /etc/xrdp/xrdp.ini sudo sed -i 's/max_bpp=32/#max_bpp=32\nmax_bpp=128/g' /etc/xrdp/xrdp.ini sudo sed -i 's/xserverbpp=24/#xserverbpp=24\nxserverbpp=128/g' /etc/xrdp/xrdp.ini ) ... ``` (see for more in-depth information) Once done, run `sudo service xrdp start` to start the service. You will see the `* Starting Remote Desktop Protocol server` notification in the console. ## Connect from Windows Go back to your Windows environment and start `mstsc.exe` and set the computer name to `localhost:3390` (or the port number you are using). ![Start the RDP connection](./images/rdp_localhost.webp) > **Caution:** > > The connection is only possible when `xrdp` is started. So, if it does not work, you know what to do (you can also run `sudo service xrdp status` to get detailed information). ![Authentication screen](./images/authentication.webp) Use your local Linux user and connect. ## Get the desktop environment At this point, you're connected, but you will just get a bash console and not the desktop illustrated at the top of this article. If you wish the desktop and all its features, please run `sudo apt-get install -y xubuntu-desktop xfce4 xfce4-goodies`. You will be prompted to make a choice between `gdm3` or `lightdm`; select the first one to get all features. Also run `sudo nano /etc/xrdp/startwm.sh` to edit the file. 1. Comment out the last two lines: **/etc/xrdp/startwm.sh** ```bash # test -x /etc/X11/Xsession && exec /etc/X11/Xsession # exec /bin/sh /etc/X11/Xsession ``` 2. Add these last two lines: **/etc/xrdp/startwm.sh** ```bash # xfce4 startxfce4 ``` Finally enable `dbus`: ```bash $ ( sudo systemctl enable dbus sudo /etc/init.d/dbus start sudo /etc/init.d/xrdp start sudo /etc/init.d/xrdp status ) ``` Run `sudo service xrdp restart` to restart the Remote Desktop Protocol Server and start `mstsc.exe` again. Now, you should have the full desktop. > **Information:** > > When you don't need RDP anymore, free up some resources by running `sudo service xrdp stop` in your Linux console. ### Set your keyboard By default, the keyboard is set to `QWERTY` so go to `Applications` → `Settings` → `Keyboard`. ![Set your keyboard](./images/settings_keyboard.webp) In the third tab, find your own keyboard setting. If you are using the `Français - Belgique` on Windows, you should set your keyboard to `Belgian (alt.)` on Ubuntu. ![Set your keyboard to Belgian](./images/settings_keyboard_belgian.webp) ## Conclusion WSLg alone gives you isolated Linux windows floating on your Windows desktop; with `xrdp` and Xfce you get the entire desktop instead, taskbar and settings panel included, in a single RDP window you can minimize like any other. If a whole desktop is more than you need: [running a single graphical application from a container](/blog/docker-run-linux-gui) is lighter, and if you only want to reach your Linux files, [Open your Linux folder in Windows Explorer](/blog/wsl-windows-explorer) is all it takes. --- # Move WSL to another location > Running low on C drive space? Follow this step-by-step guide to safely move your WSL (Windows Subsystem for Linux) distribution and Docker data to a new drive location using the wsl --export and wsl --import commands. --- ![Move WSL to another location](/img/v2/wsl.webp) > **TL;DR** This article shows how to move a WSL2 distribution off the C: drive to free up space, using `wsl --shutdown`, `wsl --export` to a `.tar` file, `wsl --unregister` to remove the original, and `wsl --import` to recreate it on another drive — the same export/unregister/import pattern also works to relocate the Docker Desktop WSL partition. By default, the Linux distribution is installed on your C: drive. If, like me, you have a D: drive with almost nothing on it, it can be really interesting to move Linux to that second drive. *Once moved, nothing else changes: your distribution keeps working exactly as before, [including opening your Linux folders in Windows Explorer](/blog/wsl-windows-explorer).* To do this: * Run `wsl --list --verbose` from a **PowerShell** console; you will get the name of your distribution (`Ubuntu` in my case), * From an **administrator PowerShell** console, * Run `wsl --shutdown` to shutdown WSL, * On your second drive, create a temporary folder like `d:\wsl`, * Run `wsl --export Ubuntu d:\wsl\ubuntu.tar`, * When finished, run `wsl --unregister Ubuntu` and then, * Run `wsl --import Ubuntu d:\wsl\ubuntu d:\wsl\ubuntu.tar --version 2` * Run `del d:\wsl\ubuntu.tar` You will need to do this for every distribution you have installed that you want to move. > **Information:** > > If you have Docker, you can do the same and move the Docker partition to your second disk. > > ```bash > $ wsl --export docker-desktop d:\wsl\docker-desktop.tar > ... > $ wsl --export docker-desktop-data d:\wsl\docker-desktop-data.tar > ... > $ wsl --unregister docker-desktop > ... > $ wsl --unregister docker-desktop-data > ... > $ wsl --import docker-desktop d:\wsl\docker-desktop d:\wsl\docker-desktop.tar --version 2 > ... > $ wsl --import docker-desktop-data d:\wsl\docker-desktop-data d:\wsl\docker-desktop-data.tar --version 2 > ... > $ del d:\wsl\docker-desktop.tar > ... > $ del d:\wsl\docker-desktop-data.tar > ... > ``` Once done, restart your computer to finalize the move. --- # Open your Linux folder in Windows Explorer > Access your Linux files in Windows Explorer! Learn the simple command to open your current WSL folder and how to quickly fix the "wsl.localhost is not accessible" error. --- ![Open your Linux folder in Windows Explorer](/img/v2/wsl.webp) **TL;DR** This article shows how to open your current WSL folder in Windows Explorer by running `explorer.exe .` from your Linux console, which maps to a UNC path (`\\wsl.localhost\...` on Windows 11, `\\wsl$\...` on Windows 10). It also covers the fix for the "wsl.localhost is not accessible" error: adding the `P9NP` provider to two Windows registry keys and rebooting. Did you know it is possible to use the Windows Explorer program and navigate in your Linux filesystem? An easy way to open your current folder in Windows Explorer is to call the `explorer.exe` binary. So, for example, in your Linux console, open any existing folder like `cd ~/repositories/blog` and then, just run `explorer.exe .`. So, yes, it's possible to call any Windows program (like the calculator (`calc.exe`)) by typing its name followed by `.exe`. If the program is in the `PATH` it will start. *You can go one step further and let Windows pick the right program for a given file type; see [Starting the default associated Windows program on WSL](/blog/wsl-powershell).* The final `.` means *current folder* so `explorer.exe .` will open the current folder in Windows Explorer. ![Navigating on the Linux filesystem with Explorer.exe](./images/explorer.webp) It sounds crazy, doesn't it? Windows will then *convert* the Linux `/home/christophe/repositories/blog` folder to `\\wsl.localhost\Ubuntu\home\christophe\repositories\blog` (in the Windows style) and open it. That address is called a UNC (UNC stands for *Uniform Naming Convention*). Now, I can use Windows explorer to manage files / folders like I have for decades on Windows. > **Windows 10:** > > If you are running on Windows 10, the UNC path uses the older `\\wsl$\` prefix instead of `\\wsl.localhost\`. The `\\wsl.localhost\` format was introduced with Windows 11. ## WSL localhost is not accessible > . It can happen, on your Windows 11 computer, that the folder will not be opened and you will get the error: *\wsl.localhost is not accessible. You might not have permission to use this network resource. Contact the administrator of this server to find out if you have access permissions.* ![wsl.localhost not accessible](./images/wsl_localhost_not_accessible.webp) **It is not a permission problem** but something to modify in your Windows registry. In Windows, click on `Start - Run` and run `regedit`, the Windows registry editor. Search for the key `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order`, edit the `ProviderOrder` key and add the `P9NP` value to the list. Do the same for `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\HwOrder`. When done, please reboot your computer. ![Editing the registry](./images/registry.webp) > **Still not working?:** > > Remove `cbfsconnect2017` from the list and try again. --- # Starting the default associated Windows program on WSL > Learn the simple command to open files like PDFs and HTML from your WSL Linux console using their default Windows application - powershell.exe. --- ![Starting the default associated Windows program on WSL](/img/v2/wsl.webp) **TL;DR** This article shares a quick WSL trick: running `powershell.exe ` (e.g. `powershell.exe guide.pdf`) from the Linux console opens that file with its default Windows application, without needing to browse to it in Windows Explorer first. `xdg-open` is mentioned as an alternative for opening the default browser. Very often, I'm in my Linux console and I'd like to open a pdf file that I've just generated or, more simply, to open an html file. But how can I do this? Without knowing the tip that is the subject of this article, at the moment I launch [Windows Explorer](/blog/wsl-windows-explorer) from my console, I then get the well-known file explorer interface and there I double-click on the file I want to open and leave it to Windows, which knows which program to launch to open this or that extension. In fact, it's much simpler... The tip: start `powershell.exe` followed by the filename to open like `powershell.exe guide.pdf` or `powershell.exe index.html`. *A typical use case: you've just generated a PDF with [Quarto in Docker](/blog/docker-quarto) and want to check the result without leaving your console.* > **Not available in Bash:** > > `powershell.exe` only works in the console. You can't use it in a Bash script (`.sh`), it won't be recognized there. > **`xdg-open`:** > > You can also use `xdg-open` to start your default browser so `xdg-open index.html` will open the file in your Windows browser. If you get the error below, you'll find a solution in the article [Windows Explorer](/blog/wsl-windows-explorer#wsl-localhost-is-not-accessible) ```bash Start : This command cannot be run due to the error: The system cannot find the file specified. At line:1 char:1 + Start "readme.html" + ~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand ``` --- # Ubuntu - Install from scratch > Install Ubuntu Desktop 24.04 from scratch with this easy, step-by-step guide. Learn how to turn off Bitlocker, create a bootable USB, and solve the NVIDIA driver installation bug. --- ![Ubuntu - Install from scratch](/img/v2/linux_tips.webp) **TL;DR** This article walks through a clean Ubuntu Desktop 24.04 install replacing Windows: disabling Bitlocker first, creating a bootable USB with balenaEtcher, booting from it, erasing the disk with LVM encryption, and a warning to skip the "install recommended proprietary software" option on NVIDIA cards to avoid a Secure Boot key bug. It ends with a list of essential post-install snap packages (Firefox, Thunderbird, LibreOffice, VSCode, Docker, GIMP). Today is a public holiday in Belgium, so I'm finally taking the time to install Ubuntu on my old PC. The idea is to remove Windows and install Ubuntu Desktop 24.04 on the computer. Let's go, you'll see, it's easy. ## Result ![Installation is completed](./images/installation_done.webp) That's a working Ubuntu 24.04 install, ready to reboot into. Before you get there, one trap to avoid — it's the one that actually cost time during this install: > **IMPORTANT - DON'T INSTALL ADDITIONAL DRIVERS IF YOU'VE A NVIDIA GRAPHIC CARD:** > > The wizard will ask if you want to **Install recommended proprietary software**. The first time, I have answered Yes on both options. The installation had been running for nearly twenty minutes and then I got an error message *The Secure Boot key is not valid*. > > While looking on the **askubuntu.com** website, someone mentioned this was a bug and that we shouldn't install drivers during the installation of Ubuntu but can do this easily later on, referring to this bug: . > > So, I've abandoned the installation and start a new one. ## Turn off Bitlocker first If you're using Bitlocker on your computer, you must first deactivate it; if not, just skip this chapter. You can follow the official documentation here: [Turn Bitlocker off](https://ubuntu.com/tutorials/install-ubuntu-desktop#13-additional-installing-ubuntu-alongside-windows-with-bitlocker). Shortly, still in your Windows session, start your **Control Panel**, search for **Bitlocker** and click on **Turn off Bitlocker**. Depending on the speed of your computer and the size of the hard disk, it'll take minutes. ![Disabling Bitlocker](./images/disabling_bitlocker.webp) > **Follow progression in the tray panel:** > > If, like me, you didn't see any progression on the screen, think to click on the tray panel icon (near the clock). You'll find there an icon about the decryption process. ## Download Ubuntu and create your bootable USB stick You'll need to get the ISO of Ubuntu; just go to and download it. Once the file **ubuntu-24.04-desktop-amd64.iso** is successfully downloaded, you'll need an additional software called [balenaEtcher](https://etcher.balena.io/). balenaEtcher has to be used to create the bootable USB stick. It couldn't be simpler: just select the downloaded ISO file, then the letter of the USB drive (D: for me) and confirm. After a few minutes, the USB stick will be ready. ## Think to plug an Ethernet cable before installing Ubuntu Even if it's optional, make sure to plug an Ethernet cable so, during the installation process, Ubuntu will be able to download additional software like your graphic card driver directly from Internet. ## Start the installation wizard Turn on your old computer and make sure to boot on the USB stick. For this, during the boot process (in my case, when I see the Dell logo), press the `F12` or `DEL` key to start the BIOS setup. There, make sure to select the option allowing you to boot on a USB stick; save your changes if any and quit. Your computer will now boot on the USB stick and start the installation process of Ubuntu. ![Booting on the USB stick](./images/boot_usb.webp) Everything is nicely covered by the [official tutorial](https://ubuntu.com/tutorials/install-ubuntu-desktop). A few notes: * Select the *interactive mode* so you can select the options that suit you best in more detail; * When asked, select *Extended selection* to be able to install additional software during the installation process (like desktop tools, utilities and a web browser); * When asked *Install recommended proprietary software?*, make sure checkboxes are **unchecked** (see below); * The wizard will ask *how to install Ubuntu*; alongside Windows (so with a dual boot) or alone. I'm going to opt for the latter. Personally, that's my goal and I'm going to ask to delete my entire current disk (Windows) and to do that, I'm going to click on *Erase disk and install Ubuntu* and click on the *Advanced features* button. I'm going to opt for *Use LVM and encryption* which will allow me to have encryption like I had with Bitlocker: someone who came to steal my hard disk wouldn't have access to my files without the decryption key. *Remember the NVIDIA/Secure Boot warning from the top of this article when the wizard asks about proprietary drivers.* You'll be asked to create your administrative account and to select your time zone. Then, once you've confirmed your choices, the wizard will start to prepare your machine then copy files on your computer. This process is, of course, the slowest one. It can take 10 minutes or more. > **The installation seems frozen:** > > For a few minutes, the screen seemed to be stuck on *Setting up the system...*. However, I could move the mouse pointer and, for example, view the menu (on the left). I kept waiting and everything *unblocked*. So be patient if you need to. > > You can start discovering the interface even before installation is complete! Just move the mouse cursor to the left side of your screen and you'll get access to some applications. > **See the progression in a console-mode:** > > In the bottom right of the installation screen, you'll find a small button. Click on it and you'll get a log window where you can follow which action is running. That's the completed installation shown at the top of this article. ## Reboot and enable Ubuntu Pro Once the installation is done, remove the USB stick and reboot. The post-installation wizard will welcome you and ask if you wish to enable the *Ubuntu Pro* service; just proceed. [Ubuntu Pro](https://ubuntu.com/pro) is a free (for personal use) service proposed by Canonical and will keep your computer up-to-date. As a very last step, run the **Software Updater** application to check for any additional software to install. If you're a pro of the console, it's the same as running `sudo apt update`. ## Time to add software * [Firefox](https://snapcraft.io/firefox) as browser (`sudo snap install firefox`), * [Thunderbird](https://snapcraft.io/thunderbird) for your email client (`sudo snap install thunderbird`), * [LibreOffice](https://snapcraft.io/libreoffice) to create documents, spreadsheets or slideshows (`sudo snap install libreoffice`), * [Visual Studio Code](https://snapcraft.io/code) to start coding (`sudo snap install code --classic`), * [Docker](https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository) to work with containers (see [Install Docker and play with PHP](/blog/install-docker)), * [Gimp](https://snapcraft.io/gimp) to edit images (`sudo snap install gimp`), And the very first thing I install on any fresh Linux, before anything else: [Oh-My-ZSH](/blog/zsh-install). Working in `bash` after having tasted ZSH autocompletion is painful. *Ubuntu isn't the only candidate for an old PC; I've also had a look at [Zorin](/blog/zorin), which is Ubuntu-based but ships a Windows-like desktop.* --- # Discovering Zorin > Trying a new OS? Zorin OS 18 is a Linux distribution based on Ubuntu, perfect for switching from Windows. Easy install, familiar interface, and great compatibility! --- ![Discovering Zorin](/img/v2/zorin_os.webp) **TL;DR** Zorin OS 18 is an Ubuntu-based Linux distribution designed for Windows users seeking an alternative, especially for older PCs. It features an easy installation process and a familiar, Windows-like interface, making the switch straightforward. The OS also boasts compatibility with many Windows applications via WINE and strong gaming support, positioning it as a top choice. Like everyone else, I have an old computer and with Windows 10 support coming to an end, I saw so many blog posts or news articles about [Zorin OS 18](https://zorin.com/) that I became curious and wanted to try it out. Zorin OS is a Linux distribution based on Ubuntu that targets users switching from Windows or macOS, with a desktop environment very similar to Windows. *Not ready to repurpose a whole machine? You can get a feel for a Linux desktop from inside Windows: [Start lubuntu Desktop in Docker](/blog/docker-lubuntu). And if you just want the command line, [Ubuntu - Install from scratch](/blog/ubuntu-install) covers the WSL route.* Zorin can be [downloaded](https://zorin.com/os/download/) for free (i.e. the Core edition or the `Education` one). If you want to support developers or need additional features, you can download the Pro edition (less than 50€ incl. sales tax end of 2025). You'll have to download a `.iso` file and a program called `balenaEtcher` in order to flash a USB drive. Everything is clearly described on the [how to install Zorin OS page](https://help.zorin.com/docs/getting-started/install-zorin-os/). Once my USB drive is ready, I just put it in my old PC, start the PC, press `F12` in my case to enter the BIOS and change the boot sequence: the PC has to start on the USB drive this time; not the hard disk. Save and exit the BIOS and, indeed, the installation screen is now displayed. As mentioned in the how to guide, I have to select the `Try or Install Zorin OS` option and wait a few moments until Zorin performs some checks. ![The installation menu of Zorin](./images/zorin_installation_menu.webp) The PC will reboot and you'll get the Zorin welcome screen. Select the language for your OS; your keyboard configuration, normal or minimal installation, ... and proceed with the installation. So far, it's no more difficult than using a Windows installer, and no different: we just need to wait until everything is installed. Windows users will appreciate that Zorin OS's graphical interface is very similar to Windows, with menus, taskbars, and a file manager. ![Zorin interface](./images/zorin_desktop.webp) > **Looks like Windows no?:** ## What can make the differences * The installer is well done, click, click, click and reboot. * Zorin includes built-in Microsoft OneDrive integration. * You'll also be able to install some Windows applications directly on Zorin thanks to `WINE` (*open-source compatibility layer that allows Windows applications and games to run on Linux.*). * If you're a gamer, [almost 90% of Windows games are now running on Linux](https://www.techpowerup.com/342337/almost-90-of-windows-games-run-on-linux-notes-report). The system was immediately operational i.e. no problem at all with my graphic card and my internet connection was operational. Zorin comes with a lot of preinstalled software like **Libre-Office**. I haven't gone any further in exploring Zorin, but if I ever needed to do without Windows, Zorin would definitely be at the top of my list of options. > **Re-format USB flash drive:** > > Now that Zorin has been installed, you can reformat your USB drive to be able to reuse it... but please notice if you format it using Zorin (Linux thus) your USB stick won't work anymore under Windows. > > If you already have formatted your stick using Zorin, you'll have to start the `diskpart` utility in a DOS console. > > 1. Plug in your USB drive > > 2. Press Win+R, type `diskpart`, and hit Enter > > 3. In the Diskpart window, execute these commands > > * `list disk` to show the list of disks you have > > * `select disk X` (replace `X` with your USB’s number). Don't select disk `0`, it's your hard drive. Most probably your USB stick will be disk `1` but check more than once! before pressing Enter > > * `clean` to remove everything on the stick > > * `create partition primary` to create a primary partition > > * `format fs=ntfs quick` to format the stick using NTFS file system > > * `assign` to assign a drive letter to the stick > > * finally run `exit` to quit the diskpart utility > > Now, the stick will be recognized again by Windows. To get more information about Zorin and its latest version: [Zorin OS 18 Has Arrived](https://blog.zorin.com/2025/10/14/zorin-os-18-has-arrived/). ---