I was curious if it's possible to start a virtual environment that can do something like this:
int main() {
std::cout << "This part is being ran on the host";
StartVM();
std::cout << "This part is being ran on a VM";
EndVM();
return 0;
}
I've read on some documentation on Intel-VT's VMX operations, but it's a level too far above my understanding of the intricacies of x86 hardware and x86 assembly.
I've tried to run the code in the OSDev wiki but i'm having trouble trying to manually enable the corresponding bits in the article using inline assembly to make the vmxon instruction work.
If there's a library or an API in C++ (or even in C) that does this, please let me know. Also, if I'm deeply misunderstanding something about VMX or virtualisation in general, then please point me to the right direction.