- Start by installing needed packages:
Press enter when it asks to confirm that you want these packages installed.
Code: Select all
apt-get update apt-get install ubuntu-desktop xrdp
- Create a user other than root, to use for your desktop. "John" is used as an example below; replace it with your desired username.
(Then, enter your desired password at the prompts.)Code: Select all
useradd John -g users -G sudo -m passwd John
- Switch to the new user you created.
Code: Select all
sudo -u John /bin/bash
- Create a configuration file. to make the remote desktop look like the default one.
Code: Select all
cat <<EOF > ~/.xsessionrc export GNOME_SHELL_SESSION_MODE=ubuntu export XDG_CURRENT_DESKTOP=ubuntu:GNOME export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg EOF
- Configure the system to not start the GUI on the default screen (the terminal that shows under the "VNC console" page). You want to be able to access it remotely instead.
(If you do want to see the GUI at boot, use systemctl set-default graphical.target. However, please note that a bug in Ubuntu 22.04 seems to prevent the mouse from working right, and it will present some additional configuration screens that push you to create a new user, set a time zone, and some other things.)Code: Select all
systemctl set-default multi-user.target
- Connect to your server IP address using a Remote Desktop Connection, then log in with the username and password that you chose. On Windows:
- Press the Start key or click on the start menu
- Type Remote
- Click the Remote Desktop Connection option
- Into the Computer field, enter the IP address of your VDS, from the "IP list" page
- Click Connect
- When Windows says "The publisher of this remote connection can't be identified...", check "Don't ask me again for connections to this computer" and then click "Connect"
- When windows says "The identity of the remote computer cannot be verified..", check "Don't ask me again for connections to this computer" and then click "Connect"
- On the Login screen that appears, enter your username and password, then click OK
Sources:
https://askubuntu.com/questions/1233088 ... g-remotely
Set up a desktop with RDP on Ubuntu 22.04
- Edge100x
- Founder
- Posts: 12888
- https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
- Joined: Thu Apr 18, 2002 11:04 pm
- Location: Seattle
- Contact:
Set up a desktop with RDP on Ubuntu 22.04
Anything in a code block below is designed to be copied-and-pasted into a SSH session. On Windows, you can do this by selecting the text, pressing Control-C, going to your PuTTY (or other SSH client) terminal window, and right-clicking. The text that you are pasting will be selected; just press Enter to have those commands execute.