How to Connect Remote Windows System from Linux Command Line

In a world where cross-platform connectivity is key, the ability to connect to a remote Windows system from a Linux command line can be a game-changer. Thanks to powerful tools like xfreerdp, this process has become seamless and efficient.

In this guide, we will explore how to connect to a remote Windows system using xfreerdp, empowering Linux users with remote desktop capabilities.

Installing xfreerdp

Before you can use xfreerdp, you need to install it. On most Linux distributions, you can use the package manager to do this. For example, on Ubuntu / Debian and Linux Mint, run following apt command

$ sudo apt update
$ sudo apt install freerdp2-x11 -y

Apt-Install-freerdp2-Ubuntu-Debian-LinuxMint

For RHEL based distributions like Rocky Linux, AlmaLinux and Fedora, run

$ sudo dnf install freerdp -y

Connecting Remote Windows System with xfreerdp

Post installation, we can take the RDP of remote windows machine using following xfreerdp command,

$ xfreerdp /u:”username” /v:<Remote-Windows-IP>:3389

Replace <username> with your windows username and <remote_windows_ip> with the IP address or hostname of the Windows system.

Example,

$ xfreerdp /u:"Administrator" /v:54.226.239.0:3389

Xfreerdp-Remote-Windows-System-Command-Line

It prompts you to trust the certificate, Press Y and then enter password of your remote windows systems administrator password. After entering the credentials, we will connect to remote windows system as shown below:

Remote-Windows-RDP-Xfreerdp-Linux

xfreerdp offers a range of advanced options that allow you to customize your remote desktop experience. For instance, you can adjust the screen resolution, enable sound, specify a domain, and much more. Here’s an example:

$ xfreerdp /v:<remote_windows_ip> /u:<username> /p:<password> /w:800 /h:600 /sound /d:<domain>

  • /w and /h: Set the desired width and height of the remote desktop window.
  • /sound: Enable sound redirection.
  • /d: Specify the domain if needed.

Example for customize remote desktop size,

$ xfreerdp /u:"Administrator" /v:18.209.23.239:3389 /w:800 /h:600

Smart-Sizing-Remote-Windows-RDP-Xfreerdp

Note: Before taking RDP, please make sure remote desktop option is enabled in remote windows system.

That’s all from this guide, I hope you have found it useful and informative. Please don’t hesitate to post your queries and feedback in below comments section.

Conclusion

xfreerdp empowers Linux users to effortlessly connect to remote Windows systems directly from the command line. Whether you’re managing servers, troubleshooting issues, or accessing Windows applications, xfreerdp streamlines the process while ensuring a secure and responsive experience. Embrace the power of cross-platform connectivity and enhance your remote desktop capabilities with xfreerdp today!

5 thoughts on “How to Connect Remote Windows System from Linux Command Line”

  1. Just a little help.. -XY can help even more. The -Y is compression. Many times I use both -X and -Y because with just -X, as an example, running virt-manager on my KVM host seems to lag. Nice article!

  2. Case not run because of XDISPLAY execute this action:

    1 – yum install -y xauth
    2 – yum install -y firefox

    exit terminal

    login with this command: ssh -X @ or ssh -Y @
    When access the terminal as user, see that a output with this information: /usr/bin/xauth: file /home/sm/.Xauthority does not exist
    When this information is see then now the file: /home/sm/.Xauthority is created, but is necessary that u do logout and login.

    Exit again and login with same command last informed.

    Ok now u running command in this blog

Leave a Comment

Your email address will not be published. Required fields are marked *