Crates.io | virtualbox_rs |
lib.rs | virtualbox_rs |
version | 0.2.2 |
source | src |
created_at | 2024-10-01 10:00:17.906572 |
updated_at | 2024-10-25 14:46:30.185258 |
description | A Rust library for interacting with VirtualBox, providing a safe and idiomatic interface to the VirtualBox API. |
homepage | |
repository | |
max_upload_size | |
id | 1392683 |
size | 1,307,528 |
virtualbox_rs
is a Rust library for interacting with VirtualBox through its SDK.
This library provides a comprehensive set of bindings to manage VirtualBox VMs, including creating, deleting, and modifying virtual machines, handling snapshots, and configuring various VM settings such as network adapters, audio settings, and encryption.
use virtualbox_rs::{Session, VirtualBox};
use virtualbox_rs::enums::SessionType;
fn main() {
let vbox = VirtualBox::init().unwrap();
let mut session = Session::init().unwrap();
let machine = vbox.find_machines("Freebsd_14").unwrap();
machine.lock_machine(&mut session, SessionType::Shared).unwrap();
let machine_mut = session.get_machine().unwrap();
let progress = machine_mut.delete_snapshot_and_all_children("278ef54a-2e75-4aba-b212-551af4c69725").unwrap();
progress.wait_for_completion(-1).unwrap();
}
This library has been tested on:
Not everything has been implemented yet. The library emphasizes providing examples for each method, which should simplify its usage.