Start by opening System Settings (Gnome Control Center).
Click "Sharing" on the left, then turn on the switch in the upper right corner, and click "Remote Desktop" below.
Turn on the switches of "Remote Desktop" and "Remote Control" in the pop-up window. The user name and password for remote connection can be set below. The address behind "ms-rd://" is the LAN address connected to Microsoft Remote Desktop.
Set up Microsoft Remote Desktop
Add a PC to Microsoft Remote Desktop, and fill in the above address in "PC name".
Click "Add User Account" in "User account" to add the user name and password set above.
After setting it up, you can connect to the desktop of Ubuntu 22.04.