[GUIDE] How to Use a Raspberry Pi as a wireless USB Camera Bridge to LightBurn

Hi everyone,

I’d like to share a method I successfully tested to connect wirelessly a USB camera to LightBurn through a Raspberry Pi 3B+, as if it were plugged directly into the PC. This allows LightBurn to recognize the camera and use it for positioning, monitoring, and more.


:wrench: Why do this?

If your laser machine is far from your computer, or you want to avoid long, messy USB cables, this setup allows you to plug the camera into a Raspberry Pi inside the laser enclosure, and access it from your PC wirelessly or over Ethernet.


:toolbox: What you’ll need

  • A Raspberry Pi 3B+ (or newer).
  • A USB camera (LightBurn’s official one or any wide-angle USB camera like the common laptop-style ones on AliExpress).
  • A local network (Wi-Fi or Ethernet) shared between the Raspberry Pi and your PC.
  • VirtualHere USB Server installed on the Raspberry Pi.
  • VirtualHere USB Client installed on the PC.

:rocket: Setup Instructions

1. Install VirtualHere USB Server on the Raspberry Pi

Open a terminal on your Raspberry Pi and run:

wget https://www.virtualhere.com/sites/default/files/usbserver/vhusbdarm
chmod +x vhusbdarm

This will download the server and make it executable. It will be placed in the current directory — usually your home folder (e.g., /home/pi or /home/admin).

:magnifying_glass_tilted_left: How to check the exact path of the file
Once installed run this command to find it:

realpath ./vhusbdarm

:magnifying_glass_tilted_left: How to know the actual username:
Open the terminal on your Raspberry Pi and type:

whoami

This will return the installation path and the username of the currently logged-in user. Take note of this path and name — you’ll need them in next steps if you want to auto-start this program in the Raspberry Pi.


2. Install VirtualHere USB Client on your Windows PC

Download it from:
:link: VirtualHere USB Client | VirtualHere

Launch it, and it will automatically detect the Raspberry Pi on your network.
Double click the camera or Right-click it in the list and select “Use this device”. You’ll hear the classic windows sound when plugging USB devices. ( Note: A USB camera typically can only be used by one program at a time. If it’s already in use by another application, it won’t be available in LightBurn or any other software, until it’s released or the program restarted).


3. Set up LightBurn

Open LightBurn → Windows → Camera control, and select the camera you connected through VirtualHere.
Now you can calibrate it and use all the camera features as if it were physically connected to your computer.


:light_bulb: Benefits

  • Avoids long USB cables by placing the camera directly inside the laser machine.
  • Great for network-based workspaces.
  • Works with almost any compatible USB camera.

:warning: :warning: :warning: Safety Reminder

While this setup is great for positioning and monitoring, camera supervision is not a substitute for active operator presence.
Laser machines can catch fire if left unattended. Always ensure someone is monitoring the process.


:clipboard: ANNEXES


:paperclip: ANNEX 1: Make a Windows Application Start on Boot

  1. Press Win + R, type shell:startup, and press Enter.
  2. This opens your user’s Startup folder.
  3. Paste a shortcut to the program you want to run at startup (such as VirtualHere Client).

That’s it! The application will launch automatically every time you start your computer.


:paperclip: ANNEX 2: Make the Raspberry Pi Start VirtualHere Server Automatically

  1. Open a terminal and create a service file:
