# Connect to WSL using RDP and VNC

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/laptops-and-desktops/wsl2/)
- [Configure and run WSL with various Linux distributions](https://learn.arm.com/learning-paths/laptops-and-desktops/wsl2/setup/)
- [Run graphical Linux applications](https://learn.arm.com/learning-paths/laptops-and-desktops/wsl2/wslg/)
- [Enable systemd in WSL](https://learn.arm.com/learning-paths/laptops-and-desktops/wsl2/systemd/)
- [Use SSH to connect to WSL](https://learn.arm.com/learning-paths/laptops-and-desktops/wsl2/ssh/)
- [Connect to WSL using RDP and VNC](https://learn.arm.com/learning-paths/laptops-and-desktops/wsl2/rdp/)
- [Developing with VS Code on WSL](https://learn.arm.com/learning-paths/laptops-and-desktops/wsl2/vscode/)
- [Import file systems into WSL](https://learn.arm.com/learning-paths/laptops-and-desktops/wsl2/import/)
- [Backup a WSL filesystem](https://learn.arm.com/learning-paths/laptops-and-desktops/wsl2/backup/)
- [Next Steps](https://learn.arm.com/learning-paths/laptops-and-desktops/wsl2/_next-steps/)

## Install desktop software and remote desktop protocol (RDP)

RDP provides a remote desktop from Windows to WSL. The RDP client is run on Windows and displays the Linux desktop running in WSL.

Install the RDP server and the XFCE4 desktop:

```bash
sudo apt install -y xfce4 xrdp
```

Set XFCE4 as the default desktop:

```bash
echo xfce4-session > ~/.xsession
```

If systemd is running the `xrdp` server will start automatically on install, but it needs a restart after modifying `.xsession`:

```bash
sudo service xrdp restart
```

Check if `xrdp` is running:

```bash
systemctl status xrdp
```

If `xrdp` is not running, start it:

```bash
sudo service xrdp start
```

Print and save the IP address of the WSL instance:

```bash
ifconfig
```

Install `ifconfig` if it is not installed:

```bash
sudo apt install net-tools -y
```

On Windows, start the remote desktop viewer, mstsc. It is also called **Remote Desktop Connection** on the Windows application menu.

Enter the IP address you saved in the box.

Click Yes that you really want to connect.

Enter the Linux username and password for the WSL Linux distribution.

## Install desktop software and use VNC for a remote desktop

VNC can also be used for a virtual desktop.

Refer to [VNC](https://learn.arm.com/install-guides/vnc/) for details. The instructions work the same for WSL 2.
