Git Product home page Git Product logo

configsandbox's Introduction

ConfigSandbox

This README includes instructions and necessary scripts to set up a Vagrant environment with QEMU/KVM on Artix Linux with runit using a single command.

Quickstart

Run the following command in your terminal to set up the environment:

bash <(curl -s https://github.com/m-c-frank/configsandbox/raw/main/setup_all.sh)

Repository Directory Tree

configsandbox/
├── README.md
├── Vagrantfile
├── install.sh
├── run.sh
└── setup_all.sh

./configsandbox/install.sh

#!/bin/sh
# Exit on error
set -e
# Ensure the system is up to date
sudo pacman -Syu
# Install necessary packages
sudo pacman -S --needed vagrant qemu virt-manager dnsmasq virt-viewer bridge-utils openbsd-netcat
# Enable and start the required services
sudo ln -s /etc/runit/sv/libvirtd /run/runit/service/
sudo ln -s /etc/runit/sv/virtlogd /run/runit/service/
sudo ln -s /etc/runit/sv/virtlockd /run/runit/service/
# Add user to necessary groups
sudo usermod -aG libvirt,kvm $(whoami)
# Install Vagrant plugin for libvirt
vagrant plugin install vagrant-libvirt
# Reboot to apply group changes and ensure services are started
echo "Please reboot your computer before running 'run.sh'."

./configsandbox/run.sh

#!/bin/sh
# Exit on error
set -e
# Navigate to the directory containing Vagrantfile
cd "$(dirname "$0")"
# Initialize Vagrant with QEMU/KVM provider if Vagrantfile does not exist
if [ ! -f Vagrantfile ]; then
    vagrant init generic/arch
    sed -i '/config.vm.box = "generic\/arch"/a \ \ config.vm.provider :libvirt do |libvirt|\n    libvirt.graphics_type = "spice"\n    libvirt.video_type = "qxl"\n  end' Vagrantfile
fi
# Start the virtual machine
vagrant up --provider=libvirt
# SSH into the virtual machine
vagrant ssh

./configsandbox/setup_all.sh

#!/bin/sh
# Exit on error
set -e
# Define the repository URL
REPO_URL="https://github.com/m-c-frank/configsandbox"
# Clone the repository
git clone "$REPO_URL" configsandbox
# Change into the directory
cd configsandbox
# Run the installation script
chmod +x install.sh && ./install.sh
# Run the script to start the environment
chmod +x run.sh && ./run.sh

./configsandbox/Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "generic/arch"
  config.vm.provider :libvirt do |libvirt|
    libvirt.graphics_type = "spice"
    libvirt.video_type = "qxl"
  end
end

Note

  • Ensure that virtualization is enabled in your BIOS/UEFI settings.
  • You may need to log out and log back in or reboot for the group changes to take effect.
  • The install.sh script will prompt for a reboot. After rebooting, you will need to manually run run.sh to start the Vagrant environment.

configsandbox's People

Watchers

Martin Christoph Frank avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.