https://github.com/knightchaser/vnecro
Become a digital necromancer of virtual machines in a declarative way!
https://github.com/knightchaser/vnecro
Last synced: about 1 month ago
JSON representation
Become a digital necromancer of virtual machines in a declarative way!
- Host: GitHub
- URL: https://github.com/knightchaser/vnecro
- Owner: KnightChaser
- Created: 2025-03-07T06:05:16.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-14T08:30:55.000Z (over 1 year ago)
- Last Synced: 2025-10-25T05:03:49.345Z (8 months ago)
- Language: Go
- Homepage:
- Size: 38.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vnecro
> **This project is under development and not stable. It's currently under at idea realization phase.**
`vnecro` is a simple tool for controlling virtual machines, especially Linux-based guests. It allows you to perform operations such as managing snapshots, starting, executing shell commands inside the guest, and shutting down the VMs.
## Constraints
- **Manual Setup:** Users must manually configure the machines on VirtualBox.
- **Guest Additions:** The guest OS must have VirtualBox Guest Additions installed.
- **Auto-Login:** For guest control commands to work reliably, auto-login must be enabled on the guest.
- Also note that this project is currently support only Virtualbox.
## Example Configuration File
Below is an example `config.yaml` file:
```yaml
vm_manager: "virtualbox"
vms:
- alias: "vm/vbnecro_ubuntu2204"
vm_name: "vbnecro_ubuntu2204"
users:
- role: "user"
username: "vbnecro"
password: "pass12##"
- role: "root"
username: "root"
password: "pass12##"
jobs:
- vm_alias: "vm/vbnecro_ubuntu2204"
ensure_off: true
rollback_on_failure: "Setup004"
operations:
- type: "RestoreSnapshot"
params:
snapshot: "Setup004"
- type: "StartVM"
- type: "ExecuteShellCommand"
role: "user"
params:
command: "whoami"
store_as: "real_username"
print_output: false
- type: "ExecuteShellCommand"
role: "root"
params:
command: "cat"
args:
- "/etc/passwd"
store_as: "passwd_contents"
print_output: true
- type: "Wait"
params:
seconds: "10"
- type: "Assert"
params:
variable: "passwd_contents"
operator: "includes"
expected: "root:"
- type: "ShutdownVM"
```
## Usage
1. **Build the project:**
```bash
go build .
```
2. **Run vbnecro with your configuration:**
```bash
./vbnecro --config-path=./config.yaml
```