~bayindirh/vagrant-machines

309a3a23488d5dd7247e7edca8686671b25951e8 — Hakan Bayindir 8 months ago 1fbdf59 backintime-devel-machines
proj: Add buhtz’s BackInTime development machines.

- proj: Create a contrib file for contributed VMs.
- proj: Add buhtz’s BackInTime development VMs. Thanks!
- proj: Update .gitignore to ignore macOS specific files.
- docs: Update README.md.
A .gitignore => .gitignore +1 -0
@@ 0,0 1,1 @@
.DS_Store

M README.md => README.md +8 -0
@@ 3,6 3,8 @@ Contains commonly used Vagrant machine definitions to easily create VMs ready fo

Otherwise noted, all VMs have virtual networking IPs, run on VirtIO network cards and updates themselves to latest version of the OS automatically. For automatic installation of VirtualBox guest additions, please use `vagrant-vbguest` plugin.

Virtual Machines in `contrib` folder are generously contributed to this repository by others. Machines are vetted, but not thoroughly tested. *Please read `Vagrantfile`s before running them*.

Currently contains the following VMs:

- **debian-xfce-development:** Debian Jessie 64bit which updates itself and installs `task-xfce-desktop` metapackage. Suited for working on XFCE desktop components or as a general purpose VM.


@@ 29,6 31,10 @@ Currently contains the following VMs:
    - **Note:** `requirements.txt` file under `files/` folder is unused (it appears verbatim inside `Vagrantfile`) during build, but it's kept for reference purposes, since the exact versions are necessary for correct builds.
- **debian12-maven:** Debian Bookworm 64bit which updates itself and installs Maven, to be able to build Java projects.

The `contrib` folder contains the following  VMs:
- **contrib/debian12-backintime-dev:** Debian Bookworm 64bit which updates itself, installs XFCE desktop and clones BackInTime from its [official git repository](https://github.com/bit-team/backintime.git). Designed for general BackInTime development. Machine has four processors and 4GBs of RAM, with 128MB of VRAM.
- **contrib/debian12-backintime-qt6:** Debian Bookworm 64bit which updates itself, installs XFCE desktop and clones BackInTime from its [buhtz's git repository](https://github.com/buhtz/backintime.git). Designed for BackInTime Qt6 migration effort. Machine has four processors and 4GBs of RAM, with 128MB of VRAM.

## Private IP List
Following list contains the Private IP addresses of the host-only networking interfaces of the machines:



@@ 56,3 62,5 @@ Following list contains the Private IP addresses of the host-only networking int
- **debian12-backintime-lab:** `192.168.56.75`
- **debian-sphinx-builder:** `192.168.56.74`
- **debian12-maven:** `192.168.56.73`
- **contrib/debian12-backintime-dev:** `192.168.56.72`
- **contrib/debian12-backintime-qt6:** `192.168.56.71`

A contrib/debian12-backintime-dev/Vagrantfile => contrib/debian12-backintime-dev/Vagrantfile +87 -0
@@ 0,0 1,87 @@
# -*- 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.72"
  # 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 \
      task-xfce-desktop libreoffice-*- firefox-esr- xsane- synaptic- yelp- parole- \
      build-essential linux-headers-amd64 \
      vim git \
      gettext python3-packaging python3-pyqt5 python3-dbus python3-dbus.mainloop.pyqt5 \
      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

A contrib/debian12-backintime-qt6/Vagrantfile => contrib/debian12-backintime-qt6/Vagrantfile +87 -0
@@ 0,0 1,87 @@
# -*- 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.71"
  # 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 \
      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 --branch qt6migration https://github.com/buhtz/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 BiT/Qt6 lab is rebooting now and will be ready in a moment."
end