Automate installation, launch and registration of servers on MAC

Hi,

We are using VirtualHereServer to redirect USB redirection within a VM for development purpose. We've built a script to automate deployment on developers machines (Mac Intel & Apple Silicon).

I install VirtualHereServerUniversal.app that way:

    wget https://www.virtualhere.com/sites/default/files/usbserver/VirtualHereSe…
    hdiutil attach ./VirtualHereServerUniversal.dmg
    sudo cp -R /Volumes/VirtualHere\ USB\ Server\ \(Universal\)/VirtualHereServerUniversal.app /Applications
    sudo hdiutil unmount /Volumes/VirtualHere\ USB\ Server\ \(Universal\)/

Q1: I am not able to launch the daemon without launching the GUI. I got an error when I launch the command (pop-up + vhusbd_log).
    sudo /Applications/VirtualHereServerUniversal.app/Contents/MacOS/vhusbdosx -b 
I believe this is due because I am using sudo and vhusbdosx cannot find the config.ini at the right place (also, I cannot launch vhusbdosx without sudo). Any suggestion?

Q2: How can I automate licence registration? I've an URL. Is there any request I can send?

Thanks,

#2

Q1. Running those commands in the terminal works correctly for me:

michael@Michaels-Mac-mini ~ % sudo /Applications/VirtualHereServerUniversal.app/Contents/MacOS/vhusbdosx -b
Installing com.virtualhere.vhusbd launchd script...
Successfully installed the com.virtualhere.vhusbd launchd daemon
Starting the com.virtualhere.vhusbd launchd daemon...
com.virtualhere.vhusbd service successfully started
Log file can be found at /var/log/vhusbd.log
michael@Michaels-Mac-mini ~ % cat /var/log/vhusbd.log 
Tue Nov 15 20:50:46 2022 LOG_INFO    >>> Starting VirtualHere USB Server v4.4.6 (Built: Nov 14 2022, 11:51:21)<<<
Tue Nov 15 20:50:46 2022 LOG_INFO    Using configuration /Library/vhusbd.ini
Tue Nov 15 20:50:46 2022 LOG_INFO    Server licensed to=C07F1GK4Q6NV max_devices=unlimited
Tue Nov 15 20:50:46 2022 LOG_INFO    Listening on all network interfaces at TCP port 7575 (IPv6 dual-stack)
Tue Nov 15 20:50:46 2022 LOG_INFO    Found Super speed device [0781:5583] "SanDisk, Ultra Fit" at address 38797312
Tue Nov 15 20:50:46 2022 LOG_INFO    Found Full speed device [10c4:ea60] "Silicon Labs, CP2102 USB to UART Bridge Controller" at address 35651584
Tue Nov 15 20:50:54 2022 LOG_INFO    192.168.1.160 connected as connection 1 (Standard TCP)
Tue Nov 15 20:51:01 2022 LOG_INFO    192.168.1.236 connected as connection 2 (Standard TCP)
michael@Michaels-Mac-mini ~ % 

It writes to stdout, perhaps you need to redirect that somewhere in your script. What error does it say?

Q2. Licensing is done from the client. You can start any client and then you can use the client api to do LIST LICENSES

#3

Thanks for the reply,

Regarding 1)

When lauching:

$ sudo /Applications/VirtualHereServerUniversal.app/Contents/MacOS/vhusbdosx -b

I got the following:

Installing com.virtualhere.vhusbd launchd script...
Successfully installed the com.virtualhere.vhusbd launchd daemon
xattr: [Errno 1] Operation not permitted: '/Applications/VirtualHereServerUniversal.app/Contents/_CodeSignature/CodeResources'
xattr: [Errno 1] Operation not permitted: '/Applications/VirtualHereServerUniversal.app/Contents/_CodeSignature'
xattr: [Errno 1] Operation not permitted: '/Applications/VirtualHereServerUniversal.app/Contents/MacOS/vhusbdosx'
xattr: [Errno 1] Operation not permitted: '/Applications/VirtualHereServerUniversal.app/Contents/MacOS'
xattr: [Errno 1] Operation not permitted: '/Applications/VirtualHereServerUniversal.app/Contents/Resources/usb.icns'
xattr: [Errno 1] Operation not permitted: '/Applications/VirtualHereServerUniversal.app/Contents/Resources'
xattr: [Errno 1] Operation not permitted: '/Applications/VirtualHereServerUniversal.app/Contents/Info.plist'
xattr: [Errno 1] Operation not permitted: '/Applications/VirtualHereServerUniversal.app/Contents'
xattr: [Errno 1] Operation not permitted: '/Applications/VirtualHereServerUniversal.app'
Starting the com.virtualhere.vhusbd launchd daemon...
com.virtualhere.vhusbd service successfully started
Log file can be found at /var/log/vhusbd.log

 

Thanks

 

 

#4

OK well you dont have permission do to that. I think you should ask your admins if you have permission to create launch daemons.