Desktop PeripheralsConnect the device, then inspect the messages and buses before installing drivers or changing configuration:
dmesg | tail -50
usbconfig
usbconfig list
camcontrol devlist
usbconfig identifies USB devices, while camcontrol devlist shows storage devices attached through the CAM subsystem. For device names and further diagnostic tools, see Devices and Device Nodes.
MidnightBSD includes the traditional lpr, lpq, lprm, lpc, and lpd printing system. It is suitable for a simple text or raw-print queue when the printer and its data format are already understood. Use CUPS instead when you need printer discovery, drivers, PDF/image filtering, or a web administration interface.
For a USB printer, first check that /dev/unlpt0 exists. Create a spool directory and add a minimal queue named lp to /etc/printcap:
doas mkdir -p /var/spool/lpd/lp
doas chown daemon:daemon /var/spool/lpd/lp
doas chmod 770 /var/spool/lpd/lp
lp:\
:lp=/dev/unlpt0:\
:sh:\
:mx#0:\
:sd=/var/spool/lpd/lp:\
:lf=/var/log/lpd-errs:
For a network printer that provides LPD, the device line is typically :lp=:rm=printer.example:rp=raw:; use the hostname and queue name supplied by the printer administrator. Enable the daemon and submit a plain-text test job:
doas sysrc lpd_enable="YES"
doas service lpd start
printf "MidnightBSD printing test\n" | lpr
lpq
Print a file with lpr file.txt, select a configured queue with lpr -P queue file.txt, and remove a queued job with lprm job-number. LPR does not automatically make arbitrary document formats printable; use a printer that accepts the submitted format or configure suitable filters.
CUPS is the better default for most desktop printers. It provides printer discovery, drivers, filtering, and a local web interface. Install CUPS and its filters from mports:
doas mport install cups cups-filters
doas sysrc cupsd_enable="YES"
doas service cupsd start
Open http://localhost:631/, choose Administration, then add the USB or network printer. Select the printer's recommended driver or a driverless IPP option when it is offered. Do not expose the CUPS administration interface to an untrusted network without first reviewing its access controls.
After creating a queue, inspect it and submit a job with CUPS commands:
lpstat -t
lp -d printer-name document.pdf
cancel -a printer-name
CUPS includes LPR-compatible commands as well, but configure one intended spooler path per printer. Avoid maintaining conflicting LPR and CUPS queues for the same device.
SANE provides scanner access. Install the backends and a graphical frontend, then list detected scanners:
doas mport install sane-backends skanlite
scanimage -L
sane-find-scanner
Run skanlite in the desktop session to scan. Detection by sane-find-scanner does not by itself guarantee that a SANE backend supports the model; consult the scanner vendor and the SANE supported-device list. The saned service is only needed when sharing a scanner across the network.
USB disks normally appear as /dev/da0, /dev/da1, and so on. Partitions may use names such as /dev/da0p1 (GPT) or /dev/da0s1 (MBR). Always identify the newly attached disk with camcontrol devlist and dmesg; do not assume a particular unit number.
For example, mount a known FAT-formatted partition on an existing mount point:
doas mount_msdosfs /dev/da0s1 /media/usb
doas umount /media/usb
Unmount the filesystem before unplugging the device. Other filesystem formats may need additional software or a different mount command. Android devices using Media Transfer Protocol can be accessed with the mtpfs package:
doas mport install mtpfs
Many USB Bluetooth adapters use the ng_ubt driver. After confirming that the adapter is supported, load it and start the Bluetooth service:
doas kldload ng_ubt
doas service bluetooth start ubt0
To load the driver at boot, add ng_ubt_load="YES" to /boot/loader.conf. Discover nearby devices with:
doas hccontrol -n ubt0hci inquiry
Only discoverable devices appear. The exact pairing procedure depends on the device profile; for audio devices, continue with the selected desktop audio stack described in the sound guide. See the MidnightBSD Bluetooth wiki for lower-level controller commands.
For USB webcams that are not supported directly by the base system, mports provides webcamd, which brings Linux USB webcam and DVB drivers into user space:
doas mport install webcamd
doas sysrc webcamd_enable="YES"
doas service webcamd start
webcamd -l
webcamd -l lists known connected devices and suggested startup flags. Test the camera in the application that will use it after the service has attached the device. Webcam compatibility varies by USB chipset and application.
usbconfig and dmesg output before and after connection.lpstat -t or lpq. For LPR, inspect /var/log/lpd-errs.sane-find-scanner and scanimage -L; a detected USB device may still lack a SANE backend.umount. Do not unplug a mounted filesystem.usbconfig output, relevant dmesg lines, and the service status in a report.