vUSBPB - a virtual USB Power Button for Proxmox VM

Kuba.Bolsa

New Member
Dec 10, 2025
5
2
3
Hi everyone!
I wrote and shared a small program for Proxmox (I called it vUSBPB) that allows you to turn on a selected virtual machine using a virtual button on your computer - without using a console or GUI. All you need to do is plug any (or specific) device into the configured USB port. I wrote it for my sons, but later I thought I would expand it and share it on Github.

Help yourself: https://github.com/Kuba-Bolsa/VUSBPB
 
This is really cool! I often set up a single Proxmox host with 2–3 VMs, each with a physical monitor, keyboard/mouse, and GPU passthrough for different users. This will definitely help. Thanks!
 
You are welcome :-) My sons have the same setup – one physical computer, two graphics cards, four monitors – and there was a problem when one of them shut down his VM.
 
Ha, that sounds like a fun idea to make it all more physical/haptic.

I haven't tested it, but have you seen changes in the USB port numbering on reboots? Also for example if a USB hub is used?
 
I like the idea - but maybe use a USB-hub/cable extender (replaceable) so that the server's USB ports won't be damaged - by the kids excessively inserting/removing/yanking their USB devices.

I could see this being adapted to use specific USB Device IDs that are programmable (like on an ESP32 chip) - so in effect this could be like a physical key only held by the user who has rights to start that VM.
 
Everything you wrote is already in my solution. If you connect a USB hub to your computer, this ports will also be visible in the list and you will be able to use them. The use of a specific device as a key also already works here. All you need to do is configure the start-up by device ID (--add VM_ID --usbdevice DEVICE_ID). Have a nice evening!
 
Ha, that sounds like a fun idea to make it all more physical/haptic.

I haven't tested it, but have you seen changes in the USB port numbering on reboots? Also for example if a USB hub is used?
Hi Aaron,
Each port on your computer has the same address at all times; they are unchangeable. If you have a USB hub connected, it will also have the same addresses, even after restarting your computer. The port numbers for the USB hub will only change if you physically connect it to a different USB port on the server.

When executing the command --list usb, I removed all unnecessary elements i.e. the USB hubs (devices, not they ports!) and controllers on the computer's motherboard. This doesn't affect functionality, it only increases the readability of the list.
 
Each port on your computer has the same address at all times; they are unchangeable If you have a USB hub connected, it will also have the same addresses, even after restarting your computer
I believe this is not correct. I'll give you a local forum example - see here, but you can search the WWW for many others.
 
I believe this is not correct. I'll give you a local forum example - see here, but you can search the WWW for many others.
I haven't encountered such a case. It's also strange from the point of view of /sys/bus/usb/devices.

Ports in Unix systems have fixed numbering, e.g. 1-3, 4-2, 4-1, etc. The first digit indicates the controller, which is fixed. The second digit is the port number in that controller. It's also fixed. If you connect a USB hub with 3 additional ports to port 4-2, for example, the system will label them as 4-2.1, 4-2.2 and 4-2.3. I performed a test: I connected a USB hub to the port, ran --list usb, disconnected the hub, turned the computer off and on, connected the USB hub to the same port, and they have the same numbering.

Perhaps, in some specific situations it''s possible to change the port numbering. I don't want to mislead anyone, but I haven't observed such a case.

Maybe there are motherboards that initialise USB controllers in different order during start-up, which causes the addresses to change. This is just my theory based on the URL you sent...
 
Last edited: