I ran into a few issues while trying to set up VirtualHere to run as a daemon and at boot on CentOS 8. It's a simple fix, so I thought I'd post it in case anyone runs into the same issue.
In the latest version of CentOS "networking.service" doesn't exist.
If you run the service as described on the Linux FAQ page you'll get the error message "Failed to start virtualhere.service: Unit networking.service not found.".
In CentOS 8 "networking.service" has been replaced by "NetworkManager.service". Switching these out in your systemd script will fix the error and VirtualHere will run at boot.
Your "/etc/systemd/system/virtualhere.service" file should look like below:
[Unit] Description=VirtualHere USB Sharing Requires=network.target After=network.target [Service] ExecStartPre=/bin/sh -c 'logger VirtualHere settling...;sleep 1s;logger VirtualHere settled' ExecStart=/usr/sbin/vhusbdx86_64 Type=idle [Install] WantedBy=multi-user.target
Reload your daemon with the changed file and you're good to go:
systemctl daemon-reload systemctl enable virtualhere systemctl start virtualhere
I hope this saves someone a little bit of time.
Hi all. Can I also get the corrected file for the client on CentOS 8?
Its in the post above.
But it's for Server. How can I replace it for Centos 8 Stream?
Sorry misread, here is how to run the client on CentOS and similar systemd based startups
Create the /etc/systemd/system/vhclient.service file with the following contents
[Unit] Description=VirtualHere USB Client Requires=network.target After=network.target [Service] ExecStartPre=/bin/sh -c 'logger VirtualHere settling...;sleep 1s;logger VirtualHere settled' ExecStart=/usr/sbin/vhclientx86_64 -n Type=forking [Install] WantedBy=multi-user.target
systemctl enable vhclient.service
systemctl start vhclient.service