how to know the remote machine is Virtual machine or physical machine
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
when i see the out put of cat /proc/cpuinfo
48bit for vm
38bit for physical
that looks like lottery numbers to me. Neither of these make sense.
Quote:
Originally Posted by pantdk
or their is any way to identify that this is a vm or physical machine
If the virtualization software is any good, you cannot tell the difference between a virtual and a physical machine by software. That's the idea, after all. There may be some subtle hints from which you can guess that you're running on or talking to a VM; but generally, the intention is that the VM is not distinguishable from a real physical machine.
Usually there is a specific set of tools on a box that is a vm client. It would vary depending virtual system used. For instance VMware has a VMware-toolkit on its clients.
AND - What he/she is referring to is address sizes
which in this case really has no reference to a "virtual machine"
The virtual aspect there refers to memory.
CPU cores can be virtual as well as physical. For instance usually w/an 8 core processor 4 of them are physical and other 4 are virtual.
That just specifies how many bits can fit in each address or "memory slot"
Below is a good image on wikipedia that shows dataflow in an 8 core processor
Perhaps a check for virtio_balloon.*Live in /proc/modules would do the trick. That one is alive in my virtual systems but not in the host system. (virtio_net is live in the host and the virtuals.) If you've accessed the system over a network, I think that the virtio net access stuff needs to be running. But I'm not a virtual developer, and one of them might have a better answer.
when i see the out put of cat /proc/cpuinfo
48bit for vm
38bit for physical
I think it would be unusual for CPU info from /proc/cpuinfo in a virtual machine to differ from the info of the underlying machine. That would mean the virtualization software has gone to extra effort to do a worse job of simulating a real CPU.
Anyway, 48bit virtual addressing should be standard across all X86_64 CPUs regardless of physical machine vs. virtual machine, while physical addressing will vary by CPU, 38bit is a reasonable amount and I can't think of any reason virtualization software might want to pretend the physical addressing is different from that of the real CPU.
The words "virtual" and "physical" in computer systems have many different meanings. Maybe you did a blind search on those words. "Virtual machine" is a specific computer concept that is quite different from the many other things that "virtual" means.
The links SecretCode provided look plausible to me. I'm not at all expert in how to detect a virtual machine. I'm only saying that /proc/cpuinfo is not likely to be a good place to try to get that answer.
That is true because you were (obviously) using VMware as your virtual manager. Not every virtual system uses VMware.
In fact, I have my virtuals running under qemu-kvm using Fedora's virtual manager, and, as I noted above, the suggested "test" does not produce any output when run on a Fedora 17 virtual system.
The virt-what script (in the first reference of post 6 by Secret Code) returns KVM for that virtual system.
"Thanks for view"
yes that's right every virtual system doesn't uses VMware so their out put dmidecode | grep -i "vm" also not same.
but i have to differentiate between the vm & physical so that's why i do that.
A thought: If you use the converse of your original question to ask "How can I tell if I'm running on a non-virtual system?" would the reply of "VME (Virtual mode extension)" be sufficient? (Assuming, of course, that anyone offing a server of which would want to ask the question would be using a modern processor.)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.