#virtual-machine #command #virtualization #management #operations #built #rv

bin+lib rvirsh

rvirsh is a Rust-based virtual machine management tool built using the libvirt-rs library. It reimplements the functionality of the virsh command, providing simple and efficient virtualization operations in Rust.

4 releases

0.1.4 Dec 5, 2024
0.1.3 Nov 29, 2024
0.1.2 Oct 23, 2024
0.1.1 Oct 23, 2024

#102 in Emulators

Download history 235/week @ 2024-10-21 4/week @ 2024-10-28 108/week @ 2024-11-25 158/week @ 2024-12-02 23/week @ 2024-12-09

289 downloads per month

MIT and LGPL-2.1

66KB
1.5K SLoC

rvirsh(rv)

rvirsh is a Rust-based virtual machine management tool built using the libvirt-rs library. It reimplements the functionality of the virsh command and virt-install command, providing simple and efficient virtualization operations in Rust.

To avoid using complex arguments, rvirsh reads default configuration from $HOME/.config/rvirsh/default.toml or ./default.toml (if it does not exists).

Installation

Common procedures

  1. Ensure that Rust is installed on your system. If not, install it from the official Rust website.

  2. Ensure that libvirt-dev or libvirt-devel is installed on your system. Otherwise, compile will be fail. If not, install it with the following command (in Fedora/RHEL).

    dnf install libvirt-devel
    

Get binary

  1. Install from crates.io:

    cargo install rvirsh
    

Install from source code

  1. Clone the rvirsh repository:

    git clone https://github.com/your-username/rvirsh.git
    
  2. Navigate to the project directory and build it using Cargo:

    cd rvirsh
    cargo build --release
    
  3. Install the binary:

    cargo install --path .
    

Usage

rvirsh provides commands similar to those found in virsh. Below are some basic examples. Please run rv help to see which commands are supported.

List all virtual machines

rv list

Start a virtual machine

rv start <vm-name>

Shut down a virtual machine

rv shutdown <vm-name>

Display information about a virtual machine

rv dominfo <vm-name>

Show detailed configuration of a virtual machine

rv dumpxml <vm-name>

Usage (as a library)

rvirsh also offers some functions as a library. So it can be embedded into your project as a crate. Please visit crates.io for more info.

rvirsh = "x.y.z"

Development

To set up the development environment, follow these steps:

  1. Clone the repository:

    git clone https://github.com/your-username/rvirsh.git
    
  2. Install the necessary dependencies:

    cargo build
    
  3. Run tests:

    cargo test
    

Contributing

Please report any bugs or feature requests via the GitHub issue tracker. Pull requests are welcome!

Dependencies

~7–15MB
~203K SLoC