2nd scenario is not yet supported in CE which does not install a UiPath Service.
However I managed to make it work with 1) by adding HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Terminal Server Client
-RemoteDesktop_SuppressWhenMinimized
and set it’s value to 2.
If not doing this I would receive Desktop has been disconnected while performing UI actions.
error.