Exercise: Exploring USB and Bluetooth Hardware
Identifying and Interacting with Local Radios
1 Purpose
This exercise provides hands-on experience with identifying the physical hardware that the operating system can see. Most modern laptops have a built-in Bluetooth adapter that is internally connected via USB. You will learn to use command-line tools to find this device and then use a Bluetooth-specific tool to perform a scan, demonstrating a direct link between a software command and a physical radio.
2 What You’ll Accomplish
By the end of this exercise, you will be able to:
- Use
lsusbto list all USB devices visible to the system. - Use
dmesgto search for kernel messages about the Bluetooth driver. - Use the
bluetoothctltool to scan for discoverable Bluetooth devices.
This exercise maps to the following program and course learning outcomes:
- Course Learning Outcomes (CLOs):
- 1. Identify hardware and basic network components: You will identify a specific piece of wireless hardware and its connection type.
- 3. Troubleshoot hardware and basic network components: Using tools to verify hardware presence and function is a fundamental troubleshooting step.
This exercise develops the following skills, which align with the O*NET SOC Code 15-1232.00 for Computer User Support Specialists.
| Learning Objective | O*NET KSAs | Technologies Used |
|---|---|---|
| Identify and interact with Bluetooth hardware. | Knowledge: Computers & Electronics, Telecommunications Abilities: Information Ordering |
lsusb, bluetoothctl |
3 Prerequisites
This exercise requires a running Fedora 42 virtual machine. It is most effective when run on a host machine (like a laptop) that has a built-in Bluetooth adapter.
sudo
Some commands in these exercises require administrative privileges, prefixed with sudo. To avoid repeatedly typing your password, you can configure your user account to run sudo commands without a password.
This is a convenient setting for a trusted virtual machine learning environment. Never do this on a production server or any computer that is exposed to the internet, as it is a significant security risk.
Open the
visudoeditor to create a new configuration file. The-fflag lets you specify the filename.sudo visudo -f /etc/sudoers.d/99-nopasswd-userThis will open a text editor. Add the following line, replacing
your_usernamewith your actual username (e.g.,chuck).your_username ALL=(ALL) NOPASSWD: ALLYou can also use the
$USERvariable, but typing your literal username is safer in this context.Save and exit the file. If you are in the
vieditor (the default), pressEsc, then type:wqand pressEnter.
Your user will now be able to run sudo commands without being prompted for a password.
4 Step-by-Step Guide
Open a terminal window in your Fedora VM to begin.
4.1 Step 1: List USB Devices
The lsusb command lists information about all USB buses in the system and the devices connected to them.
Run the command:
lsusbAnalyze the output. You will see a list of devices. Look for one that mentions “Intel Corp.” or “Broadcom” and “Bluetooth”. This is the internal Bluetooth adapter of your host machine. This shows that the VM is aware of the hardware passed through from the host.
4.2 Step 2: Check Kernel Messages
The dmesg command prints the kernel’s message buffer. We can search it to see if the Bluetooth driver loaded correctly.
Run the following command to search the kernel log for lines containing “bluetooth” (the
-imakes the search case-insensitive).sudo dmesg | grep -i bluetoothYou should see several lines indicating that the Bluetooth driver has been initialized and is managing the hardware.
4.3 Step 3: Scan for Devices with bluetoothctl
bluetoothctl is the primary command-line tool for managing Bluetooth devices.
Start the tool in interactive mode:
bluetoothctlYour prompt will change to
[bluetooth]#.From the new prompt, start a scan for nearby discoverable devices:
scan onLet the scan run for 15-20 seconds. You should see a list of any nearby Bluetooth devices that are in pairing or discovery mode (e.g., smartphones, wireless mice, headphones, smartwatches).
Stop the scan:
scan offExit the tool:
exit
In your notebook, copy one of the lines corresponding to a device you discovered. What information is provided for each device?
5 Reflect and Review
Now that you have completed this exercise, reflect on your experience in your Microsoft Teams Student Notebook:
- 3 commands you used in this exercise.
- 2 pieces of information you saw in the
lsusboutput for your Bluetooth device. - 1 question you still have about how the VM accesses the host’s hardware.
Answer these questions in your notebook to solidify your understanding:
- What is the purpose of the
lsusbcommand? - You run
bluetoothctland typescan on, but you see no devices. What are two possible reasons for this? - Why is it useful to check
dmesgwhen troubleshooting hardware? - What does the
bluetoothctltool allow you to do?