Welcome to lshw, the great tool often overlooked even by seasoned Linux professionals.
What Islshw?
One can rememberlshwby thinking about
(the command which lets you list directory contents) and
for hardware.
Perhaps other tools have taken too much of a front posting on search engines and similar.
you could even install a graphical version of the same tool using a separate package, namelylshw-gtk.
Double click this, then double click, for exampleMotherboardin the second column, and so on.
Do you know the difference between a crash and error and an assert?
OurAsserts, Errors, and Crashesarticle explains the difference.
Let’s make this work a bit better by limiting the output to what we are interested in.
Firstly we should explore the hardware classes of output available to us.
Still, the output list can be 1-2 pages long, depending on your terminal configs.
We should also at this point remember to always uselshwwithsudo.
This will ensure that the output will not be incomplete or inaccurate.
Runninglshwassudoshould be safe (famous last words!)
We also see that 8GiB of memory was assigned to this VM (Virtual Machine).
‘; else echo ‘This is not a VirtualBox VM!
‘; fi
Here we executed multiple commands, each time building the command into more complexity.
If the output does not contain ‘VirtualBox’, the command will not yield any output.
Basically, we are asking theBashinterpreter to test whether the output of the second command matches ‘VirtualBox’.
If so, we can quite confidently sayWe are using VirtualBox!.