I have managed to get Invidious working in a Ubuntu Bhyve vm with Podman
Are you fed up with Youtube showing you rubbish
and just want to see the channels you have subscribed too
The Invidious urls work with mpv
and you can view the site using Emacs as well
Invidious set up notes after the screen shot
github notes
github.com
vm-bhyve setup
zfs dataset
rc.conf
kldload
only needed if you havent rebooted, and not needed after that
networking
gateway enable
sysctl
set option permanently
copy vm-bhyve config
doas
my doas config
github.com
edit doas.conf and add a rule for the vm command
change username to your username
vm-bhyve start
service vm start
only needed once if you havent rebooted
vm init
more networking
replace laggo with your network device
vm-bhyve create
fetch iso
i found the vm iso command stopped downloading the iso part way through,
so instead i used fetch to download the iso
Ubuntu 24.04 download with fetch
find number of cpu's
find the number of cpu's on Freebsd
vm config
create the invidious.conf for the bhyve vm
vm create
-t template name
-s file size of the vm
vm install
use the -f option to run the vm in the current terminal
Ubuntu
Podman install
youtube-trusted-session-generator
github.com
copy the tokens output in the terminal you will need them later
clone the invidious repository
change directory in the invidious repository
edit docker-compose.yml
set vi paste
paste in the following
change the ip address
find the lan address of the vm
change the following section from 127.0.0.1
to the vm lan ip
change the following options
add the visitor_data and po_token you created earlier with the youtube-trusted-session-generator
You must set a random generated value for the parameter hmac_key:!
On Linux you can generate it using the command
pwgen output
turn of paste mode in vi
podman-compose
make sure you are in the invidious git repository and run podman-compose up
login
open your browser to the address of invidious
for example
select login and add a user name and password
on the next screen you have to complete a captcha
by adding the time shown in the clock
invidious vm start
how to start invidious in the future
console
press return and enter your username and password
start invidious
change directory into the invidious git repository
stop invidious
looks like there is a bug using podman-compose down
or docker-compose down
which doesnt stop one of the container
so just control c to stop invidious
update invidious
change directory into the invidious git repository
vm destroy
alternative method
Note it is reccomended to restart Invidious every day or after an hour so
Screen shots
Invidious is an open source alternative front-end to YouTube.
Are you fed up with Youtube showing you rubbish
and just want to see the channels you have subscribed too
The Invidious urls work with mpv
and you can view the site using Emacs as well
Invidious set up notes after the screen shot
github notes
cerberus/freebsd/invidious-bhyve.org at master · NapoleonWils0n/cerberus
cerberus code library. Contribute to NapoleonWils0n/cerberus development by creating an account on GitHub.
vm-bhyve setup
Code:
doas pkg install bhyve-firmware grub2-bhyve edk2-bhyve vm-bhyve-devel
zfs dataset
Code:
doas zfs create -o mountpoint=/vm zroot/vm
doas zfs create -o mountpoint=/vm/.iso zroot/vm/iso
doas zfs create -o mountpoint=/vm/.templates zroot/vm/templates
rc.conf
Code:
doas sysrc kld_list+="vmm nmdm"
doas sysrc vm_enable=YES
doas sysrc vm_dir="zfs:zroot/vm"
kldload
only needed if you havent rebooted, and not needed after that
Code:
doas kldload vmm nmdm
networking
gateway enable
Code:
doas sysrc gateway_enable=YES
sysctl
Code:
doas sysctl net.link.tap.up_on_open=1
doas sysctl net.inet.ip.forwarding=1
set option permanently
Code:
doas echo "net.link.tap.up_on_open=1" >> /etc/sysctl.conf
doas echo "net.inet.ip.forwarding=1" >> /etc/sysctl.conf
copy vm-bhyve config
Code:
doas cp -a /usr/local/share/examples/vm-bhyve /vm/.templates
doas
my doas config
freebsd-root-xps/usr/local/etc/doas.conf at master · NapoleonWils0n/freebsd-root-xps
freebsd root dotfiles for dell xps 15 2019. Contribute to NapoleonWils0n/freebsd-root-xps development by creating an account on GitHub.
Code:
sudo pkg install doas
edit doas.conf and add a rule for the vm command
Code:
doas vi /usr/local/etc/doas.conf
change username to your username
Code:
# vm-bhyve
permit nopass :username cmd vm
vm-bhyve start
service vm start
Code:
doas service vm start
only needed once if you havent rebooted
vm init
Code:
doas vm init
more networking
replace laggo with your network device
Code:
doas vm switch create public
doas vm switch add public lagg0
vm-bhyve create
fetch iso
i found the vm iso command stopped downloading the iso part way through,
so instead i used fetch to download the iso
Ubuntu 24.04 download with fetch
Code:
doas fetch -o /vm/.iso/ubuntu-24.04.1-live-server-amd64.iso 'https://releases.ubuntu.com/24.04.1/ubuntu-24.04.1-live-server-amd64.iso'
find number of cpu's
find the number of cpu's on Freebsd
Code:
sysctl kern.sched.topology_spec
vm config
create the invidious.conf for the bhyve vm
Code:
doas vi /vm/.templates/invidious.conf
Code:
loader="grub"
cpu=4
memory=4G
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_name="disk0.img"
grub_run_partition="2"
grub_run_dir="/grub"
vm create
Code:
doas vm create -t invidious -s 60G invidious
-t template name
-s file size of the vm
vm install
use the -f option to run the vm in the current terminal
Code:
doas vm install -f invidious ubuntu-24.04.1-live-server-amd64.iso
Ubuntu
Podman install
Code:
sudo apt install git podman podman-compose pwgen
youtube-trusted-session-generator
GitHub - iv-org/youtube-trusted-session-generator: This is a generator for getting a session that passes all the checks from YouTube side
This is a generator for getting a session that passes all the checks from YouTube side - iv-org/youtube-trusted-session-generator
Code:
podman run quay.io/invidious/youtube-trusted-session-generator
copy the tokens output in the terminal you will need them later
clone the invidious repository
Code:
git clone https://github.com/iv-org/invidious.git
change directory in the invidious repository
Code:
cd invidious
edit docker-compose.yml
Code:
vi docker-compose.yml
set vi paste
Code:
:set paste
paste in the following
Code:
version: "3"
services:
invidious:
image: quay.io/invidious/invidious:latest
# image: quay.io/invidious/invidious:latest-arm64 # ARM64/AArch64 devices
restart: unless-stopped
ports:
- "127.0.0.1:3000:3000"
environment:
# Please read the following file for a comprehensive list of all available
# configuration options and their associated syntax:
# https://github.com/iv-org/invidious/blob/master/config/config.example.yml
INVIDIOUS_CONFIG: |
db:
dbname: invidious
user: kemal
password: kemal
host: invidious-db
port: 5432
check_tables: true
signature_server: inv_sig_helper:12999
visitor_data: CHANGE_ME
po_token: CHANGE_ME
# external_port:
# domain:
# https_only: false
# statistics_enabled: false
hmac_key: "CHANGE_ME!!"
healthcheck:
test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/trending || exit 1
interval: 30s
timeout: 5s
retries: 2
logging:
options:
max-size: "1G"
max-file: "4"
depends_on:
- invidious-db
inv_sig_helper:
image: quay.io/invidious/inv-sig-helper:latest
init: true
command: ["--tcp", "0.0.0.0:12999"]
environment:
- RUST_LOG=info
restart: unless-stopped
cap_drop:
- ALL
read_only: true
security_opt:
- no-new-privileges:true
invidious-db:
image: docker.io/library/postgres:14
restart: unless-stopped
volumes:
- postgresdata:/var/lib/postgresql/data
- ./config/sql:/config/sql
- ./docker/init-invidious-db.sh:/docker-entrypoint-initdb.d/init-invidious-db.sh
environment:
POSTGRES_DB: invidious
POSTGRES_USER: kemal
POSTGRES_PASSWORD: kemal
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
volumes:
postgresdata:
change the ip address
find the lan address of the vm
Code:
ip a
change the following section from 127.0.0.1
Code:
ports:
- "127.0.0.1:3000:3000"
to the vm lan ip
Code:
ports:
- "192.168.1.151:3000:3000"
change the following options
Code:
hmac_key: "CHANGE_ME!!"
visitor_data: CHANGE_ME
po_token: CHANGE_ME
add the visitor_data and po_token you created earlier with the youtube-trusted-session-generator
You must set a random generated value for the parameter hmac_key:!
On Linux you can generate it using the command
Code:
pwgen 20 1
pwgen output
Code:
Ees6vou2IekaipeiCeib
Code:
hmac_key: Ees6vou2IekaipeiCeib
turn of paste mode in vi
Code:
:set nopaste
podman-compose
make sure you are in the invidious git repository and run podman-compose up
Code:
podman-compose up
login
open your browser to the address of invidious
for example
select login and add a user name and password
on the next screen you have to complete a captcha
by adding the time shown in the clock
invidious vm start
how to start invidious in the future
Code:
doas vm start invidious
console
Code:
doas vm console invidious
press return and enter your username and password
start invidious
change directory into the invidious git repository
Code:
podman-compose up
stop invidious
looks like there is a bug using podman-compose down
or docker-compose down
which doesnt stop one of the container
so just control c to stop invidious
update invidious
change directory into the invidious git repository
Code:
podman-compose pull
podman-compose up -d
podman image prune -f
vm destroy
Code:
doas vm stop invidious
doas vm destroy invidious
alternative method
Code:
ls /dev/vmm
Code:
crw------- 1 root wheel 0x202 29 Jan 19:41 invidious
Code:
doas bhyvectl --vm=invidious --destroy
Note it is reccomended to restart Invidious every day or after an hour so
Screen shots
Last edited: