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?
- 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 formatVendorID:ProductID
.
- 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 usingusbconfig
(or a similar command) to detach it.
- 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.
- 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.
- Start the OpenWRT VM:
- Start the VM from the Proxmox web interface or using the command line (
qm start <vmid>
).
- Configure OpenWRT:
- Once the VM is running, log into OpenWRT.
- Check if the Wi-Fi USB adapter is recognized using commands like
lsusb
ordmesg
. - 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:
- 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 formatVendorID:ProductID
.
- 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
, where189
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
, where001/002
should be replaced with the bus and device number your USB device is on. This can be found usinglsusb
.
- 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
.
- 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>
).
- 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
ordmesg
). - Configure the Wi-Fi settings in OpenWRT to use the new adapter.
- 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.