How to install Portainer on Proxmox LXC Ubuntu

I’ll guide you step by step through installing Portainer on a Proxmox LXC running Ubuntu.

Hello. How to throw a Wi-Fi usb adapter from a proxmox host into a openwrt lxc?

  1. Identify the USB Device:
  • Connect the Wi-Fi USB adapter to the Proxmox host.
  • Run lsusb to identify the USB device. Note the device ID, usually in the format VendorID:ProductID.
  1. Detach the USB Device from the Host (if needed):
  • Before passing the USB device to the VM, you might need to detach it from the host. This can be done using the usb-devices command to find the bus and device number, then using usbconfig (or a similar command) to detach it.
  1. Configure USB Passthrough in Proxmox:
  • Go to the Proxmox web interface.
  • Select the OpenWRT VM.
  • Navigate to the “Hardware” tab.
  • Click on “Add” and select “USB Device”.
  • Choose the identified Wi-Fi USB adapter from the list.
  • Proxmox will automatically handle the process of detaching the device from the host and passing it through to the VM.
  1. Check the VM’s Configuration File:
  • Optionally, you can check the VM’s configuration file located in /etc/pve/qemu-server/<vmid>.conf to ensure the USB device has been added correctly.
  1. Start the OpenWRT VM:
  • Start the VM from the Proxmox web interface or using the command line (qm start <vmid>).
  1. Configure OpenWRT:
  • Once the VM is running, log into OpenWRT.
  • Check if the Wi-Fi USB adapter is recognized using commands like lsusb or dmesg.
  • Configure the Wi-Fi settings in OpenWRT to use the new adapter

Hello. Not VM. Passthrough to lxc container.

Before making changes to anything make sure you have backups

Here is instructions for LXC:

  1. Identify the USB Device:
  • First, connect the Wi-Fi USB adapter to your Proxmox host.
  • Run the command lsusb to identify the USB device. Note down the device ID, which is usually in the format VendorID:ProductID.
  1. Configure the LXC Container:
  • Locate the configuration file of your OpenWRT LXC container. This is typically found in /etc/pve/lxc/ followed by the container ID and .conf.
  • Edit the container’s configuration file. You need to add a line to pass through the USB device. The line should look something like lxc.cgroup2.devices.allow = c 189:* rwm, where 189 is the major number for USB devices (this can vary, so check your system’s specifics).
  • Then, add a line for the specific USB device: lxc.mount.entry: /dev/bus/usb/001/002 dev/bus/usb/001/002 none bind,optional,create=file, where 001/002 should be replaced with the bus and device number your USB device is on. This can be found using lsusb.
  1. Bind Mount the USB Device (Optional):
  • If your device is not detected properly, you might need to bind mount the USB device directory from the host to the container. This can be done by adding another line in the LXC config, such as mp0: /dev/bus/usb,mp=/dev/bus/usb.
  1. Restart the LXC Container:
  • After modifying the configuration file, restart the LXC container for the changes to take effect. You can do this through the Proxmox web interface or by using the command line (pct restart <container_id>).
  1. Configure OpenWRT:
  • Once the container is up and running with the Wi-Fi USB adapter passed through, you’ll need to configure the adapter within OpenWRT.
  • Log into OpenWRT and check if the device is recognized (lsusb or dmesg).
  • Configure the Wi-Fi settings in OpenWRT to use the new adapter.
  1. Troubleshooting:
  • If the device is not recognized, ensure that all necessary drivers are installed in the OpenWRT container.
  • Check the Proxmox logs and OpenWRT logs for any errors related to USB device handling.