Skip to content

maikelthedev/libvirtd_automation

Repository files navigation

Libvirtd Automation

Some assumptions

  1. You have Fish shell
  2. You use Nixos
  3. Your system has all dependencies required for these fish functions
  4. You have something along these lines on your ~/.ssh/config file
Host *
  IdentityFile ~/.ssh/somekey.pub

Notice in my case it points to a public key as my private ones are in Bitwarden and I use Bitwarden SSH Agent which changes any reference to a public key for its private one. If yours point to a public one (e.g.: same without .pub) then replace in fish_functions/clone_user_data the next lines

# Change this line
  set PUBKEY (cat $PUBKEYFILE)
  
# For this line
  set PUBKEY (cat $PUBKEYFILE.pub)

How to prepare

# Clone it in a ~/vms folder
git clone git@github.com:maikelthedev/libvirtd_automation.git ~/vms
cd ~/vms 

# Clone the large files with git lfs
git lfs pull

# Uncompress the .xz image
xz -dk freebsd14-cloud-init-zfs.qcow2.xz

# Append to ~/.config/fish/config.fish
set -g fish_function_path $fish_function_path ~/vms/fish_functions

How to use

On a fresh Fish session so it loads the functions

# Create the in_use folder, just once. 
mkdir $HOME/vms/in_use

# Clone user-data
clone_user_data NAME_OF_VM

# Edit the file
vi $HOME/vms/in_use/NAME_OF_VM/NAME_OF_VM-user-data.yaml

# Create the VM
create_the_vm NAME_OF_VM

That's it

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages