Error When Using XfreeRDP to provide desktop access to the lab virtual machine

[ERROR][com.freerdp.client.x11] - failed to open display:
[ERROR][com.freerdp.client.x11] - Please check that the $DISPLAY environment variable is properly set.

I get the above error when I try to log in to Ubuntu on Windows .

I enter this command with the correct parameters and get the error. I am in the default user account.

xfreerdp /v:<target IP> /u:<user> /p:<password>

What am I doing wrong?
1 Like

Hello, did you finally found an asnwer ? I’m totally lost… I try to connect on DC1 or any windows machine and thenb rdp to DC1 but the same error occur each time.
Thank you :slight_smile:

I don’t know if you have solved this or not.
I have been having the same problem when using pwnbox. I found if I used xfreerdp as root it would show the error. However if I used it just as the user I was logged in as xfreerdp connected without problems.
Hope this helps someone.

1 Like

Would be really nice if people came back to actually answer the question. This is not a spoiler but just a setting thing. Any ideas how to fix this?

The best advice I got was this…

 $ env | grep SSH
SSH_CLIENT=192.168.182.159 45462 22
SSH_TTY=/dev/pts/28
SSH_CONNECTION=192.168.182.159 45462 192.168.188.120 22

SSH_CLIENT and SSH_CONNECTION show you the IP address of your origin terminal. In which case I export the following:

 $ export DISPLAY="192.168.182.159:0.0"
 
From this post:
https://unix.stackexchange.com/questions/598924/display-environment-variable-not-set

However, I realized that port 3389 was open on the Linux jump/attack box and just xfreed to that directly, then xfreed to the Windows target.

This worked for me, thanks!

1 Like