sudo nano /etc/systemd/system/virtualhere.service
  1. Paste the following ( :warning: adjust the paths and user name where needed - Please, read Setup #1 :magnifying_glass_tilted_left:):
[Unit]
Description=VirtualHere USB Server
After=network.target

[Service]
ExecStart=/home/admin/vhusbdarm 
WorkingDirectory=/home/admin
Restart=always
User=admin

[Install]
WantedBy=multi-user.target
  1. Save (Ctrl + O, Enter, then Ctrl + X).
  2. Enable the service:
sudo systemctl enable virtualhere.service
  1. (Optional) Start it right away:
sudo systemctl start virtualhere.service

:memo: Notes

  • Depending on your Wi-Fi coverage, network congestion, computer performance, and camera quality, the video feed may not always be smooth.
    However, the image is usually more than good enough for basic positioning tasks and monitoring inside LightBurn.

:folded_hands: Special Thanks

Thanks to the LightBurn support team for their fast and helpful responses, and to the community for always sharing such great ideas.
I hope this guide helps others with similar needs.
:wink:
Cheers,
Alex

6 Likes

@Atlanta I have a pi+3 on my laser and am using it with lightburn bridge to send jobs wirelessly. I have a camera installed and set up on the laser. I am a total newb on raspberry pi so I have no clue how to open a terminal window on my raspberry pi that is connected via wifi to my windows laptop? I know the ip address of the pi and can ping it successfully via the terminal on the laptop but that’s about it. Can you explain further how to open the terminal window in pi, please.
TIA

UPDATE

So, using Putty I was able to access the pi.

--2025-04-19 20:40:59--  https://www.virtualhere.com/sites/default/files/usbserver/vhusbdarm
Resolving www.virtualhere.com (www.virtualhere.com)... 143.198.145.150, 2604:a880:4:1d0::63d:5000
Connecting to www.virtualhere.com (www.virtualhere.com)|143.198.145.150|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 388044 (379K) [application/octet-stream]
Saving to: ‘vhusbdarm.2’

vhusbdarm.2         100%[===================>] 378.95K   826KB/s    in 0.5s

2025-04-19 20:41:00 (826 KB/s) - ‘vhusbdarm.2’ saved [388044/388044]

pi@lightburnbridge:~ $ chmod +x vhusbdarm
pi@lightburnbridge:~ $ wget https://www.virtualhere.com/sites/default/files/usbs
--2025-04-19 20:42:20--  https://www.virtualhere.com/sites/default/files/usbserv
Resolving www.virtualhere.com (www.virtualhere.com)... 143.198.145.150, 2604:a88
Connecting to www.virtualhere.com (www.virtualhere.com)|143.198.145.150|:443...
HTTP request sent, awaiting response... 200 OK
Length: 388044 (379K) [application/octet-stream]
Saving to: ‘vhusbdarm.3’

vhusbdarm.3                             100%[===================================

2025-04-19 20:42:21 (947 KB/s) - ‘vhusbdarm.3’ saved [388044/388044]

pi@lightburnbridge:~ $ chmod +x vhusbdarm
pi@lightburnbridge:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

However, it fails to connect to virtual here. It updates with “connecting to USB server” but that message is brief and then nothing until I see the same message over and over. I have deleted Virtual Here and downloaded it a second time and rebooted the PC to no avail. I am on the same wifi network as the pi and am sitting a few feet away from it. No other programs are open or currently accessing the camera.

Hi Brian!

The LightBurn Bridge Raspberry Pi image is like a custom, single-purpose system created or adapted by the LightBurn team. It’s designed specifically to send jobs to your laser over the network, and I think it doesn’t allow you to run other applications or open a normal terminal window like a normal Raspberry Pi OS would. (Well, in fact it opens a terminal window where you see only some specific running status info, and even you could enter commands but I do not recommend installing anything else because there are most likely back-end configurations that could affect) Think of it as a dedicated appliance, only.

However, in your case, if you’d like to also connect a USB camera to LightBurn wirelessly, there are two main ways to do it, depending on how you want to set up your system:


:white_check_mark: Option 1: Use two Raspberry Pi boards

  • Keep your existing Pi running LightBurn Bridge as-is, dedicated to communicating with your laser.
  • Use a second Raspberry Pi running regular Raspberry Pi OS (you can use Pi Imager software to install it) and install VirtualHere USB Server on it, following the above instructions.
  • Connect your USB camera to the second Pi.
  • On your Windows PC, install the VirtualHere USB Client, which will make the camera appear as if it were plugged directly into your computer. LightBurn will be able to use it just like a local USB camera.

:white_check_mark: Option 2: Use one Raspberry Pi and a Wi-Fi access point

  • Flash a standard Raspberry Pi OS on your Pi using Pi Imager software (you could even do this in a new SDcard just in case you would like to go back or to finnally discard this project).
  • Set up VirtualHere USB Server on it.
  • Connect your USB camera to the Pi.
  • Instead of using LightBurn Bridge, connect your laser to the network via a Wi-Fi access point (Typical TP-Link router/access point or some other manufacturer) connected to the controller and both configured to run on you wifi network).
  • Your computer and the Pi should be connected to the same Wi-Fi network.
  • LightBurn will connect to the laser via IP, and the camera via the Raspberry Pi using VirtualHere USB bridge.

:memo: Note:

  • In both cases, make sure that your computer, laser, and Raspberry Pi are on the same local network.
  • The camera feed may not be perfectly smooth — this depends on Wi-Fi signal quality, camera resolution, your computer’s performance, and other network conditions — but it’s typically good enough for LightBurn’s positioning and monitoring features.

Let me know which route you prefer and I’ll gladly help you set it up!

Good Luck! :wink:

Hello @Atlanta

Thanks for the detailed reply. I obviously was confused and mistakenly thought I could run the bridge and vusb on the same pi. So, now that I have a better understanding, I think option 1 works fine.

I have a new pi showing up tomorrow and will proceed as you have described above.

Thanks for your time and I’ll post my results

1 Like

@Atlanta

I am sending this reply from the new pi. I am still not having any luck. PC and new pi are both obviously on the same wifi network and Virtual Here Client is not able to locate the server installed on the pi.

pi1@raspberrypi:~ $ wget https://www.virtualhere.com/sites/default/files/usbserver/vhusbdarm
chmod +x vhusbdarm
--2025-04-21 15:48:46--  https://www.virtualhere.com/sites/default/files/usbserver/vhusbdarm
Resolving www.virtualhere.com (www.virtualhere.com)... 143.198.145.150, 2604:a880:4:1d0::63d:5000
Connecting to www.virtualhere.com (www.virtualhere.com)|143.198.145.150|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 388044 (379K) [application/octet-stream]
Saving to: ‘vhusbdarm.1’

vhusbdarm.1         100%[===================>] 378.95K  1006KB/s    in 0.4s    

2025-04-21 15:48:47 (1006 KB/s) - ‘vhusbdarm.1’ saved [388044/388044]

pi1@raspberrypi:~ $ realpath ./vhusbdarm
/home/pi1/vhusbdarm
pi1@raspberrypi:~ $ whoami
pi1
pi1@raspberrypi:~ $ realpath ./vhusbdarm
/home/pi1/vhusbdarm
pi1@raspberrypi:~ $ 

Here is the log from the VirtualHere Client on the PC

2025-04-21 17:17:25 INFO  :Error 'No such host is known. ' getaddrinfo failed for /home/pi1/vhusbdarm:7575

I must be missing something but I have the same error as I had when attempting to run it on the bridge pi as well.

TIA

So I went back and burned a new image to the micro SD card and went through all the steps again, same result. I even went through the regedit on my laptop to make sure there are no other instances of VirtualHere USB anywhere.

chmod +x vhusbdarm
--2025-04-21 17:50:14--  https://www.virtualhere.com/sites/default/files/usbserver/vhusbdarm
Resolving www.virtualhere.com (www.virtualhere.com)... 143.198.145.150, 2604:a880:4:1d0::63d:5000
Connecting to www.virtualhere.com (www.virtualhere.com)|143.198.145.150|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 388044 (379K) [application/octet-stream]
Saving to: ‘vhusbdarm’

vhusbdarm           100%[===================>] 378.95K   920KB/s    in 0.4s    

2025-04-21 17:50:15 (920 KB/s) - ‘vhusbdarm’ saved [388044/388044]

pi1@raspberrypi:~ $ realpath .vhusbdarm
/home/pi1/.vhusbdarm
pi1@raspberrypi:~ $ whoami
pi1
pi1@raspberrypi:~ $ 

Here is the log from VirtualHere on the laptop

2025-04-21 17:51:06 INFO  :VirtualHere Client 5.8.6 starting (Compiled: Mar  7 2025 09:21:46)
2025-04-21 17:51:06 INFO  :Client OS is Windows 11 (build 26100), 64-bit edition
2025-04-21 17:51:06 INFO  :Using config at C:\Users\mpo88\AppData\Roaming\vhui.ini
2025-04-21 17:51:06 INFO  :IPC available at \\.\pipe\vhclient
2025-04-21 17:51:07 INFO  :Error 'No such host is known. ' getaddrinfo failed for /home/pi1/vhusbdarm:7575
2025-04-21 17:51:37 INFO  :Error 'No such host is known. ' getaddrinfo failed for /home/pi1/vhusbdarm:7575
2025-04-21 17:52:07 INFO  :Error 'No such host is known. ' getaddrinfo failed for /home/pi1/vhusbdarm:7575

Thank you

Hi! Thanks for the detailed message and logs — that really helps.

It seems to me that VirtualHere Client on your PC is trying to connect to a file path (/home/pi1/vhusbdarm) instead of a network address. The server must be running on the Raspberry Pi, and the client must discover it over the network.

Here’s how to fix it step by step:


:white_check_mark: 1. Start the VirtualHere Server on your Raspberry Pi

You’ve already downloaded vhusbdarm. Now, you need to run it:

./vhusbdarm &

That & at the end means it runs in the background.

You should see a line like:

VirtualHere USB Server for Linux - Trial Version

:light_bulb: If you want it to run automatically every time the Pi boots, I can guide you later on how to create a systemd service for it, but you already have it in the above guide.


:white_check_mark: 2. Ensure Your Pi and PC Are on the Same Network

From your PC, try this:

ping raspberrypi.local

Or use the Pi’s IP address that you already know. If ping works, then the network connection is okay.


:white_check_mark: 3. Open the VirtualHere Client on Your PC

Once the server is running on the Pi, open the VirtualHere client on your PC.

If everything’s good, it should automatically discover the Raspberry Pi server and show something like:

Devices available from [Your Pi’s IP or hostname]

If it doesn’t appear, right click on “USB Servers > Specify USB Servers > Add” and add your Pi’s IP address, for example:

192.168.1.101

:warning: DO NOT add something like /home/pi1/vhusbdarm:7575 — that’s not a valid network address.


ALSO: Check That Port 7575 Is Open on the Pi

On the Pi, after starting the server, you can check if it’s listening:

netstat -tuln | grep 7575

You should see a line like:

tcp        0      0 0.0.0.0:7575        0.0.0.0:*           LISTEN

Let me know how it goes! Once it connects, your USB camera (or any other USB device) plugged into the Pi should appear in LightBurn just like it was plugged directly into your PC. Let me know how it goes! :wink:

1 Like

Ok, great news, finally. The pi newbie on the other end of this conversation (me :sweat_smile:) finally has the camera connected.

I noticed I had to type

sudo ./vhusbdarm &

to start the server running on pi1. I also had to manually enter the network address to get connected on the PC side. I am not sure how I ever got started entering a file path :flushed_face:

Anyway, I do have VirtualHere running in my startup folder.

Closing the terminal on the pi breaks the connection and since the pi and mouse are painfully slow, I would like to proceed with ANNEX 2 I have completed step 1 and updated the path in step 2 to reflect the information for my pi

/home/pi1/vhusbdarm

The capture below is what I entered

Description=VirtualHere USB Server
After=network.target

[Service]
ExecStart=/home/pi1/vhusbdarm
WorkingDirectory=/home/pi1  
Restart=always
User=admin

[Install]
WantedBy=multi-user.target

I followed step 3

(Ctrl + O, Enter, then Ctrl + X)

and finally step 5

sudo systemctl start virtualhere.service

Here is the result

pi1@raspberrypi:~ $ sudo ./vhusbdarm &
[1] 2774
pi1@raspberrypi:~ $ VirtualHere USB Server is running...press CTRL-C to stop
sudo nano /etc/systesudo nano /etc/systemd/system/virtualhere.service
pi1@raspberrypi:~ $ sudo systemctl start virtualhere.service
pi1@raspberrypi:~ $ 

What I still don’t understand is why is the connection broken when close the terminal window on the pi?

When I type the command to run the server it restores the connection. I am getting closer! Thank you very much for all of your continued help and for providing this much needed feature!

Hi again!

You’re very close now—great job getting this far! :+1:

Let me explain a couple of things that should clear up the confusion:

Why the connection breaks when you close the terminal:

When you run the command manually like this:

sudo ./vhusbdarm &

you’re starting the VirtualHere server in the background inside that specific terminal session. As soon as you close the terminal window, the background process ends too—that’s expected behavior in Linux when not using a proper service manager.

That’s why you see it working after running that command, but it disconnects as soon as you close the window.

You’re almost done with the systemd service setup!

Looking at what you shared, everything seems correct except one small detail in the service file:

User=admin

This should be:

User=pi1

Because your current Raspberry Pi user is pi1 (as shown by whoami in your post).

Edit the service file again:

sudo nano /etc/systemd/system/virtualhere.service

And replace this line:

User=admin

with:

User=pi1

Then save and reload the service:

sudo systemctl daemon-reload [There was en error here, edited and fixed]
sudo systemctl enable virtualhere.service
sudo systemctl restart virtualhere.service

After this, the server will start automatically at every boot, no need to run anything manually or keep the terminal open.

Let me know how it goes.

Alright, entered

sudo nano /etc/systemd/system/virtualhere.service

After using ctrl+/ and editing the appropriate user to pi1, here are the results. I used ctrl + o, enter, ctrl + X to save it.

[Unit]
Description=VirtualHere USB Server
After=network.target

[Service]
ExecStart=/home/pi1/vhusbdarm
WorkingDirectory=/home/pi1
Restart=always
User=pi1

[Install]
WantedBy=multi-user.target

Next I entered

sudo systemctl reload
sudo systemctl enable virtualhere.service
sudo systemctl restart virtualhere.service

I’ve missed something

pi1@raspberrypi:~ $ sudo nano /etc/systemd/system/virtualhere.service
pi1@raspberrypi:~ $ sudo systemctl reload
sudo systemctl enable virtualhere.service
sudo systemctl restart virtualhere.service
Too few arguments.
pi1@raspberrypi:~ $

Sorry, try this:

sudo systemctl daemon-reexec
sudo systemctl daemon-reload
sudo systemctl enable virtualhere.service
sudo systemctl restart virtualhere.service

daemon-reexec is optional but safe—it just makes sure everything is clean.

After this, the server should start automatically at every boot.

The error message “Too few arguments” means that one of the commands you ran is incomplete or malformed (My fault sorry! :grimacing:). Specifically, the error occurs in this line:

sudo systemctl reload

The systemctl reload command needs a service name to specify what service you want to reload. In this case, you should use:

sudo systemctl daemon-reload

The correct command to reload systemd service configurations is sudo systemctl daemon-reload, as this will reload the configuration files and ensure that any changes made to the service files are applied correctly.

So, to fix the commands, you should do the following:

  1. Reload the service configurations:
sudo systemctl daemon-reload
  1. Enable the service to start automatically at boot:
sudo systemctl enable virtualhere.service
  1. Start the service:
sudo systemctl start virtualhere.service

With these commands, the service should be successfully started without the error. If you need more help, feel free to ask.

Well, unfortunately no joy with that either.

I entered this first

sudo systemctl daemon-reexec
sudo systemctl daemon-reload
sudo systemctl enable virtualhere.service
sudo systemctl restart virtualhere.service

Followed by


    Reload the service configurations:

sudo systemctl daemon-reload

    Enable the service to start automatically at boot:

sudo systemctl enable virtualhere.service

    Start the service:

sudo systemctl start virtualhere.service

Terminal

pi1@raspberrypi:~ $ sudo systemctl daemon-reexec
sudo systemctl daemon-reload
sudo systemctl enable virtualhere.service
sudo systemctl restart virtualhere.service
pi1@raspberrypi:~ $ sudo systemctl daemon-reload
pi1@raspberrypi:~ $ sudo systemctl enable virtualhere.service
pi1@raspberrypi:~ $      

sudo systemctl start virtualhere.service
pi1@raspberrypi:~ $ sudo systemctl start virtualhere.service
pi1@raspberrypi:~ $ 

Thank you

EDIT
I only entered the commands, not the instructions just to be clear :sweat_smile:

Hi! Let’s try to confirm whether the VirtualHere server is actually running as a background service. Please enter this command in the terminal:

sudo systemctl status virtualhere.service

This will show whether the service is running, if it failed, or if it’s inactive. Look for lines that include Active: active (running) or any error messages.

If it says the service is inactive or failed, we can get more information by checking the logs:

journalctl -u virtualhere.service

This command will display the output or any errors that occurred when trying to start the service.

Let me know what you see there, and we’ll figure it out step by step.

Ok, so for accuracy, everything was powered down before I started the latest procedure except my laptop.

After issuing the command to check status of the server I received the following results.

pi1@raspberrypi:~ $ sudo systemctl status virtualhere.service
× virtualhere.service - VirtualHere USB Server
     Loaded: loaded (/etc/systemd/system/virtualhere.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Tue 2025-04-22 12:03:47 CDT; 3h 30min ago
   Duration: 94ms
    Process: 645 ExecStart=/home/pi1/vhusbdarm (code=exited, status=2)
   Main PID: 645 (code=exited, status=2)
        CPU: 92ms

Apr 22 12:03:47 raspberrypi vhusbdarm[645]: Permission denied, did you run with sudo?
Apr 22 12:03:47 raspberrypi systemd[1]: virtualhere.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Apr 22 12:03:47 raspberrypi vhusbdarm[645]: Using configuration /home/pi1/config.ini
Apr 22 12:03:47 raspberrypi systemd[1]: virtualhere.service: Failed with result 'exit-code'.
Apr 22 12:03:47 raspberrypi vhusbdarm[645]: >>> Shutdown <<<
Apr 22 12:03:47 raspberrypi systemd[1]: virtualhere.service: Scheduled restart job, restart counter is at 5.
Apr 22 12:03:47 raspberrypi systemd[1]: Stopped virtualhere.service - VirtualHere USB Server.
Apr 22 12:03:47 raspberrypi systemd[1]: virtualhere.service: Start request repeated too quickly.
Apr 22 12:03:47 raspberrypi systemd[1]: virtualhere.service: Failed with result 'exit-code'.
Apr 22 12:03:47 raspberrypi systemd[1]: Failed to start virtualhere.service - VirtualHere USB Server.
pi1@raspberrypi:~ $ 

Next I queried the logs. The results are lengthy but varies slightly from one instance to another.

Apr 22 08:42:40 raspberrypi systemd[1]: virtualhere.service: Scheduled restart job, restart counter is at 5.
Apr 22 08:42:40 raspberrypi systemd[1]: Stopped virtualhere.service - VirtualHere USB Server.
Apr 22 08:42:40 raspberrypi systemd[1]: virtualhere.service: Start request repeated too quickly.
Apr 22 08:42:40 raspberrypi systemd[1]: virtualhere.service: Failed with result 'exit-code'.
lines 1-27...skipping...
Apr 22 08:42:39 raspberrypi systemd[1]: Started virtualhere.service - VirtualHere USB Server.
Apr 22 08:42:39 raspberrypi systemd[1]: virtualhere.service: Main process exited, code=exited, status=217/USER
Apr 22 08:42:39 raspberrypi systemd[1]: virtualhere.service: Failed with result 'exit-code'.
Apr 22 08:42:39 raspberrypi systemd[1]: virtualhere.service: Scheduled restart job, restart counter is at 1.
Apr 22 08:42:39 raspberrypi systemd[1]: Stopped virtualhere.service - VirtualHere USB Server.
Apr 22 08:42:39 raspberrypi systemd[1]: Started virtualhere.service - VirtualHere USB Server.
Apr 22 08:42:39 raspberrypi systemd[1]: virtualhere.service: Main process exited, code=exited, status=217/USER
Apr 22 08:42:39 raspberrypi systemd[1]: virtualhere.service: Failed with result 'exit-code'.
Apr 22 08:42:39 raspberrypi systemd[1]: virtualhere.service: Scheduled restart job, restart counter is at 2.
Apr 22 08:42:39 raspberrypi systemd[1]: Stopped virtualhere.service - VirtualHere USB Server.
Apr 22 08:42:39 raspberrypi systemd[1]: Started virtualhere.service - VirtualHere USB Server.
Apr 22 08:42:39 raspberrypi systemd[1]: virtualhere.service: Main process exited, code=exited, status=217/USER
Apr 22 08:42:39 raspberrypi systemd[1]: virtualhere.service: Failed with result 'exit-code'.
Apr 22 08:42:39 raspberrypi systemd[1]: virtualhere.service: Scheduled restart job, restart counter is at 3.
Apr 22 08:42:39 raspberrypi systemd[1]: Stopped virtualhere.service - VirtualHere USB Server.
Apr 22 08:42:40 raspberrypi systemd[1]: Started virtualhere.service - VirtualHere USB Server.
Apr 22 08:42:40 raspberrypi systemd[1]: virtualhere.service: Main process exited, code=exited, status=217/USER
Apr 22 08:42:40 raspberrypi systemd[1]: virtualhere.service: Failed with result 'exit-code'.
Apr 22 08:42:40 raspberrypi systemd[1]: virtualhere.service: Scheduled restart job, restart counter is at 4.
Apr 22 08:42:40 raspberrypi systemd[1]: Stopped virtualhere.service - VirtualHere USB Server.
Apr 22 08:42:40 raspberrypi systemd[1]: Started virtualhere.service - VirtualHere USB Server.
Apr 22 08:42:40 raspberrypi systemd[1]: virtualhere.service: Main process exited, code=exited, status=217/USER
Apr 22 08:42:40 raspberrypi systemd[1]: virtualhere.service: Failed with result 'exit-code'.
Apr 22 08:42:40 raspberrypi systemd[1]: virtualhere.service: Scheduled restart job, restart counter is at 5.


There were slight variations between the instances but it was to lengthy to post such as

Apr 22 09:15:02 raspberrypi vhusbdarm[4376]: Permission denied, did you run with sudo?

Thank you

Here is the very end of the log where it shows

Apr 22 09:15:02 raspberrypi vhusbdarm[4376]: Permission denied, did you run with sudo?
Apr 22 09:15:02 raspberrypi vhusbdarm[4376]: >>> Shutdown <<<
Apr 22 09:15:02 raspberrypi systemd[1]: virtualhere.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
lines 1-52

This is the tail end of the same portion of the log

Apr 22 08:42:39 raspberrypi systemd[1]: Started virtualhere.service - VirtualHere USB Server.
Apr 22 08:42:39 raspberrypi systemd[1]: virtualhere.service: Main process exited, code=exited, status=217/USER
Apr 22 08:42:39 raspberrypi systemd[1]: virtualhere.service: Failed with result 'exit-code'.
Apr 22 08:42:39 raspberrypi systemd[1]: virtualhere.service: Scheduled restart job, restart counter is at 1.
Apr 22 08:42:39 raspberrypi systemd[1]: Stopped virtualhere.service - VirtualHere USB Server.
Apr 22 08:42:39 raspberrypi systemd[1]: Started virtualhere.service - VirtualHere USB Server.
Apr 22 08:42:39 raspberrypi systemd[1]: virtualhere.service: Main process exited, code=exited, status=217/USER
Apr 22 08:42:39 raspberrypi systemd[1]: virtualhere.service: Failed with result 'exit-code'.
Apr 22 08:42:39 raspberrypi systemd[1]: virtualhere.service: Scheduled restart job, restart counter is at 2.
Apr 22 08:42:39 raspberrypi systemd[1]: Stopped virtualhere.service - VirtualHere USB Server.
Apr 22 08:42:39 raspberrypi systemd[1]: Started virtualhere.service - VirtualHere USB Server.
Apr 22 08:42:39 raspberrypi systemd[1]: virtualhere.service: Main process exited, code=exited, status=217/USER
Apr 22 08:42:39 raspberrypi systemd[1]: virtualhere.service: Failed with result 'exit-code'.
Apr 22 08:42:39 raspberrypi systemd[1]: virtualhere.service: Scheduled restart job, restart counter is at 3.
Apr 22 08:42:39 raspberrypi systemd[1]: Stopped virtualhere.service - VirtualHere USB Server.
Apr 22 08:42:40 raspberrypi systemd[1]: Started virtualhere.service - VirtualHere USB Server.
Apr 22 08:42:40 raspberrypi systemd[1]: virtualhere.service: Main process exited, code=exited, status=217/USER
Apr 22 08:42:40 raspberrypi systemd[1]: virtualhere.service: Failed with result 'exit-code'.
Apr 22 08:42:40 raspberrypi systemd[1]: virtualhere.service: Scheduled restart job, restart counter is at 4.
Apr 22 08:42:40 raspberrypi systemd[1]: Stopped virtualhere.service - VirtualHere USB Server.
Apr 22 08:42:40 raspberrypi systemd[1]: Started virtualhere.service - VirtualHere USB Server.
Apr 22 08:42:40 raspberrypi systemd[1]: virtualhere.service: Main process exited, code=exited, status=217/USER
Apr 22 08:42:40 raspberrypi systemd[1]: virtualhere.service: Failed with result 'exit-code'.
Apr 22 08:42:40 raspberrypi systemd[1]: virtualhere.service: Scheduled restart job, restart counter is at 5.
Apr 22 08:42:40 raspberrypi systemd[1]: Stopped virtualhere.service - VirtualHere USB Server.
Apr 22 08:42:40 raspberrypi systemd[1]: virtualhere.service: Start request repeated too quickly.
Apr 22 08:42:40 raspberrypi systemd[1]: virtualhere.service: Failed with result 'exit-code'.
Apr 22 08:42:40 raspberrypi systemd[1]: Failed to start virtualhere.service - VirtualHere USB Server.
Apr 22 09:15:01 raspberrypi systemd[1]: Started virtualhere.service - VirtualHere USB Server.
Apr 22 09:15:01 raspberrypi vhusbdarm[4353]: >>> Starting VirtualHere USB Server v4.7.7 (Built: Mar 26 2025, 07:41:24)<<<
Apr 22 09:15:01 raspberrypi vhusbdarm[4353]: Permission denied, did you run with sudo?
Apr 22 09:15:01 raspberrypi systemd[1]: virtualhere.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Apr 22 09:15:01 raspberrypi vhusbdarm[4353]: Using configuration /home/pi1/config.ini
Apr 22 09:15:01 raspberrypi systemd[1]: virtualhere.service: Failed with result 'exit-code'.
Apr 22 09:15:01 raspberrypi vhusbdarm[4353]: >>> Shutdown <<<
Apr 22 09:15:01 raspberrypi systemd[1]: virtualhere.service: Scheduled restart job, restart counter is at 1.
Apr 22 09:15:01 raspberrypi systemd[1]: Stopped virtualhere.service - VirtualHere USB Server.
Apr 22 09:15:01 raspberrypi systemd[1]: Started virtualhere.service - VirtualHere USB Server.
Apr 22 09:15:01 raspberrypi vhusbdarm[4362]: >>> Starting VirtualHere USB Server v4.7.7 (Built: Mar 26 2025, 07:41:24)<<<
Apr 22 09:15:01 raspberrypi vhusbdarm[4362]: Permission denied, did you run with sudo?
Apr 22 09:15:01 raspberrypi systemd[1]: virtualhere.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Apr 22 09:15:01 raspberrypi vhusbdarm[4362]: Using configuration /home/pi1/config.ini
Apr 22 09:15:01 raspberrypi systemd[1]: virtualhere.service: Failed with result 'exit-code'.
Apr 22 09:15:01 raspberrypi vhusbdarm[4362]: >>> Shutdown <<<
Apr 22 09:15:02 raspberrypi systemd[1]: virtualhere.service: Scheduled restart job, restart counter is at 2.
Apr 22 09:15:02 raspberrypi systemd[1]: Stopped virtualhere.service - VirtualHere USB Server.
Apr 22 09:15:02 raspberrypi systemd[1]: Started virtualhere.service - VirtualHere USB Server.
Apr 22 09:15:02 raspberrypi vhusbdarm[4376]: >>> Starting VirtualHere USB Server v4.7.7 (Built: Mar 26 2025, 07:41:24)<<<
Apr 22 09:15:02 raspberrypi vhusbdarm[4376]: Using configuration /home/pi1/config.ini
Apr 22 09:15:02 raspberrypi vhusbdarm[4376]: Permission denied, did you run with sudo?
Apr 22 09:15:02 raspberrypi vhusbdarm[4376]: >>> Shutdown <<<
Apr 22 09:15:02 raspberrypi systemd[1]: virtualhere.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
lines 1-52

@Atlanta

This might be of interest

It looks like the vhusbdarm binary is trying to perform actions that require root privileges, but the systemd service is running it as a regular user (pi1), which causes it to fail with:

Permission denied, did you run with sudo?

To fix this, please try the following:

  1. Open the service file again:
sudo nano /etc/systemd/system/virtualhere.service
  1. Modify the line that says:
User=pi1

So the section looks like this:

[Service]
ExecStart=/home/pi1/vhusbdarm
WorkingDirectory=/home/pi1
Restart=always
User=root
  1. Save the file and reload the systemd configuration:
sudo systemctl daemon-reload
sudo systemctl restart virtualhere.service

Then check the status again:

sudo systemctl status virtualhere.service

Let me know what you get. That should allow the service to run as root and give VirtualHere the permissions it needs.

Noted and will do. I will not be able to try it until tomorrow morning sometime. My apologies and Thank you for sticking with this. I appreciate you taking your time to help me resolve this issue.

1 Like

Important clarification regarding the VirtualHere service setup on Raspberry Pi

In the previous guide, I suggested setting the User value in the virtualhere.service file to a specific user (such as pi1, admin or whoever). However, we’ve since discovered that this may lead to a “Permission denied, did you run with sudo?” error when attempting to start the VirtualHere USB Server as a service.

:wrench: Solution:
To ensure the service runs with the necessary permissions, update the virtualhere.service file so that the User is set to root, like this:

[Service]
ExecStart=/home/admin/vhusbdarm
WorkingDirectory=/home/admin
Restart=always
User=root

:warning: Remember to adjust the paths

Then run:

sudo systemctl daemon-reload
sudo systemctl restart virtualhere.service

This change allows the service to start properly without permission issues.

Apologies for any confusion caused, and thank you to Brian who helped troubleshoot this!

1 Like

So, I updated the file as shown below

Description=VirtualHere USB Server
After=network.target

[Service]
ExecStart=/home/pi1/vhusbdarm
WorkingDirectory=/home/pi1  
Restart=always
User=root 

[Install]
WantedBy=multi-user.target

Then issued these commands

sudo systemctl daemon-reload
sudo systemctl restart virtualhere.service

Here is the resulting log

2025-04-23 11:17:59 (1.01 MB/s) - ‘vhusbdarm.1’ saved [388044/388044]

pi1@raspberrypi:~ $ realpath ./vhusbdarm
/home/pi1/vhusbdarm
pi1@raspberrypi:~ $ whoami
pi1
pi1@raspberrypi:~ $ sudo ./vhusbdarm &
[1] 3210
pi1@raspberrypi:~ $ VirtualHere USB Server is running...press CTRL-C to stop
sudo nano /etc/systesudo nano /etc/systemd/system/virtualhere.service
pi1@raspberrypi:~ $ sudo nano /etc/systemd/system/virtualhere.service
pi1@raspberrypi:~ $ sudo systemctl daemon-reload
sudo systemctl restart virtualhere.service
pi1@raspberrypi:~ $ sudo systemctl status virtualhere.service
× virtualhere.service - VirtualHere USB Server
     Loaded: loaded (/etc/systemd/system/virtualhere.service; disabled; preset:>
     Active: failed (Result: exit-code) since Wed 2025-04-23 11:37:54 CDT; 1min>
   Duration: 1.233s
    Process: 3645 ExecStart=/home/pi1/vhusbdarm (code=exited, status=5)
   Main PID: 3645 (code=exited, status=5)
        CPU: 231ms

Apr 23 11:37:54 raspberrypi systemd[1]: virtualhere.service: Scheduled restart >
Apr 23 11:37:54 raspberrypi systemd[1]: Stopped virtualhere.service - VirtualHe>
Apr 23 11:37:54 raspberrypi systemd[1]: virtualhere.service: Start request repe>
Apr 23 11:37:54 raspberrypi systemd[1]: virtualhere.service: Failed with result>
Apr 23 11:37:54 raspberrypi systemd[1]: Failed to start virtualhere.service - V>
lines 1-13/13 (END)

Tried it a second time with no luck. The server is still not running unless I do it manually.

pi1@raspberrypi:~ $ sudo systemctl status virtualhere.service
× virtualhere.service - VirtualHere USB Server
     Loaded: loaded (/etc/systemd/system/virtualhere.service; disabled; preset: >
     Active: failed (Result: exit-code) since Wed 2025-04-23 11:37:54 CDT; 4min >
   Duration: 1.233s
    Process: 3645 ExecStart=/home/pi1/vhusbdarm (code=exited, status=5)
   Main PID: 3645 (code=exited, status=5)
        CPU: 231ms

Apr 23 11:37:54 raspberrypi systemd[1]: virtualhere.service: Scheduled restart j>
Apr 23 11:37:54 raspberrypi systemd[1]: Stopped virtualhere.service - VirtualHer>
Apr 23 11:37:54 raspberrypi systemd[1]: virtualhere.service: Start request repea>
Apr 23 11:37:54 raspberrypi systemd[1]: virtualhere.service: Failed with result >
Apr 23 11:37:54 raspberrypi systemd[1]: Failed to start virtualhere.service - Vi>
lines 1-13/13 (END)

Thank you!