Linux command to tell if the machine is physical or virtual
How can we check whether the machine is a physical or virtual one in Linux?
Which command can be used?
linux virtual-machine physical-environment
add a comment |
How can we check whether the machine is a physical or virtual one in Linux?
Which command can be used?
linux virtual-machine physical-environment
1
Was there a reason you tagged this questionredhat-enterprise-linux
? Or is thelinux
tag more appropriate? Please edit your tags as necessary.
– Twisty Impersonator
Aug 7 '17 at 23:50
add a comment |
How can we check whether the machine is a physical or virtual one in Linux?
Which command can be used?
linux virtual-machine physical-environment
How can we check whether the machine is a physical or virtual one in Linux?
Which command can be used?
linux virtual-machine physical-environment
linux virtual-machine physical-environment
edited Aug 11 '17 at 4:42
Prashast
asked Aug 7 '17 at 23:37
PrashastPrashast
1118
1118
1
Was there a reason you tagged this questionredhat-enterprise-linux
? Or is thelinux
tag more appropriate? Please edit your tags as necessary.
– Twisty Impersonator
Aug 7 '17 at 23:50
add a comment |
1
Was there a reason you tagged this questionredhat-enterprise-linux
? Or is thelinux
tag more appropriate? Please edit your tags as necessary.
– Twisty Impersonator
Aug 7 '17 at 23:50
1
1
Was there a reason you tagged this question
redhat-enterprise-linux
? Or is the linux
tag more appropriate? Please edit your tags as necessary.– Twisty Impersonator
Aug 7 '17 at 23:50
Was there a reason you tagged this question
redhat-enterprise-linux
? Or is the linux
tag more appropriate? Please edit your tags as necessary.– Twisty Impersonator
Aug 7 '17 at 23:50
add a comment |
3 Answers
3
active
oldest
votes
If you've got systemd installed, it comes with systemd-detect-virt
.
me@real-machine:~$ systemd-detect-virt
none
me@vm:~$ systemd-detect-virt
qemu
Can detect many different types of virtualization and containers, too.
If don't have systemd, there is also virt-what
which has a package at least on Debian (and considering where it comes from, unsurprisingly for RedHat too).
See also “Easy way to determine virtualization technology” on Unix & Linux for a bunch more approaches.
add a comment |
Using lshw
will give you system information:
- Run the command:
sudo apt-get install lshw
- NOTE: This command may vary depending on the Linux distribution.
- Run the command:
sudo lshw -class system
- This will show information about the system. For example, if the machine is a Dell or HP, that will be the product. In the case of a virtual machine, the product will be the name of the emulator.
4
You can also do something equivalent with dmidecode
– davidgo
Aug 7 '17 at 23:48
add a comment |
Similar question in serverfault:
VMware Linux Server — how can you tell if you are a vm or real hardware?
And my answer :-)
hostnamectl status
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1238618%2flinux-command-to-tell-if-the-machine-is-physical-or-virtual%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you've got systemd installed, it comes with systemd-detect-virt
.
me@real-machine:~$ systemd-detect-virt
none
me@vm:~$ systemd-detect-virt
qemu
Can detect many different types of virtualization and containers, too.
If don't have systemd, there is also virt-what
which has a package at least on Debian (and considering where it comes from, unsurprisingly for RedHat too).
See also “Easy way to determine virtualization technology” on Unix & Linux for a bunch more approaches.
add a comment |
If you've got systemd installed, it comes with systemd-detect-virt
.
me@real-machine:~$ systemd-detect-virt
none
me@vm:~$ systemd-detect-virt
qemu
Can detect many different types of virtualization and containers, too.
If don't have systemd, there is also virt-what
which has a package at least on Debian (and considering where it comes from, unsurprisingly for RedHat too).
See also “Easy way to determine virtualization technology” on Unix & Linux for a bunch more approaches.
add a comment |
If you've got systemd installed, it comes with systemd-detect-virt
.
me@real-machine:~$ systemd-detect-virt
none
me@vm:~$ systemd-detect-virt
qemu
Can detect many different types of virtualization and containers, too.
If don't have systemd, there is also virt-what
which has a package at least on Debian (and considering where it comes from, unsurprisingly for RedHat too).
See also “Easy way to determine virtualization technology” on Unix & Linux for a bunch more approaches.
If you've got systemd installed, it comes with systemd-detect-virt
.
me@real-machine:~$ systemd-detect-virt
none
me@vm:~$ systemd-detect-virt
qemu
Can detect many different types of virtualization and containers, too.
If don't have systemd, there is also virt-what
which has a package at least on Debian (and considering where it comes from, unsurprisingly for RedHat too).
See also “Easy way to determine virtualization technology” on Unix & Linux for a bunch more approaches.
answered Aug 9 '17 at 19:21
derobertderobert
3,0361718
3,0361718
add a comment |
add a comment |
Using lshw
will give you system information:
- Run the command:
sudo apt-get install lshw
- NOTE: This command may vary depending on the Linux distribution.
- Run the command:
sudo lshw -class system
- This will show information about the system. For example, if the machine is a Dell or HP, that will be the product. In the case of a virtual machine, the product will be the name of the emulator.
4
You can also do something equivalent with dmidecode
– davidgo
Aug 7 '17 at 23:48
add a comment |
Using lshw
will give you system information:
- Run the command:
sudo apt-get install lshw
- NOTE: This command may vary depending on the Linux distribution.
- Run the command:
sudo lshw -class system
- This will show information about the system. For example, if the machine is a Dell or HP, that will be the product. In the case of a virtual machine, the product will be the name of the emulator.
4
You can also do something equivalent with dmidecode
– davidgo
Aug 7 '17 at 23:48
add a comment |
Using lshw
will give you system information:
- Run the command:
sudo apt-get install lshw
- NOTE: This command may vary depending on the Linux distribution.
- Run the command:
sudo lshw -class system
- This will show information about the system. For example, if the machine is a Dell or HP, that will be the product. In the case of a virtual machine, the product will be the name of the emulator.
Using lshw
will give you system information:
- Run the command:
sudo apt-get install lshw
- NOTE: This command may vary depending on the Linux distribution.
- Run the command:
sudo lshw -class system
- This will show information about the system. For example, if the machine is a Dell or HP, that will be the product. In the case of a virtual machine, the product will be the name of the emulator.
answered Aug 7 '17 at 23:42
AshtonAshton
695417
695417
4
You can also do something equivalent with dmidecode
– davidgo
Aug 7 '17 at 23:48
add a comment |
4
You can also do something equivalent with dmidecode
– davidgo
Aug 7 '17 at 23:48
4
4
You can also do something equivalent with dmidecode
– davidgo
Aug 7 '17 at 23:48
You can also do something equivalent with dmidecode
– davidgo
Aug 7 '17 at 23:48
add a comment |
Similar question in serverfault:
VMware Linux Server — how can you tell if you are a vm or real hardware?
And my answer :-)
hostnamectl status
add a comment |
Similar question in serverfault:
VMware Linux Server — how can you tell if you are a vm or real hardware?
And my answer :-)
hostnamectl status
add a comment |
Similar question in serverfault:
VMware Linux Server — how can you tell if you are a vm or real hardware?
And my answer :-)
hostnamectl status
Similar question in serverfault:
VMware Linux Server — how can you tell if you are a vm or real hardware?
And my answer :-)
hostnamectl status
answered Jan 18 at 8:49
Seweryn Habdank-WojewódzkiSeweryn Habdank-Wojewódzki
1214
1214
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1238618%2flinux-command-to-tell-if-the-machine-is-physical-or-virtual%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Was there a reason you tagged this question
redhat-enterprise-linux
? Or is thelinux
tag more appropriate? Please edit your tags as necessary.– Twisty Impersonator
Aug 7 '17 at 23:50