Sign In
Sign In

RDP Connection Fails: How to Fix RDP Errors

RDP Connection Fails: How to Fix RDP Errors
Hostman Team
Technical writer
Windows
28.05.2024
Reading time: 5 min

Connecting to a remote desktop using RDP is a common task. It is often used in a corporate environment so that employees can work remotely on a corporate computer within the company network. This is especially true in cases where work requires a large amount of computing resources that may not be available on a home PC.

In this article we will look at several common problems with RDP and how to solve them.

Typical connection issues

Here's an example of a common RDP error you might receive when trying to connect to a remote desktop.

Image1

In some cases, there might be no reasons provided at all, with the notification window simply informing you that “an internal error has occurred”.

Image2

Typically, the RDP connection errors have similar causes and solutions, so in this article we will look at several ways to troubleshoot connection problems that might work for most of those RDP errors.

Here are a few reasons that can lead to problems with connecting via RDP:

  • incorrect connection settings;

  • problem of matching the domain name and IP address of the remote computer;

  • DNS server cache;

  • RDP cache;

  • RDP port being used by another application;

  • the firewall is blocking the connection;

  • Windows updates.

Let's look closer at how to fix these issues.

Check your connection settings

One of the reasons why there may be a problem with connecting via RDP is incorrect connection settings. Below are a few settings that may affect RDP connectivity:

Incorrect credentials

If you enter incorrect login information on the remote computer, connecting via RDP will not be possible. Make sure you enter the correct credentials and that they have sufficient permissions to connect.

Incorrect address of the remote computer

If you enter an incorrect computer name to connect via RDP, the client will not be able to find it and will display the error "Remote Desktop could not find the computer." To find out the name of the remote computer to connect to, follow these steps:

  1. Open File Explorer on the remote computer and go to the This PC tab.

  2. Right-click in the work area and select Properties.

  3. After this, the System page will open. In the Computer name, domain name, and workgroup settings section, find the connection information.

If the problem is not resolved, continue to the next section.

Connecting to a remote computer by IP address

When connecting to a remote computer, the address is usually its domain name associated with a specific IP address. Domain names and their corresponding IP addresses are stored on a DNS server. Sometimes, the domain name in the DNS server is assigned an incorrect address; in this case, you will not be able to connect to the server via the domain. To fix this issue, try to connect to a remote computer using its IP address.

To find out the IP address:

  1. On the remote computer, launch cmd (Win+R, enter cmd and press Enter). 

  2. Type the ipconfig command and press Enter. 

  3. In the IPv4 Address field you will find the computer's IP address.

Now, try connecting to a remote computer via RDP using the IP address instead of the domain name.

Clear your DNS cache

Sometimes clearing the DNS cache helps. To do this: 

  1. Launch cmd as described above.

  2. Run the command ipconfig / flushdns.

Add the RDP server IP address to the hosts file

The hosts file in Windows is a text file that maps domain names to IP addresses. Your computer uses this file as the primary source of hostname information before it queries the DNS server. 

If you suspect there is an error in the DNS server information, you can add an entry to the hosts file with the domain name and IP address of the remote computer.

To do this, open the hosts file using Notepad. The file is located in the C:\Windows\System32\drivers\etc\ directory. Add a new line to it with the IP address of the remote computer and its domain name and save the changes.

Check the RDP port

By default, RDP uses port 3389. If any other application on the computer uses the same port, an error will occur when connecting. Let's try changing the port to 3388 and see if we can connect via RDP. To do this:

  1. Open Registry Editor and navigate to the RDP-Tcp directory.

  2. Find the PortNumber entry.

  3. Right-click on it and select Edit.

  4. Enter another port number in the value data field.

Try using an alternative RDP client

If you are unable to resolve the RDP connection problem using a Microsoft client, try using its alternatives, such as AnyDesk or Remote Utilities.

Roll back or install Windows updates

You may sometimes encounter RDP connection errors after a Windows update because one of the newly installed files may interfere with RDP functionality. If your operating system has been updated recently, try performing a rollback.

Change your firewall settings

