Skip to content

Instantly share code, notes, and snippets.

@emtiu
Last active July 28, 2024 20:07
Show Gist options
  • Save emtiu/4b28bf7b80277b9b14851a78a703610f to your computer and use it in GitHub Desktop.
Save emtiu/4b28bf7b80277b9b14851a78a703610f to your computer and use it in GitHub Desktop.
Vagrantfile for backintime-dev testing on Debian 12
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
config.vm.box = "debian/bookworm64"
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.hostname = "d12bit"
config.vm.network "private_network", ip: "192.168.56.75"
# config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.provider "virtualbox" do |vb|
vb.memory = 4096
vb.cpus = 4
# Display the VirtualBox GUI when booting the machine
vb.gui = true
# Increase the Video RAM to 128MB to allow bigger desktops:
vb.customize ["modifyvm", :id, "--vram", "128"]
# Change the network cards to VirtIO for better performance:
# Two network cards since I also have a host-only network.
vb.customize ["modifyvm", :id, '--nictype1', 'virtio']
vb.customize ["modifyvm", :id, '--nictype2', 'virtio']
# Enable USB 2.0 controllers on the VM
vb.customize ['modifyvm', :id, '--usbehci', 'on']
end
config.vm.provision "shell", env: {"DEBIAN_FRONTEND" => "noninteractive"}, inline: <<-SHELL
apt-get update
apt-get --yes dist-upgrade
apt-get install --yes \
aptitude ntpdate \
task-xfce-desktop libreoffice-*- firefox-esr- xsane- synaptic- yelp- parole- \
build-essential linux-headers-amd64 \
vim git \
gettext python3-packaging python3-pyqt6 python3-dbus python3-dbus.mainloop.pyqt6 \
libnotify-bin python3-keyring python3-secretstorage python3-pyfakefs policykit-1 \
rsync sshfs encfs meld oxygen-icon-theme \
at-spi2-core \
fakeroot debhelper dh-python
# Downloading and installing things have ended, clean the downloaded packages.
apt-get clean
cat > /etc/lightdm/lightdm.conf <<EOF
[SeatDefaults]
autologin-user=vagrant
autologin-user-timeout=0
EOF
su vagrant -c "mkdir ~/Desktop"
su vagrant -c "git -C ~/Desktop clone https://github.com/bit-team/backintime.git"
su vagrant -c "mkdir -p ~/backups/backintime/d12bit/vagrant/1"
su vagrant -c "mkdir -p ~/.config/backintime"
su vagrant -c "cat > ~/.config/backintime/config <<EOF
config.version=6
profile1.schedule.mode=0
profile1.snapshots.include.1.type=0
profile1.snapshots.include.1.value=/home/vagrant/Desktop
profile1.snapshots.include.size=1
profile1.snapshots.path=/home/vagrant/backups
profile1.snapshots.path.host=d12bit
profile1.snapshots.path.profile=1
profile1.snapshots.path.user=vagrant
EOF"
su vagrant -c "cd ~/Desktop/backintime/common; ./configure"
su vagrant -c "cd ~/Desktop/backintime/common; make"
cd ~vagrant/Desktop/backintime/common; make install
su vagrant -c "cd ~/Desktop/backintime/qt; ./configure"
su vagrant -c "cd ~/Desktop/backintime/qt; make"
cd ~vagrant/Desktop/backintime/qt; make install
su vagrant -c "cd ~/Desktop/; ln -s /usr/share/applications/backintime-qt.desktop"
# Do a reboot to set up XFCE and launch it
reboot
SHELL
config.vm.post_up_message = "Your Debian 12 (Bookworm / Testing) Back in Time lab is rebooting now and will be ready in a moment."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment