Sign inSign up

andrewagner86/virtualhere

By andrewagner86

•Updated 11 days ago

VirtualHere USB Server in a minimal Alpine image to share USB devices over the network

Image
0

1.9K

andrewagner86/virtualhere repository overview

⁠virtualhere

A minimal Alpine-based Docker image that runs the VirtualHere USB Server⁠, letting you share USB devices attached to the Docker host over the network.

The VirtualHere server binary is downloaded when the image is built and baked into the image. On every container start the entrypoint script writes any environment variables you provide into /data/config.ini and starts the server.

⁠Quick start

docker run -d \
  --name virtualhere \
  --restart unless-stopped \
  --privileged \
  -p 7575:7575/tcp \
  -p 5353:5353/udp \
  -v /path/on/host/data:/data \
  -e SERVERNAME=MyVirtualHere \
  andrewagner86/virtualhere:latest

--privileged (or at least --device=/dev/bus/usb) is required so the container can access the host's USB devices.

⁠Image tags

Image tags are the version of the contained VirtualHere USB Server, e.g. 4.8.8, 4.8, 4 and latest. To pin a VirtualHere version, use the full version tag.

During the build, the downloaded binary is verified against the SHA1 hash recorded for that version, so a tag always contains exactly the VirtualHere binary of its version.

⁠docker-compose
services:
  virtualhere:
    image: andrewagner86/virtualhere:latest
    container_name: virtualhere
    restart: unless-stopped
    privileged: true
    ports:
      - "7575:7575/tcp"
      - "5353:5353/udp"
    volumes:
      - ./data:/data
    environment:
      - SERVERNAME=MyVirtualHere

⁠Volume

/data is used to persist config.ini across container restarts/updates. Mount a host directory or named volume there.

⁠Ports

PortProtocolPurpose
7575TCPClient control and USB device data
5353UDPBonjour/Avahi auto-discovery

⁠Environment variables

All variables below are optional. When set, their value is written into the corresponding key in /data/config.ini before the server starts (existing values in config.ini are preserved if a variable is not set). See the official VirtualHere server configuration reference⁠ for full, authoritative details on each setting.

Variableconfig.ini keyDescription
SERVERNAMEServerNameName of the server shown to VirtualHere clients.
LICENSELicenseVirtualHere Pro license key.
DEVICENICKNAMESDeviceNicknamesCustom nicknames for specific USB devices.
USEAVAHIUseAVAHIEnable (1) or disable (0) Bonjour/Avahi auto-discovery.
HOSTNAMEHostnameHostname advertised by the server.
COMPRESSIONLIMITCompressionLimitPacket size threshold (bytes) above which USB traffic is compressed.
IGNOREDDEVICESIgnoredDevicesUSB devices to exclude from sharing.
IGNOREDBUSESIgnoredBusesUSB buses to exclude from sharing.
ALLOWEDDEVICESAllowedDevicesWhitelist restricting sharing to only these devices.
AUTOATTACHTOKERNELAutoAttachToKernelWhether devices are reattached to the host kernel driver when not in use by a client.
CLAIMPORTSClaimPortsWhether entire USB ports are claimed, even without a matching device attached.
PINGINTERVALPingIntervalInterval (seconds) for client keep-alive pings.
PINGTIMEOUTPingTimeoutTimeout (seconds) for a ping response before considering a client disconnected.
CONTROLTIMEOUTControlTimeoutTimeout (seconds) for USB control transfers.
USEAVAHISERVICEFILEUseAvahiServiceFileWhether to use a dedicated Avahi service file for discovery.
REVERSECLIENTSReverseClientsAddresses of clients the server should reverse-connect to (useful when the server is behind NAT/firewall).
REVERSECLIENTSRETRYPERIODReverseClientsRetryPeriodRetry period (seconds) for reverse client connections.
CLIENTIDMAPClientIdMapMaps client identifiers to friendly names.
HIDECLIENTINFOHideClientInfoHides client IP/hostname info from the device list.
NETWORKINTERFACENetworkInterfaceNetwork interface the server should bind to.
CLIENTAUTHORIZATIONClientAuthorizationPath to a script/executable invoked to authorize connecting clients.
CLIENTDEAUTHORIZATIONClientDeauthorizationPath to a script/executable invoked when a client disconnects.
SSLCERTSSLCertPath to an SSL certificate for encrypted client connections.
SSLUSECLIENTCERTSSSLUseClientCertsWhether to require client certificates (mutual TLS).
SSLCAFILESSLCAFileCA file used to validate client certificates.

⁠Architecture support

At build time the VirtualHere binary matching the target platform is picked:

  • linux/amd64 → vhusbdx86_64
  • linux/386 → vhusbdi386
  • linux/arm64 → vhusbdarm64
  • linux/arm/v7 / linux/arm/v6 → vhusbdarm

The image itself is built for linux/amd64, linux/386, linux/arm64, linux/arm/v7 and linux/arm/v6.

VirtualHere also provides MIPS binaries (vhusbdmips, vhusbdmipsel), but there is no official Alpine base image for MIPS, so this image can't be built for those platforms.

⁠License

The files used to build this image are licensed under the MIT License. VirtualHere itself is a separate, third-party product with its own license terms.

Tag summary

Content type

Image

Digest

sha256:239dc84a6…

Size

4.6 MB

Last updated

11 days ago

docker pull andrewagner86/virtualhere