command line calling with arguments?

49 views
Skip to first unread message

Ted Serreyn

unread,
Dec 12, 2024, 4:46:42 PM12/12/24
to bVNC, aRDP, aSPICE, Opaque Remote Desktop Clients
Is it possible to pass the host/port information along on the mac aspice/bVnc clients?  or maybe support spice/VNC URLs?

I am tyring to use the spice and vnc viewers to get to consoles on GNS3.

currently VNC viewer is defined like this (using RealVNC viewer):
"/Applications/VNC Viewer.app/Contents/MacOS/vncviewer" %h:%p

and spice as (not working):

/Applications/RemoteViewer.app/Contents/MacOS/RemoteViewer spice://{host}:{port}




Ted Serreyn

i iordanov

unread,
Dec 12, 2024, 5:26:06 PM12/12/24
to Ted Serreyn, bVNC, aRDP, aSPICE, Opaque Remote Desktop Clients
Hi Ted,

Here are the options available on iOS/MacOS:

- Launch aSPICE on the commandline with a console.vv file (you can just double-click it, or you can pass it as the first and only parameter). Console.vv files are the config that Proxmox, OpenNebula, oVirt, and RH Enterprise Virtualization outputs. bVNC does not support "VNC files" at the moment.

- Launch both bVNC and aSPICE with a "Universal URL".

The Universal URL has all these parameters

(vnc|spice)://HOST:PORT?connectionName="Nickname of the connection to launch or create"

There are a couple more parameters that are for upcoming functionality, namely requiresVpn, vpnUriScheme, and externalId. I can go into details for those if they are relevant.

Relevant part of the code:

On Android there are ton more parameters for the URI intent that the apps support, but I guess you're not interested in that at the moment.

Does that help?

Cheers!
iordan

--
You received this message because you are subscribed to the Google Groups "bVNC, aRDP, aSPICE, Opaque Remote Desktop Clients" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bvnc-ardp-aspice-opaque-remot...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/bvnc-ardp-aspice-opaque-remote-desktop-clients/60317ec6-11b4-4592-94dd-a9adbea5de74n%40googlegroups.com.


--
The conscious mind has only one thread of execution.

i iordanov

unread,
Dec 12, 2024, 9:41:57 PM12/12/24
to Ted Serreyn, bVNC, aRDP, aSPICE, Opaque Remote Desktop Clients
Hi Ted,

Unfortunately that's not how one asks an application to open a "Universal URL" on MacOS / iOS.

One way that would work is to have a web page with links like:

                <a href="vnc://1.2.3.4:5900/?ConnectionName=test">VNC connection</a>
                <br>
                <a href="spice://2.3.4.5:5902/?ConnectionName=test">SPICE connection</a>

If that's not viable in your scenario, we'd need to implement URL support on the CLI.

iordan


On Thu, Dec 12, 2024 at 5:49 PM Ted Serreyn <tser...@gmail.com> wrote:

Ok so if I understand correctly this should work.

/Applications/bVNC.app/Contents/MacOS/bVNC vnc://192.168.168.44:5907

 

However it does not appear to work.

Application opens, but does not seem to go to the defined ip address (substituted different ip)

 

Ted Serreyn

Ted Serreyn

unread,
Dec 12, 2024, 9:42:18 PM12/12/24
to i iordanov, bVNC, aRDP, aSPICE, Opaque Remote Desktop Clients

Ok so if I understand correctly this should work.

/Applications/bVNC.app/Contents/MacOS/bVNC vnc://192.168.168.44:5907

 

However it does not appear to work.

Application opens, but does not seem to go to the defined ip address (substituted different ip)

 

Ted Serreyn

 

From: i iordanov <iior...@gmail.com>
Date: Thursday, December 12, 2024 at 4:26
PM
To: Ted Serreyn <tser...@gmail.com>
Cc: bVNC, aRDP, aSPICE, Opaque Remote Desktop Clients <bvnc-ardp-aspice-opaque...@googlegroups.com>
Subject: Re: command line calling with arguments?

i iordanov

unread,
Dec 13, 2024, 8:23:18 AM12/13/24
to Ted Serreyn, bvnc-ardp-aspice-opaque...@googlegroups.com
OK, I found how to open all manner of URLs from the CLI on a Mac.

Try these:



Cheers!
iordan

On Fri, Dec 13, 2024 at 8:14 AM Ted Serreyn <tser...@gmail.com> wrote:
yeah that’s what I was afraid of.

I’m going to see if I can use the built in URL mapping rather than the defined applications, but I’m not sure that is going to be feasible.

Even simple passing the host and port would be enough to get this to work from a basic step.   I’ll try to dig into the code a bit to see what it would take.


Ted Serreyn
Serreyn Network Services, LLC

On Dec 12, 2024, at 8:41 PM, i iordanov <iior...@gmail.com> wrote:



i iordanov

unread,
Dec 13, 2024, 5:54:28 PM12/13/24
to Ted Serreyn, bvnc-ardp-aspice-opaque...@googlegroups.com
Oh, I really like this osascript solution!

