Scenario
Your manager needs detailed info about this machine’s OS,
hardware, and architecture. You’ll use uname for
kernel and platform details, and dmidecode for
manufacturer, product name, and UUID.
uname reports what the running kernel knows.
dmidecode reads SMBIOS/DMI data provided by
firmware, which is commonly used for asset tracking and for
identifying virtual machines.
Objective
- Print the kernel name with
uname. - Print the kernel release with
uname -r. - Display full kernel/system info with
uname -a. -
Identify manufacturer with
dmidecode -s system-manufacturer. -
Identify product name with
dmidecode -s system-product-name. -
Retrieve the system UUID with
dmidecode -s system-uuid.
Concepts
-
unamereflects the running kernel and runtime view of the system. -
dmidecodereads firmware tables (SMBIOS/DMI), which can reveal vendor and model, especially on servers and VMs. - Firmware identity values can differ from OS identity values and are not always trustworthy in hostile environments.
- UUIDs and product identifiers are common inventory keys; treat them as internal identifiers.
What You’ll Practice
-
Using
unameflags to extract kernel name, release, and architecture. -
Pulling SMBIOS identity fields with
dmidecode -sfor quick, script-friendly output. - Recognizing when firmware data indicates a VM vs physical server.
- Collecting details commonly needed for incident tickets, audits, and CMDB inventory.
Walkthrough
uname
Linux
uname -r
5.15.0-88-generic
uname -a
Linux sysinfo 5.15.0-88-generic #98-Ubuntu SMP x86_64 GNU/Linux
If you need only architecture, prefer
uname -m
for a clean, script-friendly value.
sudo dmidecode -s system-manufacturer
On VMs this often reports the virtualization platform vendor. On physical servers you’ll typically see Dell, HPE, Lenovo, Supermicro, or similar.
QEMU
sudo dmidecode -s system-product-name
Standard PC (i440FX + PIIX, 1996)
sudo dmidecode -s system-uuid
UUIDs are frequently used by inventory systems and cloud tooling. Treat them as identifiers and avoid sharing them publicly in real environments.
12345678-90ab-cdef-1234-567890abcdef
Common breakpoints
Some containers and restricted VMs do not expose SMBIOS to the guest. Run as root, and understand that some platforms will not provide these fields.
dmidecode requires access to firmware interfaces,
so you typically need sudo.
uname reports kernel details, not necessarily
the distribution name. For distro, use
/etc/os-release
in real troubleshooting.
Cleanup checklist
No changes are made in this lab. If you installed
dmidecode
specifically for the exercise and want to remove it, uninstall
it using your system package manager.
Reference
-
uname: prints kernel and system information.uname: kernel nameuname -r: kernel releaseuname -a: all available informationuname -m: machine hardware name (architecture)
-
dmidecode: dumps SMBIOS/DMI firmware tables (usually requires root).dmidecode -s system-manufacturer: vendor/manufacturer stringdmidecode -s system-product-name: product model namedmidecode -s system-uuid: UUID from firmware
-
/etc/os-release: distribution identification data (common source for OS name/version).