Error because $DISPLAY environment variable is not properly set

41,525

I assume xfreerdp is a gui programm (an "X client"). So on Linux, you need an "X server" to run it.
That's what you have on the GUI based Linux box.
You can not run it on the command-line-only Linux in itself.

Depending on what you are trying to do, it could make sense to run it on the command-line-only Linux and show the GUI somewhere else over the network. That's what DISPLAY is for.

You could do something like:

export DISPLAY=guilinuxbox:0.0
xfreerdp ...

(but you would need to set up the permissions to do so)

For illustrating what to expect when running a plain X server (as discussed in the comments for now):

This is what a plain X server looks like - you are seeing the root window with it's default pattern. There would also be a pointer whith an "X" shape:

X11-empty-rootwindow-default

Share:
41,525

Related videos on Youtube

oshirowanen
Author by

oshirowanen

Updated on September 18, 2022

Comments

  • oshirowanen
    oshirowanen almost 2 years

    Is it possible to start an xfreerdp session into Microsoft windows from a command-line only install of Linux?

    The command I use from a full blown Linux install is this:

    $ sudo xfreerdp /v:farm.company.com /d:company.com \
        /u:oshiro /p:oshiro_password /g:rds.company.com
    

    This command works fine. However, when I run the same command from a command-line install of Linux, I get the following error message:

    Please check that the $DISPLAY environment variable is properly set.
    freerdp_set_last_error 0x20001
    libfreerdp/core/freerdp.c:97: freerdp_pre_connect failed
    

    Both the GUI based Linux installation and the command-line only installation of Linux I have are Ubuntu 12.04. Both installations have xfreerdp version 1.2.0-beta1

  • oshirowanen
    oshirowanen about 10 years
    I just want to initiate an RDS session from the command-line install of Linux. How do I go about installing an xserver, I tried sudo aptitude install xserver-xorg-core, but it made no difference.
  • Volker Siegel
    Volker Siegel about 10 years
    You should probably install a whole desktop environment, maybe KDE, or a smaller one like XFCE - use what you know best. Install the default desktop environment of Ubuntu, try to install "ubuntu-desktop" (make backups as needed) - that package will propably install lots of others and make that box "GUI-based" too.
  • Volker Siegel
    Volker Siegel about 10 years
    Coud you describe what you mean by "initiate an RDS session"? Maybe I'm missing something - is it about a connection between two other boxes, and, from the command line, you only want to initiate that, not use it from there?
  • oshirowanen
    oshirowanen about 10 years
    I have a command line computer at home. In a remote location, I have an rdp server. I want to log into the rdp server from my command line computer and show a graphical desktop.
  • Volker Siegel
    Volker Siegel about 10 years
    Ok, then, you need to make the command line computer a GUI computer. Is there a technical reason to not install a full desktop environment - eg limited RAM or disk space? If so, one could technically install only a plain X server, and run only xfreerdp on it - but that would be very unusual, and only makes sense it there is a good reason to have no GUI-like things installed.
  • oshirowanen
    oshirowanen about 10 years
    So how would I install a plain x server to allow me to via a gui rdp session?
  • Volker Siegel
    Volker Siegel about 10 years
    You just need to choose the right X server package for your graphics card, and that should pull in the minimal set of packages required, and not much more (but still a lot maybe).
  • oshirowanen
    oshirowanen about 10 years
    I tried installing xorg, Doesn't that install everything or more than I need? Even with xorg, I got the same error.
  • Volker Siegel
    Volker Siegel about 10 years
    Now, I'm not sure that is what you actually should do, as the X server could be a little too plain for your expectation. Let me find a picture.
  • Volker Siegel
    Volker Siegel about 10 years
    The same error could mean that the X server was not running. Do you know how to switch virtual consoles with Ctrl+Alt+F1, Ctrl+Alt+F8 and similar? May be needed to get out of X when there is no window manager. If yes, try the command startx.
  • Volker Siegel
    Volker Siegel about 10 years
    Oh, this discussion stopped to match the actual question long ago. Do you think you it'd be good to change the question to have that matching again, or prefer a new question? I think the second would be a mess when trying to transfer some most applicable/useful part of the discussion...
  • oshirowanen
    oshirowanen about 10 years
    Thanks, startx gets rid of the original error message, but I am presented with another. I will start a new question for the new error message.