1

I'm working with an existing tool that requires a RDP connection to a Ubuntu server.

The application runs in a xvfb display server (using the command xvfb-run) on a specific DISPLAY on the server.

I've installed xrdp to open a connection to this Xserver, however each time i initiate a new connection, the xrdp-sesman (which is the session manager of the xrdp tool) opens a new Xvnc server on a different DISPLAY.

My goal would be to tunnel the xrdp connection to the specific DISPLAY where my application is, does anyone know if this is possible ?

Sim Hm
  • 97
  • 3
  • 13

1 Answers1

0

The v in xvfb means that you are using a virtual display.

You probably want to look into something like x11vnc.

x11vnc allows one to view remotely and interact with real X displays (i.e. a display corresponding to a physical monitor, keyboard, and mouse) with any VNC viewer. In this way it plays the role for Unix/X11 that WinVNC plays for Windows.

AskUbuntu has the guide for setup as such (quoted below)

You'll need xrdp together with x11vnc if you want remote access to your Unity desktop.

First, install xrdp and x11vnc: apt-get install xrdp x11vnc (or whatever your distribution equivalent is)

Then edit /etc/xrdp/xrdp.ini and make sure it contains at least the following:

 [globals]
 bitmap_cache=yes 
 bitmap_compression=yes 
 port=3389
 crypt_level=high 
 channel_code=1 
 max_bpp=24


 [xrdp1]
 name=Remote Desktop
 lib=libvnc.so
 username=ask
 password=ask
 ip=127.0.0.1
 port=5900 

Restart xrdp for the changes to take effect:

/etc/init.d/xrdp restart

Now open up a terminal window (Ctrl+Alt+T) and set up a VNC password (you don't want to leave wide open access to your desktop from the internet):

x11vnc -usepw

You'll be prompted to set up a password, that will be used for RDP authentication.

The last step is to start x11vnc. There are tons of options that you can use, but here is an example to get you started (run this in the same terminal window you just opened):

x11vnc -rfbauth ~/.vnc/passwd -display WAIT:0 -reopen -nevershared
-forever -wirecopyrect always -scrollcopyrect always -norepeat -1 -xkb -capslock -skip_keycodes 187,188 -bg -o ~/x11vnc.log &

The & at the end will leave x11vnc running the background, so you can close the terminal window and leave it running.

You'll need to add this command to your startup scripts if you want x11vnc to run automatically after a reboot.

zglin
  • 2,891
  • 2
  • 15
  • 26
  • Hello, actually i've already tried this solution, and the problem is the responsive-ness of the window, when i tunnel, the x11vnc doesn't resize with the size of my client (i know it may seem minor but it actually causes border effects on the tool opening the RDP connection) – Sim Hm Mar 15 '19 at 14:40
  • @SimHm unfortunately that statement looks correct. As you are using x11vnc you are really connecting via VNC, therefore I doubt that advantages of the RDP protocol (such as compression or better responsiveness) won't be available. I am looking for options too. – Tk421 Jun 11 '20 at 00:14
  • It would be worth it to investigate the combination of xvfb + xorgxrdp + xrdp – Tk421 Jun 11 '20 at 00:26