Skip to content

Instantly share code, notes, and snippets.

# default name of box is 'default'
# to change this use:
# specify the name by defining inside the VagrantFile and
# also specify the hostname so i enjoy seeing the name of my project while executing Linux commands independently from my device's OS. ✌️
config.vm.define "abc"
config.vm.hostname = "abc"
# -*- mode: ruby -*-
# vi: set ft=ruby :
# sudo virsh net-list --all
# sudo virsh net-dumpxml $NETWORK_NAME
# sudo virsh list --all
# add your own ssh key to be able to checkout github submodules/private repos
vm_script = <<-SCRIPT
# ref
read: https://github.com/vagrant-libvirt/vagrant-libvirt
install: https://fedoramagazine.org/vagrant-qemukvm-fedora-devops-sysadmin/
nested: https://adrianriobo.github.io/virtualization/testing/environment/2020/10/13/vagrant-nested-virtualization.html
$ cat Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# sudo virsh net-list --all
# ref
# https://computingforgeeks.com/how-to-install-virtualbox-on-fedora-linux/
# tweak below for Mac OS X
# https://stefanwrobel.com/how-to-make-vagrant-performance-not-suck
# vagrantfile
```shell
testbox_script = <<-SHELL
#!/bin/bash
set -euxo pipefail
# ref: https://fedoramagazine.org/vagrant-qemukvm-fedora-devops-sysadmin/
# install
```shell
sudo dnf install qemu-kvm libvirt libguestfs-tools virt-install rsync
or
$ sudo dnf install vagrant-libvirt
$ sudo dnf install @vagrant
@smijar
smijar / K3s multi-node cluster with Vagrant
Last active October 19, 2022 15:32
Vagrant helper script for standing up the server and then the agent nodes
# Name:./up.sh
#!/bin/bash
# name this up.sh
set -euxo pipefail
# first, bring up the server
vagrant up server
sleep 10
@smijar
smijar / Vagrantfile-vbox-fedora-cloud-dev-tools
Last active March 13, 2022 01:38
Vagrant Fedora box with docker, vagrant/libvirtd provider, k3s, kind, minikube, java, maven, pyenv, golang
#-------------------------------------------------------------
# Fedora34 based Vagrant box
# --------------------------
# This is a Vagrantfile that installs azure, aws, gcloud CLIs
# along with pyenv, sdkman (for java), golang, nodejs
# minikube, kind, k3s
#-------------------------------------------------------------
vm_script = <<-SHELL
# sudo -i
# echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.conf
@smijar
smijar / Makefile-k3s
Last active April 20, 2021 19:22
Makefile for simplified k3s deploy on local
create_dev_cluster:
k3d create --name dev --api-port 6443 --publish 8081:80 --workers 2
# add the metrics-server
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.4.2/components.yaml
list:
k3d list
switch_dev:
@smijar
smijar / dir-path-ubuntu-wsl2.txt
Created May 29, 2020 17:17
directory path for wsl2 ubuntu
dir \\wsl$\Ubuntu
@smijar
smijar / wsl2-cfg-ubuntu.json
Created May 29, 2020 17:12
wsl2 config for ubuntu
// from: https://wespeter.com/posts/how-to-set-windows-terminal-starting-directory/
// add a starting folder for wsl2 working directory, so that it loads .bash_profile and .bashrc properly
// rather than starting in the windows home folder
// This file was initially generated by Windows Terminal 0.11.1333.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.