Slabbed-or-not: Detect if your VPS container is running under a hypervisor
github.com
github.com
Between this and your recent choice to disable zooming out when browsing code via iPhone, I'm starting to worry a bit.
On the very slim chance that a Github staffer is reading this, here's the link that was down for ~30 minutes: https://github.com/kaniini/slabbed-or-not/blob/master/slabbe... ... It was down at around 8pm PST.
That sounds odd, but I guess it makes their management easier, though tools to balance VMs between machines should negate the need for that.
True.
>why are they still so easily detectable?
This doesn't negate the above. An OS interfaces with the underlying hardware, whether it's virtual or physical, so it always has some idea of what's going on, depending on what the virtualization layer tells the kernel. While it's possible to make a virtualization stack that makes it look like an OS is bare metal, many people don't care and already know that they are virtualized. It's possible to make the Linux kernel sidestep the tests for virtualization in this project, however.
Hosting providers do this with their Virtuozzo products so they can take advantage of memory deduplication. Such information can be helpful in diagnosing performance bottlenecks (think paravirtual steal-time).
A lot? I don't know any. Can you name some?
http://lowendtalk.com/discussion/20847/buyvm-lies-cheats-ste...
Whether they are doing so dishonestly is a subjective question though. I changed the README a little.
This entire repo is like a 40 line bash script, but they wrote it in C because.. they know C presumably?
The thing that really makes me curious though, how many people are running VPS's on so many clients that they need a tool to tell if it's virtualized? I can understand wanting to know, I guess, but why not just have a list like "if /proc/whatever exists, you are in kvm" instead of compiling and running this? Who would do it? Why is this on the frontpage?
That said, this project seems to use C to make CPUID calls with inline assembly, and thus circumvent the `/proc/` interface. If this is true, it might be useful to describe your process in your README.
The submitter is not the owner of the github repo. Not everyone submits their own things, a lot of people submit things they think will be interesting to others.
In particular, the fact that it's using inline asm directly (for cpuid, ud2, some others). Maybe with 'as' but that's not exactly pure bash (and I suspect not embedding it in C would need a non-trivial main function anyway).
Reading an arbitrary memory address (for the cpuid scans) might be a bit tricky too, though it could be doable with /proc/$PID/mem.
Not sure re: UD2 though.
C is perfectly fine for this, and anything else, especially if you are very proficient as whoever created this library clearly is. It's going to make it MUCH more painful for people to use though, especially if they don't have gcc on their servers and their desktop isn't linux.
In that case, we do not have files in /proc to look at, we have to do it the hard way instead.
http://cgit.freedesktop.org/systemd/systemd/tree/src/shared/...
http://cgit.freedesktop.org/systemd/systemd/tree/src/detect-...