diff --git a/data/cloud-init-yaml/cloud-init-gnome-rdp.yaml b/data/cloud-init-yaml/cloud-init-gnome-rdp.yaml new file mode 100644 index 00000000000..eacd0e591b1 --- /dev/null +++ b/data/cloud-init-yaml/cloud-init-gnome-rdp.yaml @@ -0,0 +1,20 @@ +package_update: true +package_upgrade: true +users: + - default +packages: + - ubuntu-desktop + - gnome-remote-desktop + - winpr3-utils +runcmd: + - sudo -u gnome-remote-desktop winpr-makecert3 -silent -rdp -path ~gnome-remote-desktop rdp-tls + - grdctl --system rdp set-tls-key ~gnome-remote-desktop/rdp-tls.key + - grdctl --system rdp set-tls-cert ~gnome-remote-desktop/rdp-tls.crt + - grdctl --system rdp set-credentials ubuntu + - echo ubuntu: | sudo chpasswd + - echo /usr/sbin/nologin >> /etc/shells + - grdctl --system rdp enable + - systemctl enable --now gnome-remote-desktop.service + - systemctl enable --now gdm + - sudo systemctl set-default graphical.target + - loginctl enable-linger ubuntu diff --git a/docs/how-to-guides/customise-multipass/set-up-a-graphical-interface.md b/docs/how-to-guides/customise-multipass/set-up-a-graphical-interface.md index 441d04db3e3..64e0ef73334 100644 --- a/docs/how-to-guides/customise-multipass/set-up-a-graphical-interface.md +++ b/docs/how-to-guides/customise-multipass/set-up-a-graphical-interface.md @@ -14,9 +14,34 @@ You can display the graphical desktop in various ways. In this document, we desc ## Using RDP -The images used by Multipass do not come with a graphical desktop installed. For this reason, you will have to install a desktop environment (here we use `ubuntu-desktop` but there are as many other options as flavours of Ubuntu exist) along with the RDP server (we will use `xrdp` but there are also other options such as `freerdp`). +The images used by Multipass do not come with a graphical desktop installed. For this reason, you will have to install a desktop environment. Here, we use `ubuntu-desktop` but there are as many other options as flavours of Ubuntu exist. You also have to install the RDP server. We will use XRDP or GNOME Remote Desktop but there are also other options such as FreeRDP. -To do this, first you need to log into a running Multipass instance. Start by listing your instances: +### Which RDP server to use + +Ubuntu 25.10 with GNOME removed support for the X11 protocol, and as a consequence, XRDP no longer works there. Choose the RDP server depending on the Ubuntu release and the desktop on your instance: + +```{list-table} +:header-rows: 1 + +* - Instance + - RDP server + +* - Earlier than Ubuntu 25.10 + - {ref}`set-up-the-xrdp-server` + +* - Ubuntu 25.10 and later with GNOME + - {ref}`set-up-the-gnome-remote-desktop-server` + +* - Ubuntu 25.10 and later with KDE, Xfce or other alternative desktop + - {ref}`set-up-the-xrdp-server` +``` + +(set-up-the-xrdp-server)= +### Set up the XRDP server + +Use this RDP server with Ubuntu Desktop earlier than version 25.10 as your instance, such as Ubuntu Desktop 24.04 LTS. You can also use XRDP with alternative desktops such as KDE or Xfce regardless of the Ubuntu release. + +First, you need to log into a running Multipass instance. Start by listing your instances: ```{code-block} text multipass list @@ -50,9 +75,83 @@ sudo passwd ubuntu You will be asked to enter and re-enter a password. -You are done on the server side! +You are done on the server side! Quit the Ubuntu shell on the running instance with the `exit` command. Proceed to {ref}`connect-to-the-instance-with-an-rdp-client`. + +(set-up-the-gnome-remote-desktop-server)= +### Set up the GNOME Remote Desktop server + +This RDP server only works with the default GNOME desktop. You can use it with Ubuntu Desktop 25.10, 26.04 LTS and later as your instance. + +1. Create the following `cloud-init.yaml` configuration file: + + ```{code-block} yaml + :caption: cloud-init.yaml + :emphasize-lines: 14,15 + + package_update: true + package_upgrade: true + users: + - default + packages: + - ubuntu-desktop + - gnome-remote-desktop + - winpr3-utils + runcmd: + - sudo -u gnome-remote-desktop winpr-makecert3 -silent -rdp -path ~gnome-remote-desktop rdp-tls + - grdctl --system rdp set-tls-key ~gnome-remote-desktop/rdp-tls.key + - grdctl --system rdp set-tls-cert ~gnome-remote-desktop/rdp-tls.crt + - grdctl --system rdp set-credentials ubuntu + - echo ubuntu: | sudo chpasswd + - echo /usr/sbin/nologin >> /etc/shells + - grdctl --system rdp enable + - systemctl enable --now gnome-remote-desktop.service + - systemctl enable --now gdm + - sudo systemctl set-default graphical.target + - loginctl enable-linger ubuntu + ``` + + Replace `` with a secure password on the highlighted lines. -Quit the Ubuntu shell on the running instance with the `exit` command, and take note of the IP address to connect to. You can find the instance's IP address in the output of `multipass list` from the first step above, or you can use the `multipass info` command as well. +1. Launch the configured Multipass instance: + + ```text + multipass launch \ + --memory 12G \ + --cpus=2 \ + --disk 30G \ + --timeout 600 \ + --cloud-init ./cloud-init.yaml 25.10 + ``` + + Adjust the `--memory`, `--cpus` and `--disk` options as needed on your system. + + The command sets the timeout to 10 minutes because the default timeout of 5 minutes isn't enough to initialise the instance. + +1. List your instances: + + ```text + multipass list + ``` + + Sample output: + + ```text + Name State IPv4 Image + headbanging-squid Running 10.49.93.209 Ubuntu 25.10 + ``` + +1. Restart the Multipass instance: + + ```text + multipass restart headbanging-squid + ``` + +1. Proceed to {ref}`connect-to-the-instance-with-an-rdp-client`. + +(connect-to-the-instance-with-an-rdp-client)= +### Connect to the instance with an RDP client + +Find the instance's IP address in the output of `multipass list`, or you can use the `multipass info` command: ```{code-block} text multipass info headbanging-squid @@ -84,7 +183,9 @@ If the IP address of the instance is not displayed in the output of `multipass l ````{group-tab} Linux -On Linux, there are applications such as Remmina to visualise the desktop (make sure the package `remmina-plugin-rdp` is installed in your host along with `remmina`). +On Linux, there are applications such as Remmina to visualise the desktop. + +Make sure that the `remmina` and `remmina-plugin-rdp` packages are installed. To directly launch the client, run the following command: @@ -92,6 +193,10 @@ To directly launch the client, run the following command: remmina -c rdp://10.49.93.209 ``` +```{note} +To enable audio, open the Remmina application instead of connecting directly. Create a connection and set {guilabel}`Audio output mode` to {guilabel}`Local` in Advanced settings. Confirm with {guilabel}`Save and Connect`. +``` + The system will ask for a username (`ubuntu`) and the password set above, and then the Ubuntu desktop on the instance will be displayed. ```{figure} /images/multipass-remmina.png