0

I have (tigerVNC) vncserver setup correctly on the new installed Ubuntu 24.04.1 and also tried the ubuntu 24.04 default remote login feature. Both feature doesn't keep the desktop section after restart.

I use the below xstartup file under .vnc folder to properly initialize the vncserver with xfce4.

env -i /bin/sh -c "export PATH=$PATH;
                   export XAUTHORITY=$XAUTHORITY;
                   export DISPLAY=$DISPLAY;
                   export HOME=$HOME;
                   export LOGNAME=$LOGNAME;
                   export USER=$USER;
                   /usr/bin/xfce4-session"

The strange thing is that I can only successfully start the vncserver after I login in front of the PC. Any attempt to start the vncserver via ssh or boot startup failed.

Through ssh I can boot with tigervncserver -xstartup /usr/bin/xterm, but I cannot get the xfce4 or the default Gnome desktop to work.

I do have access to the rdp desktop via default remote sharing feature (not install xrdp). However, Whenever I login remotely (not within the same intranet or wifi network but through vpn or gateway route mapping), I cannot login successfully to the rdp desktop. I have tried ssh -X and also using a openVPN connected to that network. No way works so far. It's either failed to connected immediately.

Any suggestions that can help solve the problem will be appreciated. Either it's about vncserver ssh/boot start up for Xfce or rdp setup that I can access the desktop remotely after ubuntu server reboot. As the server restart do happened sometimes.

The way I proposed in the answer below suffer from another issue as others mentioned: RDP doesn't keep sessions alive in Ubuntu 24.04 after disconnecting How to disable logoff on session disconnect in Ubuntu native RDP

In a nutshell, when I close the RDP connection, the ubuntu server will log off the user and hence the next time when I log in to ubuntu via RDP again, it's a new session but not the previous section.

I tried to bypass this issue by sharing screen, which means I physically log in the account in front of the laptop and keep the machine running. However, I find I am not able to access the desktop sharing when I am not within the intranet of the ubuntu server. However, remote login works in such setup. But remote login will reset everything after I close the RDP client window which is not desired.

So I am still suffering from a proper way to working with ubuntu 24.04 remotely. I am looking forward to any suggestions.

Besides that, vncserver suffser from significant delay when connecting using openVPN tunnel, I would prefer the remote login feature to work.

cnMuggle
  • 11
  • 3

1 Answers1

1

update on 26Dec2024 enter image description here

use chrome-remote-desktop finally works great after reboot. I didn't get the default ubuntu GUI but xfce4 GUI when remote-login. (choose the first option shown above for linux GUI desktop, the other options seems not work)

###previous reply##################

I finally figured out remote login via RDP using the answer from the following question. Vncserver is not as useful as RDP in 24.04.1. I don't need to install xrdp as the remote login is a default feature now in ubuntu 24.04.1, just enabled it in setting->system->remote desktop. The problem with this way of remote login is that once the RDP client disconnect, the whole remote section is log out, this issue has no answer yet.

RDP Black Screen with White Cursor on 24.04LTS

In the new Microsoft RDP Client (now called Windows App), you need to change the settings in the RDP file.

  1. Find the line that says: use redirection server name:i:0
  2. Change it to: use redirection server name:i:1

If you can't find the RDP file, you can create a new one:

  1. Right-click on your current connection.
  2. Select "Export" to save the file.
  3. Open the saved file and make the changes mentioned above.
  4. Import the edited file as a new connection.

Shout out to: Reddit Answer from @JohnDoeMan79

cnMuggle
  • 11
  • 3