Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This question already has an answer here:

When renting a dedicated server, how can one be certain than he/she is not getting a VPS or some other virtual machine variant instead of a true dedicated hardware box?

Which checks can be run (assuming it is a linux box) to detect such case?

share|improve this question

marked as duplicate by Michael Hampton May 12 at 19:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Is the provider untrustworthy? Do you feel that you need to check on this? What is your motivation for this question? –  Frank V Oct 26 '09 at 19:30
    
This is not regarding a specific provider, but just in general. I see cheaper and cheaper options available that I sometimes wonder if it is really a dedicated server those companies are offering. –  mr-euro Oct 27 '09 at 10:27

5 Answers 5

up vote 21 down vote accepted

First of all, physical machines tend to have more memory than VPSs. Question 512MB or less. Secondly you can check several things to find a VPS. You'll commonly find virtual machines have surprisingly basic looking hardware in them. Like KVM has a "Cirrus Logic GD 5446" graphics card. VMWare used to have an RTL8129 network card in. This is so most OS installation media has drivers for the virtual devices.

The facter (part of Puppet) virtual.rb script has several useful techniques for finding out what type of machine you're running.

OpenVZ

Look for /proc/vz/veinfo

Xen

Look for one of /proc/sys/xen, /sys/bus/xen or /proc/xen

vserver

Look for s_context or VxID in /proc/self/status

VMWare or Parallels

  • Run lspci and look for VMWare VGA adapter
  • Run dmidecode and look for mention of VMWare or Parallels

KVM

Run lspci and look for RAM memory: Qumranet, Inc. Virtio memory balloon

share|improve this answer
    
Have a vote yourself, for the KVM test which I haven't used before. –  womble Oct 26 '09 at 15:13
    
It's only cos I've got a kvm host to hand :) –  David Pashley Oct 26 '09 at 15:17
    
Thx for the specific type of devices/hardware hints. –  mr-euro Nov 3 '09 at 17:50

There's no 100% reliable way for you to detect that you're in a VM, just like there's no way to detect whether you're actually in the Matrix, or if you're actually a computer simulation.

However, if the provider is an idiot, you can tell that you're in a VM from the following handy list:

  • Xen: /proc/sys/xen exists
  • OpenVZ/Virtuozzo: /proc/vz exists
  • VMWare: Look for a VMWare video card in the output of lspci
  • Linux VServer: /proc/self/status has an s_context or VxID field
  • Solaris Zone: /sbin/zonename exists

These aren't 100% reliable, because the provider controls the environment and can modify the system to not show these. However, anyone who is cheap enough to sell you a dedicated server and give you a VM probably isn't smart enough to be able to pull this off.

share|improve this answer
    
Damn, you got there just before I did. Have a vote :) –  David Pashley Oct 26 '09 at 15:10
1  
You too? I was certain that those green characters scrolling down the walls were only visible to me... –  mr-euro Oct 26 '09 at 15:25

Take a look at your machine's MAC address(es). Do you see any VM-specific OUIs?

share|improve this answer

If you want to take a more hands-on approach, you can try this answer from elsewhere. Unfortunately, it does require a functional compiler on the "guest" system.

share|improve this answer

Try and set up a VM environment. It should fail if it is inside a VM.

share|improve this answer
2  
I do not think this is correct. In the past I have seen guests being hosts for other guests, even across different virtualization platforms. –  mr-euro Oct 26 '09 at 15:22
1  
Depending on the VM environment you're in and what you're trying to do, it might not fail -- and, ultimately, the provider could have emulated everything that the VM system needs to work anyway. –  womble Oct 26 '09 at 15:22
5  
It's also an awful lot of work. –  womble Oct 26 '09 at 15:24
    
I've run three VMWare ESXi hosts inside a VMWare Workstation, and then ran 5 VMWare ESXi guests inside those for doing a proof of concept. Definately not a good test. –  Mark Henderson Mar 16 '10 at 22:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.