I have a hardware detection problem, what logs do I need to look into?
I am trying to ask a question about getting my hardware to work but I don’t know what information to add to my question to get help, what do I need to do?
Related if you don’t have access to a GUI:
These might be helpful (depending on the type of hardware):
dmesg
lspci
lsusb
Execute these following commandline tool:
cat /var/log/Xorg.0.log
lspci
dmesg
lsusb
See https://wiki.ubuntu.com/DebuggingHardwareDetection
https://wiki.ubuntu.com/DebuggingProcedures is usually a good starting point if you want to know what information is useful for a bug report.
The following logs will contain details about hardware as it was seen by various system services (kernel, udev, etc) at boot time:
/var/log/udev
/var/log/dmesg
The most important information you can give is what you’ve done, what you expected to happen, and what you observe has happened.
This question is a particularly fine example of a hardware-detection problem with a USB device.
Other examples of this could be:
I installed Ubuntu 10.04 Desktop on my Dell Optiwhatever 312 laptop. When
I log in, my wireless card isn’t visible in the Network Manager popup menu,
although the wired network shows up there.
or
I have Ubuntu 10.04 Netbook edition on my System76 laptop. When I plug my
headphones into the socket, the sound comes out the headphones but also
out the speakers.
or
I’m using Ubuntu 10.04. I used the “Additional Drivers” program to install the
current nVidia drivers for my GeForce FX 5200. Now when I boot the system stops
with a black screen after the Ubuntu boot splash is finished.
After this general problem description, what other information is interesting depends on what sort of hardware you’re having problems with, and what problems you’re having.
In general:
sudo lspci -nn
will list all the PCI devices in your system. This will include all the expansion cards (Video cards, WiFi, etc) in your system, whether or not the kernel has a driver for them. This information is useful if you’re not sure precisely what hardware you have.lsusb
will list all the USB devices connected to your system. Again, this is useful if you’re not sure precisely what hardware you have. It’s also useful to check that the device is actually plugged in correctly!/var/log/udev
and/var/log/dmesg
will have information about what devices the kernel has detected. These logs are generally very big – unless you know what parts of the log are interesting it’s not a good idea to include these in your question, although a link to them could be useful (you can use http://paste.ubuntu.com for large logs)sudo lshw --class X
prsudo lshw -C X
can also give a bit of valuable hardware info on the specifed classX
– examples classes includecdrom
,communication
,core
,cpu
,display
,isa
,medium
,memory
,multimedia
,network
,pci
,scsi
,serial
,storage
andusb
– so for instance you can usesudo lshw -C network
to show info on the network cards the computer can detect.
For Video problems:
/var/log/Xorg.0.log
is the X server log file. This is useful for all video problems. This file can get long so feel free to just put it on http://paste.ubuntu.com. Be sure to give a link to your “paste” so we can find it when we need to.LIBGL_DEBUG=verbose glxinfo
will display information about 3D acceleration support, useful for problems with 3D or desktop effects.lspci -nn | grep VGA
will list all the video cards in your system, useful if you are not sure what type of video card you have./usr/lib/nux/unity_support_test -p
should be used for compiz and other Unity compatability issues.
For Audio problems:
cat /proc/asound/cards
will list the audio devices that have been detected. You should include this.cat /proc/asound/card0/codec#0
will contain information about the first sound card, including information about the input/output ports connected to it. If you have a problem with plugging in a microphone, headsets, or external speakers, include this. You may also have more than one sound device. In that case, there will be more than one/proc/asound/card???
directory.- Wiki: Debugging Sound Problems
Note: If you have a wired connection consider running the all in one wireless script outlined in this answer, it does all the heavy lifting for you!
Wireless Cards
Wireless connectivity issues are fortunately becoming rarer with each Ubuntu release. However problems still occur.
The following information will help diagnose wireless connectivity issues in questions posted on Ask Ubuntu, you can open a terminal by hitting Ctrl–Alt–T and typing in one of these commands, then edit your question to add the information.
How the kernel recognises your network cards
sudo lshw -class network
Details of your USB wireless card
lsusb
This can give a long list depending upon how many USB devices are connected. If in doubt, post the entire list.
Details of your PCI wireless card
lspci
This can give a long list depending upon how many PCI devices are fitted. If in doubt, post the entire list.
How to see if a wireless card is soft-blocked or hard-blocked:
rfkill list all
Errors whilst connecting
Often you can see useful errors by looking at your kernel logs.
If you attempt to connect via network manager you can see what errors are produced by looking at dmesg
Suggested procedure – type dmesg
, then attempt to connect and then type dmesg
again. The new output displayed should give an indication as to the error.
Another useful output is dmesg | grep -i firmware
– if you see some errors in the output then this can indicate you need to install some firmware – usually a package from the repository.
NDISWrapper
Searching on Google will sometimes bring results suggesting using NDISWrapper. This is an old technique where obtaining a Windows XP driver can be made to work in Ubuntu.
Generally, this should be avoided in current versions of Ubuntu since the drivers in the kernel have less compatibility issues.
If you have any wireless issues post the results of the four command-line entries above into your question BEFORE trying NDISWrapper.
One of the most useful things you can do when describing a hardware issue, is describe what you did, what is connection you are using.
For example:
“I plugged in a monitor and my desktop did not automatically extend on to it.”
- Tell us what port your monitor uses (for example, vga or hdmi).
- Did you get any notifications when you plugged it in?
- Did you ensure that the connection you used is the correct one?
This kind of information may seem very simple, but it can help to pin point where common problems come from, or if you question may be off topic.
A general problem-solving hint
I’ve noticed that I often collect data to diagnose a problem by:
First, identifying the problem – what did I do, what did I expect to happen, and what seemed to happen? Can I repeat the problem?
Then, causing the problem to happen, and listing the system’s logs in reverse order of modification time:
ls -lrt /var/log
,
tail -n 25
on recently modified log files (for reasonable values of 25), and
dmesg
.
Read, wonder, think, guess, test, repeat as needed