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?
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?
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:
/proc/sys/xen
exists/proc/vz
existslspci
/proc/self/status
has an s_context
or VxID
field/sbin/zonename
existsThese 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.
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.
Look for /proc/vz/veinfo
Look for one of /proc/sys/xen
, /sys/bus/xen
or /proc/xen
Look for s_context
or VxID
in /proc/self/status
lspci
and look for VMWare VGA adapterdmidecode
and look for mention of VMWare or ParallelsRun lspci and look for RAM memory: Qumranet, Inc. Virtio memory balloon
Take a look at your machine's MAC address(es). Do you see any VM-specific OUIs?
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.
Try and set up a VM environment. It should fail if it is inside a VM.