BOINC / boinc

Open-source software for volunteer computing and grid computing.
https://boinc.berkeley.edu
GNU Lesser General Public License v3.0
2.01k stars 446 forks source link

Allow any remote desktop client OSX #2231

Open Toby-Broom opened 6 years ago

Toby-Broom commented 6 years ago

On my Mac, when I click "Show VM Console" then it asks me to download CoRD, however in my case I have the the microsoft remote desktop application. Could it be genericized so that any RDP capable program can be used?

CharlieFenton commented 6 years ago

From an email I sent in January 2012:

I tried MS RDC first, and spent a fair amount of time trying to use it. It is very strongly oriented to being used for connecting to MS Windows. I found it worked very poorly and unreliably trying to get it to connect automatically to the VM, and displayed warnings because it assumed it would be connecting to a Windows system.

I ended up choosing CoRD because it is free open source software, licensed under the GPLv2 license. It is based off the Unix program rdesktop, which is also licensed under the GPL.

chrstphrchvz commented 6 years ago

I think this is important because CoRD is no longer maintained, and even suggests using Microsoft's RDP client instead (cf. https://github.com/dorianj/CoRD/blob/master/README.md):

Deprecation Notice

This project is no longer being maintained as of August 16, 2015.
Please consider using the free official Remote Desktop Client from Microsoft, available on the Mac App Store.

chrstphrchvz commented 6 years ago

Cf. https://apple.stackexchange.com/a/199208https://docs.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/remote-desktop-uri: Microsoft's Remote Desktop Client for Mac (both versions 8.0.43 and 10.0.1) register their ability to open rdp:// URLs, so using e.g. open rdp://full%20address=s:localhost:3389 seems sufficient to connect. I'm not aware if any open-source clients register rdp:// URLs similarly, though; I don't mean to force anyone onto proprietary tools.

I haven't contributed code to BOINC before, but I might be able to fiddle with the relevant code of MainDocument.cpp and have a patch within the next week or so.

CharlieFenton commented 6 years ago

Thank you fro the links. I will look into this.

chrstphrchvz commented 6 years ago

Also, CoRD does support rdp:// URI/URLs, but only using e.g. open rdp://localhost:3389, and not in the "query-string" format Microsoft's client expects. I'm not sure which is the more authoritative or common convention (i.e. what other clients such as Remmina or rdesktop support).

CharlieFenton commented 6 years ago

I ran some tests with LHC@home and can successfully show the VM Console using Microsoft Remote Desktop. But there are a couple of issues which I feel make MRD unacceptable for this purpose: [1] Whereas CoRD displays the VM Console in a 1024X665 window, MRD 8.0.27325 uses the largest window that is not full screen; in other words, it leaves only room for the menubar and the window frame, covering everything else on that monitor including BOINC Manager. [2] MRD displays an alert saying

The identity of the Remote PC cannot be verified. ... Do you want to connect anyway? [Connect Always] [Do not connect] [Connect once]

If you select Connect Always the message is not repeated for future connections to that port, but appears again if a different port is referenced.

These issues occurred even when I tried all the seemingly relevant options in the open command: "rdp://full%20address=s:localhost:58713&connect%20to%20console=i:0&authentication%20level=i:0&prompt%20for%20credentials%20on%20client=i:0&desktopheight=i:662&destopwidth=i:1024&screen%20mode%20id=i:1" You can test this yourself as follows:

Please let me know if you find a solution to these issues.

CharlieFenton commented 6 years ago

I have now tested with Microsoft Remote Desktop 10.0.823 on OS 10.13.2, in addition to the problems with MRD 8.0, MRD 10.0 also displays an alert asking for a user name and password.

This can be eliminated by adding a dummy username and password to the RDP "query-string" like this: "rdp://full%20address=s:localhost:53608&connect%20to%20console=i:0&authentication%20level=i:0&prompt%20for%20credentials%20on%20client=i:0&desktopheight=i:662&destopwidth=i:1024&screen%20mode%20id=i:1&username=s:none:none" If you have both CoRD and MRD installed, entering just open with the rdp:// string might open CoRD instead of MRD. The following AppleScript will always open MRD:

tell application "Microsoft Remote Desktop"
    activate
    open location "rdp://full%20address=s:localhost:53608&connect%20to%20console=i:0&authentication%20level=i:0&prompt%20for%20credentials%20on%20client=i:0&desktopheight=i:662&destopwidth=i:1024&screen%20mode%20id=i:1&username=s:Charlie:none"
end tell
chrstphrchvz commented 5 years ago

I have not looked into this issue much more, but I would say that 1024x665 resolution used by CoRD is a red herring. Although I saw CoRD similarly use 1024x640 when I tried it, the VM was actually using 720x400.

The resolution issue is not specific to the MS RDP client on Mac. I wonder if RDP clients are even capable of knowing what resolution the VM is set to. Unlike connecting to a session on a physical screen over e.g. VNC, and therefore the server dictating the resolution used by the client, I would think the intended use case of RDP (controlling a session not tied to a physical screen) is for the client to dictate the resolution. VirtualBox supports the RDP client resizing the VM's resolution, but only when guest additions are active.

So BOINC Manager might have to use something like VBoxManage to query what the resolution is (assuming it has a subcommand with this information) in order to tell the RDP client what resolution to use. Or a specific/maximum resolution is agreed on ahead of time by VM workunits and hardcoded in BOINC Manager.

chrstphrchvz commented 5 years ago

So BOINC Manager might have to use something like VBoxManage to query what the resolution is (assuming it has a subcommand with this information)

Found it: VBoxManage showvminfo --machinereadable, then look for VideoMode="X,Y,colordepth". Example:

# Video mode during BIOS splash screen
$ VBoxManage showvminfo --machinereadable test | grep "^VideoMode="
VideoMode="640,480,32"@0,0 1

# Video mode during 80x25 text mode
$ VBoxManage showvminfo --machinereadable test | grep "^VideoMode="
VideoMode="720,400,0"@0,0 1
RichardHaselgrove commented 3 years ago

This issue is raised again in https://boinc.berkeley.edu/forum_thread.php?id=14173

Given the recent changes in OSX to accommodate Apple silicon, should we promote this up the priority order?