How can the software auto start up with my config?

Hi Support,

I have recently installed these tools and found it is great.
I understand that if I manually run my program with my config file I have to run like this vhusbdarm -c
But how to set it with my config file when the computer is booting??
I have tried to change the /etc/systemd/system/virtualhere.service like below
******************************
[Unit]
Description=VirtualHere USB Sharing
Requires=networking.service
After=networking.service
[Service]
ExecStartPre=/bin/sh -c 'logger VirtualHere settling...;sleep 1s;logger VirtualHere settled'
ExecStart=/usr/sbin/vhusbdarm -c /usr/sbin/config.ini
Type=idle
[Install]
WantedBy=multi-user.target
******************************
And then re-systemctl it, but it doesnt work. Can you suggest the way to do so?
My machine is Raspberry Pi4, thank you.

#2

Hi, it looks ok actually. Reboot your pi then type this

systemctl status virtualhere

then paste the output here

#3

Hi Michael
Here is it:
pi@raspberrypi:~ $ systemctl status virtualhere
● virtualhere.service - VirtualHere USB Sharing
Loaded: loaded (/etc/systemd/system/virtualhere.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2019-10-29 00:34:43 HKT; 8h ago
Process: 320 ExecStartPre=/bin/sh -c logger VirtualHere settling...;sleep 1s;logger VirtualHere settled (code=exited,
Main PID: 544 (vhusbdarm)
Tasks: 11 (limit: 4035)
Memory: 2.8M
CGroup: /system.slice/virtualhere.service
└─544 /usr/sbin/vhusbdarm -c /usr/sbin/config.ini

10月 29 00:34:43 raspberrypi systemd[1]: Started VirtualHere USB Sharing.
10月 29 00:34:49 raspberrypi root[543]: VirtualHere settled
10月 29 00:34:50 raspberrypi vhusbdarm[544]: >>> Starting VirtualHere USB Server v4.0.5 (Built: Oct 18 2019, 17:41:59)<<
10月 29 00:34:50 raspberrypi vhusbdarm[544]: Using configuration /usr/sbin/config.ini
10月 29 00:34:50 raspberrypi vhusbdarm[544]: Server licensed to=unlicensed max_devices=1
10月 29 00:34:50 raspberrypi vhusbdarm[544]: Using large URB's
10月 29 00:34:50 raspberrypi vhusbdarm[544]: Listening on all network interfaces at TCP port 7575
10月 29 00:34:50 raspberrypi vhusbdarm[544]: VirtualHere USB Server is running...press CTRL-C to stop

#4

Now type

ps -ef | grep vh

and send the output. It seems like the server is running ok

#5

pi@raspberrypi:~ $ ps -ef | grep vh
root 583 1 0 00:31 ? 00:00:00 /usr/sbin/vhusbdarm -c /usr/sbin/config.ini
pi 748 736 0 00:35 pts/0 00:00:00 grep --color=auto vh

#6

The content inside /usr/sbin/config.ini
*******************
It=15722*******
EasyFindId=**8G7g2UN********
EasyFindPin=*Xx****
(above Star information for protecting myself)
#Custom
ServerName = Sync-Pro123
*******************

#7

It shows it running, why do you think it is not running? Is it not finding the server on the client?

#8

I can check that it is running.
But the server name is still the same, but I have already change it into "ServerName = Sync-Pro123".
Seems it did not load with the config file.

#9

OK so that has nothing to do with what you been asking. In the client, right click on the Server and select Properties->rename