In version 41 of the apps, I am actually going to add URIs that start with the name of the apps (bvnc, ardp, aspice). So you can use that instead once they are out. But for the moment something like this does it.

osascript -e 'tell application "bVNC"'  -e '  open location "vnc://10.10.220.222.44:5907/?ConnectionName=TEST"' -e 'end tell'

And yes, you have to specify ConnectionName.

Cheers!

iordan


On Fri, Dec 13, 2024 at 12:38 PM Ted Serreyn <tser...@gmail.com> wrote:

Yeah not sure why, but vnc url opens the mac screen sharing application rather than bVNC.  Trying to figure out how apple handles this registration for urls rather than file open-with.

Spice url does seem to open the application, so I’ll need to play with it to see if spice consoles can be used instead of vnc.

 

 

Thought I had a solution, but looks like bVNC still didn’t like it.

I can use applescript to “tell” the application to open the URL.  And it doesn’t seem to handle it correctly.

 

Tried applescript:

osascript -e 'tell application "bVNC"'  -e '  open location "vnc://10.220.222.44:5907"' -e 'end tell'

 

tried direct open (after registering bVNC as application for vnc:// url)

open vnc://10.220.222.44:5907

 

You can use SwiftDefaultApps to register the URL for most URL to include ssh, telnet, spice, vnc.

 

Ted Serreyn

 

Debug log from bVNC

xwindowScene(_:didUpdate:interfaceOrientation:traitCollection:) called.

windowScene(_:didUpdate:interfaceOrientation:traitCollection:) called.

windowScene(_:didUpdate:interfaceOrientation:traitCollection:) called.

windowScene(_:didUpdate:interfaceOrientation:traitCollection:) called.

windowScene(_:didUpdate:interfaceOrientation:traitCollection:) called.

scene(_:willConnectTo:options:): []

sceneWillEnterForeground(_:) called.

sceneDidBecomeActive(_:) called.

windowScene(_:didUpdate:interfaceOrientation:traitCollection:) called.

scene(_:openURLContexts:)

handleUrlContexts(_:): vnc://192.168.168.44:5907

handleUniversalUrl(urlContext:) source application = Unknown

handleUniversalUrl(urlContext:) url = vnc://192.168.168.44:5907

handleUniversalUrl(urlContext:) Invalid URL

connectWithConsoleFile(url:pathString:) Could not startAccessingSecurityScopedResource, trying without

connectWithConsoleFile(url:pathString:) aSPICE may need to be granted Full Disk Access in settings

moveUrlToDestinationIfPossible(_:_:): Trying to copy vnc://192.168.168.44:5907 to /Users/ted/Library/Containers/com.iiordanov.bVNC/Data/Documents/console.vv

deletePathIfNeeded(_:): Removing /Users/ted/Library/Containers/com.iiordanov.bVNC/Data/Documents/console.vv if there

deletePathIfNeeded(_:): Removed /Users/ted/Library/Containers/com.iiordanov.bVNC/Data/Documents/console.vv

moveUrlToDestinationIfPossible(_:_:): Cannot copy item at vnc://192.168.168.44:5907 to /Users/ted/Library/Containers/com.iiordanov.bVNC/Data/Documents/console.vv: Error Domain=NSCocoaErrorDomain Code=260 "The file “Data” couldn’t be opened because there is no such file." UserInfo={NSFilePath=, NSURL=. -- file:///Users/ted/Library/Containers/com.iiordanov.bVNC/Data/, NSUnderlyingError=0x6000019461c0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

moveVvFileToPrivateStorageAndConnect(_:_:) Could not move console.vv trying to use it as is.

getFileContents(path:): url file://

connectIfConsoleFileFound(_:): File at  does not start with [virt-viewer], ignoring.

moveVvFileToPrivateStorageAndConnect(_:_:) Could not connectIfConsoleFileFound in place

windowScene(_:didUpdate:interfaceOrientation:traitCollection:) called.

Ted Serreyn

unread,
Dec 16, 2024, 3:14:32 AM12/16/24
to i iordanov, bvnc-ardp-aspice-opaque...@googlegroups.com
yeah that’s what I was afraid of.

I’m going to see if I can use the built in URL mapping rather than the defined applications, but I’m not sure that is going to be feasible.

Even simple passing the host and port would be enough to get this to work from a basic step.   I’ll try to dig into the code a bit to see what it would take.


Ted Serreyn
Serreyn Network Services, LLC

On Dec 12, 2024, at 8:41 PM, i iordanov <iior...@gmail.com> wrote:



Ted Serreyn

unread,
Dec 16, 2024, 3:14:39 AM12/16/24
to i iordanov, bvnc-ardp-aspice-opaque...@googlegroups.com

From: i iordanov <iior...@gmail.com>
Date: Friday, December 13, 2024 at 7:23

AM

Reply all
Reply to author
Forward
0 new messages