Skip to content

ventoy Ventoy

Ventoy is used as an app to serve multipe ISOs on a bootable USB drive. The drive is consistently plugged into the node and updated automatically using cp -u. It is meant to be synchronized with ISOs saved in Proxmox or downloaded via qTorrent.

The way that it works is that an NFS share and USB drive are mounted using autofs. A cronjob is run nightly to sync the ISO files on the NFS with the thumb drive.

Warning

Continuous writes to USB drives will degrade the life of the drive.

🛠 Installation

Default Port: 24680

Configuration path: /opt/ventoy

.env: true

homelab/pve/ventoy/install.sh

task install
./install.sh
sudo ./install.sh

⚙ Config

.env

cp .env.tmpl .env
nano .env
VENTOY_HOST=0.0.0.0
VENTOY_MNT=/mnt/usb
VENTOY_USB=/dev/disk/by-id/usb-USB_SanDisk_3.2Gen1_04019ebb9045b2187b4c68fdf6daa1ba6507f9ffa0329ae0dc9c496da45564b4c2550000000000000000000066a6801d000fb41883558107952c0477-0:0-part1
VENTOY_DEST=/mnt/usb
VENTOY_SOURCE=/mnt/storage/downloads
VENTOY_INSTALL_DIR=/opt/ventoy

🤝 Service

/etc/systemd/system/ventoy.service

cat > /etc/systemd/system/ventoy.service <<EOF
[Unit]
Description=Ventoy Web Service
After=network-online.target

[Service]
Type=simple
User=root
WorkingDirectory=/opt/ventoy
EnvironmentFile=/root/git/nicholaswilde/homelab/pve/ventoy/.env
ExecStart=/opt/ventoy/VentoyWeb.sh -H ${VENTOY_HOST}
Restart=always
ExecReload=/bin/kill -USR1 $MAINPID

[Install]
WantedBy=multi-user.target

EOF
wget https://github.com/nicholaswilde/homelab/raw/refs/heads/main/pve/ventoy/ventoy.service -O /etc/systemd/system/ventoy.service
[Unit]
Description=Ventoy Web Service
After=network-online.target

[Service]
Type=simple
User=root
WorkingDirectory=/opt/ventoy
EnvironmentFile=/root/git/nicholaswilde/homelab/pve/ventoy/.env
ExecStart=/opt/ventoy/VentoyWeb.sh -H ${VENTOY_HOST}
Restart=always
ExecReload=/bin/kill -USR1 $MAINPID

[Install]
WantedBy=multi-user.target

Enable service

(
 systemctl enable ventoy.service && \
 systemctl start ventoy.service && \
 systemctl status ventoy.service
) 

⏰ Cronjob

2 A.M. nightly

(crontab -l 2>/dev/null; echo "0 2 * * * find /mnt/storage/downloads -type f -name \"*.iso\" -exec cp -u {} /mnt/usb \;  >/dev/null 2>&1") | crontab -
  crontab -e
0 2 * * * find /mnt/storage/downloads -type f -name \"*.iso\" -exec cp -u {} /mnt/usb \;  >/dev/null 2>&1"

Traefik

homelab/pve/traefik/conf.d/ventoy.yaml
---
http:
 #region routers 
  routers:
    ventoy:
      entryPoints:
        - "websecure"
      rule: "Host(`ventoy.l.nicholaswilde.io`)"
      middlewares:
        - default-headers@file
        - https-redirectscheme@file
      tls: {}
      service: ventoy
#endregion
#region services
  services:
    ventoy:
      loadBalancer:
        servers:
          - url: "http://192.168.2.70:24680"
        passHostHeader: true
#endregion

📝 Usage

The app may be installed and updated on the USB drive via the web app.

Start web server

task serve
(
  cd /opt/ventoy && \
  sudo bash -c bash VentoyWeb.sh -H "0.0.0.0"
)

Sync ISOs

task sync
find /mnt/storage/downloads -type f -name \"*.iso\" -exec cp -u {} /mnt/usb \;

🚀 Upgrade

task update

Then update the USB drive from the Web GUI.

🔗 References