How to Connect Windows machine with RDP from CentOS 7 / RHEL 7 Console

There are some scenarios where linux admins need to connect to windows servers with rdp from linux console or GUI. Whenever we do the minimal installation of CentOS 7 or RHEL 7 we do not have any tools to RDP windows machine. So we have to manually install ‘freerdp’ package which will allows us to take remote desktop of windows server from console or terminal.

‘freerdp’ package is available in the default CentOS 7 and RHEL 7 repositories. In Case you have installed your CentOS 7 or RHEL 7 with Desktop Environments like GNOME or KDE then ‘freerdp’ package will be installed automatically.

Install freerdp on CentOS 7 / RHEL 7

Let’s first install Desktop environment related packages using the beneath yum command. If we don’t install these packages then xfreerdp command will not work from command line

[[email protected] ~]# yum install "@X Window System" xorg-x11-xauth xorg-x11-fonts-* xorg-x11-utils –y
[[email protected] ~]# yum install freerdp -y

Once the freerdp is installed successfully then we have ‘xfreerdp’ command through we can connect to windows machine.  Disconnect ssh session of your server and connect it again with ‘-X’ option. Example is shown below

ssh root@{your-server-ip} -X

Connect to Windows Machine with RDP from CentOS 7 / RHEL 7 Console or terminal

Run the below ‘xfreerdp’ command, replace the user name and ip address and screen resolution as per your setup.

[[email protected] ~]# xfreerdp -g 800x600 -u administrator



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

That’s all from this article, If you like above steps, please don’t hesitate to share with your technical friends 🙂

4 thoughts on “How to Connect Windows machine with RDP from CentOS 7 / RHEL 7 Console”

  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