Happy new year to all.
It is possible to detect if a PB program is running inside a Virtual Machine.
Saw same stuff here:
http://www.codeproject.com/Articles/982 ... -a-Virtual
Unfortunately I'm not able to translate that code into PB.
Maybe someone has tried something like this and could help.
Glomph
How to detect if a PB program is running inside a VM
Re: How to detect if a PB program is running inside a VM
you should be able to use cpuid info with the flag #hypervisor but you may still need to do additional checks.
see here http://www.purebasic.fr/english/viewtop ... 12&t=61060
and use IsCPU(#hypervisor)
see here http://www.purebasic.fr/english/viewtop ... 12&t=61060
and use IsCPU(#hypervisor)
Windows 11, Manjaro, Raspberry Pi OS


Re: How to detect if a PB program is running inside a VM
Thank you very much Idle
That's a start!
Glomph
That's a start!
Glomph
Re: How to detect if a PB program is running inside a VM
....and even more fine:
It works on MAC too.

It works on MAC too.

Re: How to detect if a PB program is running inside a VM
I worked on a project that had to refuse to run on a VM. we found using the ID of the NIC a good way; ultimately we used a NIC database and a CPU check as backup/secondary -- sometimes the CPU check was passed to the host OS, so you didn't get the right value...
Re: How to detect if a PB program is running inside a VM
@ jassing,
thanks you for your advice.
Surely you point the right direction.
Never before I had to look a NIC,
so I nead a little more help,
to get through.
Have all a nice day
Glomph
thanks you for your advice.
Surely you point the right direction.
Never before I had to look a NIC,
so I nead a little more help,
to get through.
Have all a nice day
Glomph
Re: How to detect if a PB program is running inside a VM
Getting the NIC information should be trivial -- and I'm sure there are code samples/examples on these forums.
Now the list of NIC info... that's a different story... It wasn't an exhaustive list, but we did sample all the "free" VM's, VMWare, Microsofts, and a few other that had trials...
I no longer work on that project, but I will see if I have the list in my personal archives....
We had to do multiple checks as each VM seemed to offer it's own unique issues that would fail some "generic" test...
Now the list of NIC info... that's a different story... It wasn't an exhaustive list, but we did sample all the "free" VM's, VMWare, Microsofts, and a few other that had trials...
I no longer work on that project, but I will see if I have the list in my personal archives....
We had to do multiple checks as each VM seemed to offer it's own unique issues that would fail some "generic" test...