Trying to add startup parameter to client ISSUE OSX Monterey

I'm trying to add a startup parameter to the client on OSX, the FAQ says that there is a file I can add it to at:

/Users/Username/Library/Preferences/vhui Preference

However this directory doesn't exist on OSX Monterey, I can't seen to find the file.... (in fact the directory /Users/Username/Library doesn't seem to exist)

I want to add -a for adminstrator mode...

another question, is administrator mode the only way to "use device" if it was previously being used on another client... is there no way that when the client is closed (computer is shutdown) that it automatically disconnects from using the device? Seems strange even if the client isn't running (computer is switched off) its still hogging the device and the device can't be used on another computer without kicking them off in adminstrator mode, is this correct?

Thanks!

#2

If the client machine is switched off, then the device will not be used. It will be automatically disconnected after 12 seconds and be available to grab by another client.

To start the client in administrator mode do this:

/Applications/VirtualHereUniversal.app/Contents/MacOS/VirtualHereUniversal -a

#3

The device (an ilok) is not getting disconnected when client machine is switched off. I'm using a Synology NAS and 2 clients, one on a windows machine and another mac....
When I try and 'use' the ilok on the mac I'm getting an 'Ilok Sharing Error : An ilok cannot be shared across etc etc', that error is when the windows machine is not switched on. Also running VH in administrator mode doesn't give me the option to kick off the other client (even tho that computer is switched off) to be able to use the Ilok, the only option that makes it work is to keep physically pulling the ilok out of the NAS and reinserting it.

#5

ah ok, so if I get one of the hubs listed I won't have this problem? thx

#6

Correct

#7

It’s literally impossible to source any of those hubs (most of them years old) listed, I’ve purchased and returned 5 usb hubs. Are there any other options to make an Ilok work with your software over a network?
Atm it feels like wasted $50 spent for Virtual Here which specifically said it works for Iloks but it doesn’t, at least not without physically pulling the Ilok out every time, may as well pull it out and take it with me. I feel your documentation should be clearer about how it’s (not) working with iloks.

#8

Yes it driving me crazy too, i want a hub i can definitely recommend for this.

I was researching some more and today i discovered this hub https://www.uugear.com/news/new-product-mega4-usb-3-1-ppps-hub-for-rasp…

So i have ordered one. When that gets here (on 28th Feb) i will standardize on this hub and get it working with virtualhere. I will let you know when its ready...

#9

Great thanks Michael... does a normal Raspberry Pi (3b/4b) without a shield not work?

Thought I had a genius idea, so I tried cutting the live wire for USB2 on a powered hub so that I could powerdown the hub with a wifi plug... It didn't work, I guess there is more than just power going down the VCC cable with USB... darn, not so genius!

The sheild looks like the ticket...

#11

Thanks for the info... managed to order one from Germany.... hope it does the trick!

#12

I have also ordered this hub https://www.yepkit.com/products/ykush for testing because it seems like its easier to power on/off the ports..and no need for weird plugs.

The uugear has very awkward plug as you need a usb 3 to 3 extender cable which are rare to find.

#13

@bassmagnetic: I've been using this hub for over 1 year and it works excellent with VirtualHere. It solved the power issues I've been having and I've written a script that power-cycles the USB ports via VirtualHere commands. It's working like a charm and I haven't had any issues since.

@Michael: That HUB looks promising, will you add support for it into VirtualHere later on?

#14

Yes probably, if it works well and is easy to use

#15

@michael thanks for the info… ah ok maybe it’s not going to be plug and play…. What scripts did you need to write, is it possible to share?

#17

Got the hub @MarkoD... VH still has the ilok sharing problem, any help to make the hub work, if that is through scripting, greatly appreciated!

#18

Here is the Windows command line script I've written that restart the port:


@echo off
set port=21
if not "%2"=="" set "port=%2"
pushd "%PROGRAMFILES%\VirtualHere"
echo Disconnecting USB...
vhui64.exe -t "STOP USING,%1.%port%"
timeout /t 1 /nobreak > NUL
echo Power-cycling USB port...
vhui64.exe -t "CUSTOM EVENT,%1.%port%,power_cycle_port"
timeout /t 13 /nobreak > NUL
echo Reconnecting USB...
vhui64.exe -t "AUTO USE DEVICE,%1.%port%"
popd

You can save the script in a .cmd (or .bat) file and run it like this:

script.cmd

You can see the server name and port number in the VirtualHere client GUI.

#19

I can't edit my previous post, so here is a follow-up:

The script presumes that vhui64.exe is located in C:\Program Files\VirtualHere.
Here's the correct way to run the script:

script.cmd server_name port_number

The first parameter is required, the second one is optional and defaults to "21".

You can write your own script, these are the commands that you should use:

vhui64.exe -t "STOP USING,server_name.port_number" (notice the dot between the server and port)
vhui64.exe -t "CUSTOM EVENT,server_name.port_number,power_cycle_port"
vhui64.exe -t "AUTO USE DEVICE,server_name.port_number"

More info on the client API here: https://www.virtualhere.com/client_api

#20

PS: The script is not fully automated, because after every command sent to VirtualHere, you have to close a small window showing the result of that action.

#21

@MarkoD, just wanted to say thank you so much for this, I'm out of the studio atm but gonna try it when I'm back, thanks for sharing!

#22

tried it out, but when the script runs its says "Disconnecting USB" FAILED... "Power Cycling Port" OK, then when it tries to Use Device I get the Ilok sharing error.... any ideas?

#23

I guess the first command isn't needed for you, so the FAILED message can be ignored. Do you wait a couple of seconds after power-cycling the port? I have a 13 second pause in the script before I try to use the device again.

#24

PS: Double-check whether you are power-cycling the correct port. If the iLok has a LED light or something similar, make sure it goes dark for a second.

#25

PS2: Michael wrote in the topic he linked that a script isn't needed and VirtualHere should restart the port automatically. So perhaps Michael can chime in and give you more instructions.

#26

Actually the port is automatically powercycled by the virtualhere (linux) server if it knows an iLok has just been used. It will power off then wait 5 seconds then power back on so there is no scripts required.

I received both those hubs above i mentioned above, but they arent suitable for different reasons.

So ive ordered the cypress CY4608 hub and Ill see how that goes...

#28

My guess is its probably a new hardware 'revision' of the hub, where the manufacturer takes out "unnecessary" features from the original. You can see on the uhubctl site the different revisions. Im going to try the cypress early next week (that has been manufactured since 2011 so i think it will be stable, but i need to test it first)

#29

@Michael: The AmazonBasics hub on the uhubctl page does not state any specific revisions, so all versions should work?

@bassmagnetic: Can you try plugging some other USB device into the same USB port (insteda of the iLok) and see it that device get its power cut (i.e. by turning a LED off) when running the script? That way you can make sure that the power_cycle command works as expected.

#30

Well in theory yes but someone needs to discover that and report it , maybe they just havent reported it yet.

I think USB 3 power switching hubs are a bad idea and too unreliable. This is why im trying to standardize on a usb 2 hub on. Im really hoping the cypress works...

#31

I received the CY4608 HX2VL development kit and it does work, but only one port 1. The other 3 ports dont support PPPS (even though they say they do)

You can get that hub (it is cheap US49 and free shipping) but only port 1 will power-cycle correctly. Here is my feedback https://github.com/mvp/uhubctl/issues/404

#32

@Michael... I got the hub but it isn't power cycling... I assume Port 1 is J7? It isn't marked... Should it work out of the box?

#33

Yes it most definately powercycles on port 1. Port 1 is the one closest to the upstream connector. Plug the ilok in there. Plug the hub into your synology. Then use the ilok via virtualhere. Stop using it, the ilok light will poweroff for about 3 seconds and then power on. Then try using the ilok on another client machine.

#34

Ah ha it was in the wrong port... indeed it works!!! thanks Michael and Marko!

#35

weird tho... the ilok light does switch off for a couple of seconds, but when I run VH on the mac I still get ilok sharing error.... wondering if it's not switching the port off to long enough?

#36

ok I'm away on holidays until the 21st and will modify the period after that

#37

i've done a little testing as it was just a complete guess about needing to switch off for longer...
when I disconnect the device with VH it switches the blue light off the ilok for about 2 seconds which then comes back on solid blue
if I pull the ilok out of the port and quickly plug it straight back in, so probably about 2 seconds too, the ilok, when plugged back in flashes on and off the blue light a few times for a second before becoming solid blue light, the same as when u initially plug in the dongle....
so it seems maybe the power switching isn't doing the same as removing the dongle? I have no idea how usb works so all this is guesswork for me!

#38

I was doing more investigation today and the server will power off the ilok wait 5 seconds then power on the ilok.

So the light should go off for 5 seconds. I tested again like this

1. Install ilok manager and virtualhere client on my win11 pc
2. Plug my 2nd gen ilok into the cypress usb hub port 1 connected to my ds120j synology nas
3. Plug my 3rd gen ilok into the cypress usb hub port 4
4. Install the ilok manager on my mac mini m1 and the virtualhere client
5. Use the 2nd gen ilok on the windows pc via virtualhere, rename the 2nd gen ilok, click synchronize
6. Stop using the ilok, the ilok(s) disappear from the list then come back 5 seconds later (For some reason the ilok on port 4 disappears as well but comes back)
7. Use the 2nd gen ilok on my mac mini. Click sync and rename using iLok manager
8. There are no sharing issues
9. Repeat steps 5-7 with the 3rd gen ilok instead which is on port 4 (which doesnt power cycle properly) and i get the sharing error.

So im pretty sure it works ok.

#39

ah ok... i've got a 3rd gen ilok... so i guess thats the issue, will only the 2nd gen ones work?

#40

I tried with the 3rd Gen iLok (the metal one) as well, and that works fine.

When i stop using , there is a delay of 5 seconds while the iLok drops off and comes back and it can be used on another client with no sharing error.

This is with the iLok plugged into port 1 which is the closest to the upstream port on the cypress hub.

#41

Is the rename and sync important thru Ilok manager? That’s the only thing in your process that I haven’t tried… Do you have to do this each time u use the Ilok?
I will try and see if it makes any difference

#42

I rename and sync to make sure the ilok is used and communicated with during my testing.

#43

In VH when I stop using the device the ilok doesn't ever disappear, all that changes is just (in use by you) disappears... so you no.6 doesn't happen in my case
........
6. Stop using the ilok, the ilok(s) disappear from the list then come back 5 seconds later

#44

Sorry for 6. i should clarify

When i click stop using: actually i can still see the ilok connected but its light goes out on the hub for 5 seconds, then it comes back on

#45

I've timed the off time and its 3 seconds on my system... I don't know if it needs more time to properly power cycle.... is there a way to extend the off time so at least we can discount that before anything else... very strange it power cycles on your system to not get the ilok sharing issue but not on mine, as we both using synology nas....

#46

i can send you a video so you can see what is going on if you like, the power only seems to switch off for 2 to 3 seconds and the blue light doesn't flash a few times like it does when plugged in for the first time so its not properly power cycling

#47

Sure, send it to mail [at] virtualhere.com (mail[at]virtualhere[dot]com), also can you reboot your NAS and see if that is enough to power-cycle?

#48

I'm also seeing this (non-blinking) behaviour with iLok on my Pi..  It's definitely powering off the port for 5secs (I think) and then becoming available again, but if I try to mount it on another computer I always get the  iLok Sharing Error.  My only option is to VNC into my Pi and re-boot it.  Not ideal.

Has anyone figured out how to get this working as it should with the iLok??

#49

I found that my pi4 doesnt really turn off any usb port power completely anymore, even though uhubctl says it works ok on the pi4 https://github.com/mvp/uhubctl#raspberry-pi-4b

I tried those commands in uhubctl and the port goes off but i tested with a power meter and it stays on. So i dont recommend the pi4

I am completely certain that the gl-mt300nv2 and the gl-ar300m16 work with power-cycling correctly because i have tested both with a power-meter and an ilok and can confirm they really do power off their usb port ( https://www.virtualhere.com/hardware ) and ive checked with gl-inet and they have confirmed that the usb power really does completely get cut. You cant use uhubctl on the gl devices but you can use an ilok, and virtualhere will power-cycle it. Virtualhere will automatically cycle the ilok power if it detects an ilok plugged into the gl-inet device usb port after you stop using the ilok via virtualhere.