Installing RDP on Linux Server / Ubuntu Server

Here is the complete list of commands for creating a ne

1. Create a Separate User in Ubuntu with a Home Directory

  1. Open Terminal:

    • Press Ctrl + Alt + T to open the terminal.
  2. Create the New User:

    • Replace newusername with your desired username.
    sudo adduser newusername
    
  3. Add User to the sudo Group (Optional):

    • If you want the new user to have administrative privileges, add them to the sudo group:
    sudo usermod -aG sudo newusername
    
  4. Verify the New User:

    • To check if the user is created and see the home directory:
    ls /home
    

2. Install Ubuntu Desktop Environment

You can install the default GNOME desktop or other environments. Below are commands for both options.

Install Ubuntu Desktop (GNOME)

  1. Update Package List:

    sudo apt update
    sudo apt upgrade
    
  2. Install GNOME Desktop Environment:

    sudo apt install ubuntu-desktop
    

3. Install and Configure lightdm (If Preferred)

If you want to use lightdm as your display manager, follow these steps.

  1. Install lightdm:

    sudo apt install lightdm
    
  2. Choose lightdm as the Default Display Manager:

    • During installation, you might be prompted to choose a display manager. If not, run:
    sudo dpkg-reconfigure lightdm
    
    • Select lightdm (or another preferred option) when prompted.
  3. Restart the System:

    sudo reboot
    

4. Reboot the System

After installing the desktop environment and configuring the display manager, reboot the system:

sudo reboot

Install Chrome Remote Desktop on the VM instance

  1. In the SSH window for your VM instance, add the Debian Linux Chrome Remote Desktop repository to your apt package list, and install the chrome-remote-desktop package.
curl https://dl.google.com/linux/linux_signing_key.pub \
    | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/chrome-remote-desktop.gpg
echo "deb [arch=amd64] https://dl.google.com/linux/chrome-remote-desktop/deb stable main" \
    | sudo tee /etc/apt/sources.list.d/chrome-remote-desktop.list
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive \
    apt-get install --assume-yes chrome-remote-desktop

The DEBIAN_FRONTEND=noninteractive parameter suppresses a prompt to configure a layout for a keyboard that would be directly connected to the VM instance.