Disabling your firewall is an easy way to check if it is causing RDP errors. If the problem disappears when the firewall is turned off, you need to reconfigure it or leave it disabled. The last option is not entirely safe, so let's configure the firewall.

  1. Open Windows Defender Firewall and click Allow an app or feature through Windows Defender Firewall in the left menu.

  2. Click Change settings.

  3. In the list of programs, find Remote Desktop and check the Private and Public checkboxes next to it.

  4. Close the window and try to connect. If the problem was with the firewall, you should now be able to connect to the remote computer.

Windows
28.05.2024
Reading time: 5 min

Similar

Windows

How to Create and Use Batch Files

Batch files are text files with .BAT or .CMD extensions that store a set of commands and execute them in the operating system terminal. Such files are necessary to automate standard user work in Windows.  Batch files can be considered a Windows alternative to the Unix shell scripts which you would run on a Linux server. This article will describe in detail how to create, configure and run bat files in Windows and which commands to use. Prerequisites An affordable cloud server from Hostman or a personal computer with the Windows operating system installed. Notepad or another text editor. We recommend using editors with built-in syntax highlighting, for example, Notepad++. Create a batch file To create a Windows bat file, open any text editor and fill it with some content.  As an example, let's create a batch file that will display the message "Hello, user!" in the Command Prompt window: @echo offecho Hello, user!pause Now, you need to save the file using the .bat extension. To do this, go to File → Save as…. If you are using Notepad++, select Batch file in the Save as type field and enter the file name. When using Notepad, select All files as the file type and enter your file name and extension. If you saved the file with the wrong extension, it can be easily fixed by renaming the file and specifying the correct extension.  To do this, you need to enable showing file extensions in the Explorer's View tab. Syntax of a batch file Below is a list of basic rules that you need to know when using Windows bat scripting: Each command must be entered on a new line. The commands specified in the file are executed strictly in order, from first to last. The exception is those cases when a transition from one part to another is organized inside the file (for example, goto). Indicate directories in quotes to minimize errors. Add |Y| before commands that require confirmation (such as del or format). You can use two types of commands: internal (built-in) and external. The first are the commands of the Command Prompt (cmd.exe) itself (we'll talk about them later). The second type includes all possible executable files (extensions .EXE, .CMD or .BAT). Use @echo off at the beginning of the file to disable displaying the command line after running the batch file. Run a batch file To run a bat file in Windows, simply double-click on it. It is worth considering that some batch files may contain commands that require administrator rights. In that case, right-click on the file and select Run as administrator.  However, if running the file implies some kind of system output, you should run it using the Command Prompt. To launch the Command Prompt, press WIN+R, enter cmd in the input field, and press Enter. A command line window will open, into which you need to drag-and-drop the batch file and press Enter. The batch file will begin executing commands and display the result. Let's run the test file that we created in the previous step and look at the result. If everything works correctly, you will see the message from the file: "Hello, user!". Automate .BAT files with Task Scheduler  A useful feature when working with batch files is the ability to run them at certain intervals. To implement this, you will need to use Task Scheduler, a built-in Windows tool. Press WIN+R, enter taskschd.msc in the input field and press Enter. Select Create Basic Task... in the Actions menu on the right.  After this, the Create Basic Task Wizard window will open, where you need to fill out four tabs: Create a Basic Task. Enter the name and description of the task and click Next. Trigger. Specify how often the batch file should be run and at what time. Action. Select Start a program, click Next and specify the path to the batch file. Finish. Check all entered data and click Finish. The batch file is now added to the Windows schedule and will be run automatically according to your settings. Add comments to batch files When necessary, you can also add comments to .BAT files in Windows. There are three ways to leave comments while writing a batch file: rem. Enter the comment immediately after it: rem your_comment_here Double colon. Works similar to the rem command. :: your_comment_here goto. This one is used not only for commenting, but also for moving to another part of the batch file. After entering the command, indicate a label (in the example below it is start). goto startyour_comment_here:start Each comment must have its own unique tag. Basic commands for .BAT files Below are the main commands used when writing a batch file. Command Argument Description cd Catalogue Going to the specified directory (empty argument returns the current directory). pause - Pausing a batch file. start File path/command Executing the specified program or command in a separate window. md Catalogue Creating a directory. copy Path to source files and destination directory Copying one or more files to a specified directory. del File or directory name Deleting one or more files. call Path to the file to run Running a batch file from another batch file. title Title Changing the window title. move Source and destination path to file/files Moving one file or group of files from one directory to another. color Background and text color (set by number or letter) Changing the background and text color  exit - Terminating the batch file. This is not a complete list. To check all the commands, write help in the Command Prompt. Variables You can also use variables when writing a batch file. To add a variable, use the set command. First, enter set, then the variable name, then its value. If you need to access a variable and read its value, add the % symbol on both sides of the variable name. For example:  @echo offset example=Hello, user!echo %example%pause Please note that there are no spaces before or after the equal sign, otherwise the program will not work.  When you run the batch file with this content, the system will output "Hello, user!". Also, when declaring a variable, you can use the /a flag, which allows to assign a number to the variable. For example: @echo offset /a example=2*3echo %example%pause Without the flag, the entire string after the equal sign is assigned to the variable. When run, the program will output the number 6. In addition to regular variables, there are argument variables. These variables are assigned values that are passed when the batch file is exported. They look like this: %1, %2, %3, etc. Here's an example: @echo off@echo First argument variables - : %1@echo Second argument variables - : %2@echo Third argument variables - : %3pause When running this batch file, we will pass the string "Hello, user!" The result will be shown in the picture below. Batch file example: removing unnecessary files While working, we often end up with unnecessary files that need to be cleaned. A correctly written batch file does an excellent job of this. Suppose you have a lot of .TXT files in a certain directory and its subdirectories that you no longer need. Let's create a simple batch file for this case: @echo offdel /f /s /q C:\path_to_directory\Example\*.txt Let's look at how each flag works: /f allows you to delete all files (even the read-only ones). /s allows you to delete files not only from the directory but also its subdirectories. /q removes confirmation of file deletion. Now, to test this batch file, let's create the Example directory and the ExampleWithTXT subdirectory, and then add three .TXT files to both: mkdir Example cd Example mkdir ExampleWithTXT notepad Example1.txt notepad Example2.txt notepad Example3.txt cd ExampleWithTXT copy C:\path_to_directory\Example\*.txt Now, drag-and-drop the batch file to the Command Propmpt window and look at the result. The output must show that all six files were successfully removed from the Example directory and the ExampleWithTXT subdirectory. Conclusion In this guide, we described in detail how to create and use .BAT files in Windows and provided basic commands for working with them. Following this tutorial, you can create your first Windows bat script to automate working with the Windows OS. If you want to know more, we prepared for you some instructions on how to create cloud server.
05 June 2025 · 7 min to read
Python

How to Install pip on Windows

pip is a utility that turns Python package installation and management into a straightforward task. From Python beginners to coding wizards, having this utility on your Windows computer is a true game-changer. It effortlessly facilitates the setup of crucial frameworks and libraries for your development needs. Automating package management with pip frees up your time and reduces the complications linked to manual installations. Follow this guide to become proficient in configuring pip and overseeing your Python packages seamlessly. pip Setup Process for Windows Here are the guidelines to set up pip on a Windows machine. Step 1: Confirm Installation Verify Python is operational on your device before starting the pip setup. To carry out this operation, run command prompt and apply: python --version   If Python's not present on your system, download it from the official site. Step 2: Download get-pip.py Python's standard installation package automatically includes pip. However, in case of accidental removal, grab the get-pip.py script.  You have a couple of options: either visit the pip.py webpage, or use the curl command for a quick install: curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py Note: Installing Python again to get pip is also an option. However, it can sometimes lead to conflicts with other dependencies or settings. Your existing Python setup stays unchanged with this script. Step 3: Run get-pip.py Move to the script’s location through the command prompt and apply: python get-pip.py This will smoothly install pip on your device. Step 4: Confirm pip Installation Validate the installation by executing: pip --version Applying this command ensures pip is installed on the system. Step 5: Add pip to System PATH If the command doesn't execute properly, update your system PATH with these instructions to incorporate pip: Access Properties by right-clicking on My Computer or This PC from the drop-down menu. Opt for Advanced system settings. Select Environment Variables. Head over to System Variables, spot the Path variable, and choose Edit. Insert the Python Scripts directory into your system PATH, for example, C:\Python39\Scripts. Alternative Ways for pip Installation on Windows Let's discuss a few other ways to effortlessly get pip running on Windows. Via Built-in ensurepip Module From Python 3.4 onward, there's an awesome built-in module named ensurepip. With this tool, pip installation is simplified, eliminating the need for the get-pip.py script. Step 1: Run ensurepip Input the command below to set up pip: python -m ensurepip --default-pip Step 2: Verify pip Installation Check pip version through: pip --version Python Installer Approach for pip Installation Ensure the pip checkbox is marked during the Python setup. Here's how: Step 1: Download Installer Fire up your favorite browser, go to the official Python website, and acquire the most recent installation file. Step 2: Launch the Installer Launch the installer you've downloaded and remember to pick the Add Python to PATH option while setting up. Step 3: Install pip While progressing through the setup, don't forget to enable the Install pip option. Step 4: Validate pip is Installed When the setup wraps up, check pip installation via: pip --version Adjusting pip Version: Upgrade or Downgrade pip can be adjusted to suit your requirements by upgrading or downgrading. Here's how: Upgrading pip To give pip a fresh upgrade, execute: python -m pip install --upgrade pip Downgrading pip To roll back pip, apply: python -m pip install pip==<version> Enter the desired version number to install instead of <version> (e.g., 21.0). Resolving pip Installation Issues: Essential Commands Let's discover common pip installation issues and their fixes: Issue 1: "pip" is not recognized as an internal or external command Solution: This implies the pip path isn't set in your system PATH. Simply follow the instructions in "Step 5" to fix this. Issue 2: Permission Denied Solution: Elevate your command prompt privileges by right-clicking the Command Prompt icon and choosing Run as administrator. Afterward, rerun the commands. Issue 3: Missing Dependencies Solution: Sometimes, you'll run into trouble because of missing dependencies. To correct this, manually install the essential dependencies with pip. For example: pip install package_name Swap out package_name for the appropriate dependency. Utilizing Virtual Environments Employing virtual environments keeps dependencies distinct and avoids any conflicts. Here's how to utilize a virtual environment with pip: Creating a Virtual Environment python -m venv env_name Replace env_name with your desired environment name. Initiating Your Virtual Environment env_name\Scripts\activate Standard pip Commands To explore pip's usage, check these essential commands: Installing a Package pip install package_name Modify package_name to accurately reflect the package you're aiming to install. Uninstalling a Package pip uninstall package_name Showing Installed Packages pip list Showing Package Information pip show package_name Optimal Strategies for Package Management Employ virtual environments to handle dependencies efficiently in multiple projects. Regularly inspect and upgrade your packages to keep everything running smoothly. Prepare requirements files to ease the management of dependencies in your projects. Securing pip Installation Ensuring the protection of packages handled by pip is critical. Here are some tips to keep your environment secure: Maintain project isolation to avoid conflicts and secure installations. Check the trustworthiness and verification of package sources before installing. Always refer to official repositories and examine reviews if they are available. Consistently update pip and your packages to stay protected with the latest security patches and improvements. Periodically review your dependencies for known vulnerabilities. Tools such as pip-audit can assist in identifying and resolving security concerns. Adhere to secure coding standards and steer clear of deprecated or insecure packages. Integrating pip with IDEs pip can be effortlessly embedded into various Integrated Development Environments (IDEs), significantly boosting your development efficiency: VS Code: Utilize the built-in terminal for direct pip command and package management within the editor. PyCharm: Streamline package management by setting up pip configurations via the project interpreter. This simplifies the process of installing and managing packages customized to your project's specific needs. Jupyter Notebook: Employ magic commands in the notebook interface for direct package installation. This provides a smooth and integrated experience for managing dependencies while you work on your interactive notebooks.  Conclusion Windows offers several methods to set up pip, catering to different preferences and requirements. No matter if you select the .py script, use Python's built-in ensurepip module, or enable pip during the initial setup, these approaches will make sure pip is properly configured on your system. This all-in-one guide empowers you to handle and install Python packages with ease. Don't forget, keeping pip updated is essential for ensuring the security and efficiency of your Python setup. Routinely check for updates and keep pip upgraded. In addition, on our application platform you can find Python apps, such as Celery, Django, FastAPI and Flask.
15 January 2025 · 6 min to read
Python

How to Install Python on Windows 10

Python is a high-level programming language used by millions of programmers and developers. It is intuitive, offers many useful tools and libraries, and is essential for working with and analyzing large datasets. However, Python is not pre-installed on Windows operating systems. This guide will walk you through installing Python on Windows 10. Which Version to Choose There are two main versions of Python: Python 2 and Python 3, and they are patible. Python 3 was released in 2008 to address issues found in Python 2. It offers more straightforward, intuitive syntax, a wide range of useful libraries (especially for data analysis), and a large community supports it. Python 2 is no longer supported, unlike Python 3. Therefore, for new projects, you only need Python 3. However, if you need to work on projects written in Python 2, you might still need this version, so we will also explain how to install it. How to Install Python 2 To install Python 2 on Windows 10: Open your browser and go to the official website python.org. Go to the Downloads section. In the Downloads section, find the section for specific releases and locate the version you need. The last Python 2 release is 2.7.18. Click on Download and check the related files. For your operating system, download the 64-bit installer (it is the last file in the list). Once the file is downloaded, open it. Before starting the installation, the installer will allow you to choose the installation path and additional tools. Select the necessary options and start the installation. How to Install Python 3 on Windows There are several ways to install Python, each with its own features, advantages, and disadvantages: Full Installation: Installs all components of Python, which is ideal for most projects. Microsoft Store Installation: Suitable for development environments and running scripts. NuGet Package Installation: Python comes as a ZIP file with the .nupkg extension, designed for continuous integration systems. It does not include the user interface. Ideal for building packages and running scripts. Embeddable Package: Installs a minimal version of Python, often used as part of a larger application or project. Full Installation Using the Official Installer The steps for installing Python 3 from the official website are similar to those for Python 2. Here’s how to install Python 3 on Windows 10: Open your browser and go to python.org. Go to the Downloads section. Click on Download Python x.x.x (the latest version). Once you click it, the installer will start downloading. After downloading, open the installer. If Python 3 is already installed, the installer will offer to update it to the version you just downloaded. If Python is not installed, it will offer a fresh installation. Make sure to check the following options: Installing for all users. Add Python to PATH (this allows you to use Python from the command line). There are two installation options: Install now: Administrator rights are not required. Python will be installed in your user directory. Standard libraries, test suites, a launcher, and pip will be installed. Customize Installation: May require administrator rights. Python will be installed in the Program Files directory. Additional features can be installed. The Python standard library can be precompiled into bytecode. Choose the option that suits you and start the installation. After it finishes, disable the MAX_PATH length limitation to avoid errors related to file path length. To check if the installation was successful, run the command python --version in the command line. If everything went well, you should see an output like this: Python 3.10.8 Python is now installed and ready to use. Installing Python via Microsoft Store To install Python from the Microsoft Store: Open the Microsoft Store application. In the search bar, type Python 3.x, specifying the version you want (e.g., "Python 3.10"). Click Get. The download and installation will begin automatically. Installing Python Using NuGet To install Python on Windows via NuGet: Go to the official website and navigate to the Downloads section. Select the recommended version and download it. After opening the downloaded file, installation will take just a few seconds. To install Python, open Windows PowerShell and run the following commands: For the 64-bit version: nuget.exe install python -ExcludeVersion -OutputDirectory For the 32-bit version: nuget.exe install pythonx86 -ExcludeVersion -OutputDirectory Embeddable Package The embeddable package provides a minimal Python environment. It is distributed as a ZIP file and is intended to integrate Python into larger applications. The embeddable package is not designed for direct user access. You will have a fully isolated Python environment when extracted from the archive. It will be isolated from the user’s operating system, including environment variables (like PATH), the system registry, and any installed packages. The standard Python library is included in the embeddable package as compiled and optimized files. However, this version does not include a package manager (pip) or documentation. You can download the embeddable package from the python.org website: Go to the Downloads section. Clicking on Download will download the regular version, so click the hyperlink for Python for Windows instead. Click Latest Python 3 Release - Python x.x.x. Scroll down to the Files section and choose one of the embeddable versions (for 64-bit or 32-bit systems). Conclusion This guide has covered various methods for installing Python on Windows 10. For more useful Python resources, you can explore our tutorials. If you want to build a web service using Python, you can rent a cloud server at competitive prices with Hostman.
18 October 2024 · 5 min to read

Do you have questions,
comments, or concerns?

Our professionals are available to assist you at any moment,
whether you need help or are just unsure of where to start.
Email us
Hostman's Support