How to Password Protect your XBVR Webui

Hello!

I’ve just figured this out for myself and figured I’d share. I have been looking for a way to password protect XBVR from other users on a network, XBVR has a authentication feature in the GUI, but it only seems to password protect when launching from a player like Heresphere, anyone can still browse to 10.x.x.x:9999 from a web browser and access your library on the network.

Turns out you can set a username and password to stop anyone from accessing the server but it requires a .bat file.

Before doing anything I strongly recommend making a backup of your xbvr data located in %appdata%\xbvr just to be safe.

Moving on,
To setup the username and password, create a new .txt file and copy the following:

@echo off
set UI_USERNAME=your_username
set UI_PASSWORD=your_password
start “” “C:\Path\To\Your\Application.exe”

Then change “your_username” and “your_password” to whatever credentials you choose, enter the file path to your xbvr.exe save the document with whatever name you please, and close the .txt file.

Next you will need to change the .txt file to .bat just rename the file, and replace .txt with .bat

All done! next time you go to launch XBVR just double click your .bat file, xbvr will launch like normal but when you browse to the UI you will be greeted with this login screen:

image

2 Likes

would this work for deovr?

Thank you! I have a Mac, so it was a bit simpler. Should work similarly on Linux as well:

Option 1: Pass username and password through the terminal when launching XBVR:

Assuming the xbvr executable is in dirname,

Every time you run XBVR, launch it through the terminal with a username and password.

UI_USERNAME=your_username UI_PASSWORD=your_password ./dirname/xbvr

Option 2: Store username and password in a bash script, and run bash script to launch XBVR:

First create a file (in my case I created it in the same dirname, but you can keep it wherever you want)

touch dirname/launch_xbvr.sh
nano dirname/launch_xbvr.sh

In the file you created, copy paste this - enter the user/pass you want along with your xbvr executable path. Because my script is in the same directory as the executable, I can use a local path.

#!/bin/bash

export UI_USERNAME=your_username
export UI_PASSWORD=your_password

~/dirname/xbvr

Then make it an executable

chmod +x /dirname/launch_xbvr.sh

Finally you can run it as:

./dirname/launch_xbvr.sh
1 Like