vmw_backdoor

crates.io Documentation

A pure-Rust library for VMware host-guest protocol ("VMXh backdoor").

This library provides helpers to access and use the VMware backdoor from a guest VM. It allows bi-directional interactions with the VMWare hypervisor and host environment.

The "backdoor" protocol does not have official specifications, but it has been widely analyzed and there are multiple projects documenting it: 1. https://github.com/vmware/open-vm-tools/blob/stable-11.0.5/open-vm-tools/lib/include/backdoordef.h 2. https://wiki.osdev.org/VMwaretools 3. https://sysprogs.com/legacy/articles/kdvmware/guestrpc.shtml 4. https://github.com/vmware/vmw-guestinfo/tree/master/bdoor 5. https://sites.google.com/site/chitchatvmback/backdoor

Example

```rust let isvmw = vmwbackdoor::isvmwarecpu(); println!("VMware CPU detected: {}.", is_vmw);

let mut guard = vmwbackdoor::accessbackdoor().unwrap(); println!("Raised I/O access to reach backdoor port.");

let found = guard.probevmwarebackdoor().unwrap_or(false); println!("VMware backdoor detected: {}.", found);

let mut erpc = guard.openenhancedchan().unwrap(); let key = "guestinfo.ignition.config.data"; let guestinfo = erpc.getguestinfo(key.asbytes()).unwrap();

if let Some(val) = guestinfo { println!("Got value for key '{}':", key); println!("{}", String::fromutf8lossy(&val)); }; ```

Some more examples are available under examples.

License

Licensed under either of

at your option.