1

I'm working remotely via SSH connection and need to use some GUI applications on the remote machine. I do not have an X-Server for X forwarding on my local machine, but a RDP client.

Can I somehow enable RDP via command line?

Usually one would do this in the Settings app in the "Sharing" tab.

slarag
  • 139

2 Answers2

1

Gnome Remote Desktop (RDP/VNC on Ubuntu 22.04 and other recent versions) can be enabled through command line by using the grdctl command.

The command line parameters are documented in the man pages of the cli tool, e.g. here.

When using it through SSH, I initially had the problem that

  • it was not working with sudo
  • using the tool without sudo blocked indefinetly because it was waiting for a graphical admin prompte on the desktop of the remote host.

The only workaround I found so far was to initially configure RDP direclty on the remote host first.

slarag
  • 139
-1

You could install, then start x11vnc on the remote machine, then use a VNC client to connect. If you require RDP specifically, then this answer (which also uses x11vnc, but with the xrdp connector) is your best bet.

However, if VNC is adequate, then it's pretty simple. Note that the three steps I list here do not provide any security! If the remote machine can be accessed by anyone other than yourself, make sure to man x11vnc and put a password on the remote x11vnc session.

  1. On the remote machine, install x11vnc

sudo apt install x11vnc

  1. On the remote machine, start x11vnc

x11vnc -forever

  1. On your machine, connect to the remote machine using your VNC client (e.g. Remmina)

Once you're finished, hit CTRL-C on your remote machine to exit x11vnc.

If you intend to use x11vnc more commonly, as I stated above, I recommend setting a password with x11vnc -usepw, and then examining some of the more advanced options it offers with man x11vnc. It's a powerful tool.

Scaine
  • 11,139
  • This is not what I was looking for. Newer versions of Ubuntu (e.g. 22.04) have RDP and also VNC support included in the Destkop settings. It can be enable through the Destop settings app and I was wondering if there's a cli-command or text file etc. to do this configuration from within the terminal wihtout gui interaction. – slarag Jan 12 '24 at 21:00