Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Debian VM (and improve other Vagrant files) #11664

Merged
merged 4 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions scripts/vms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,13 @@ Then, everything is removed.

## Available VMs

| VM | JabRef | Browser | LibreOffice |
|-------------------------------------------------|---------|---------|-------------|
| [`fedora`](fedora/) | source | -- | -- |
| [`Linux Mint (Cinnamon)`](linux-mint-cinnamon/) | source | Firefox | yes |
| [`ubuntu`](ubuntu/) | snap | Firefox | yes |
| [`windows`](windows/) | source | Edge | -- |
| VM | JabRef | Browser | LibreOffice | IntelliJ |
|-------------------------------------------------|---------|---------|-------------| --------- |
| [`Debian 12`](debian-12/) | source | Firefox | -- | yes |
| [`fedora`](fedora/) | source | -- | -- | -- |
| [`Linux Mint (Cinnamon)`](linux-mint-cinnamon/) | source | Firefox | yes | -- |
| [`ubuntu`](ubuntu/) | snap | Firefox | yes | -- |
| [`windows`](windows/) | source | Edge | -- | -- |

## Troubleshooting

Expand Down
21 changes: 21 additions & 0 deletions scripts/vms/debian-12/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Debian 12

Uses <https://github.com/alvistack/vagrant-debian>.

Reproducer for <https://github.com/JabRef/jabref/issues/10731#issuecomment-2302373288>.

Installs [Just Perfection GNOME Shell Extension](https://gitlab.gnome.org/jrahmatzadeh/just-perfection).

After `vagrant up`:

1. Terminate the VM.
2. Open settings of the VM.
3. Reconfigure the Virtual Box display to "VMSVGA", "Enable 3D Acceleration", use 32 MB of Video RAM.
4. Power on.
5. Log in.

Then, start JabRef by following steps:

1. Open termminal
2. `cd jabref`
3. `./gradlew run`
59 changes: 59 additions & 0 deletions scripts/vms/debian-12/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

NAME = "jabref-debian-12"

Vagrant.configure("2") do |config|

config.vm.box = "alvistack/debian-12"

config.vm.define NAME
config.vm.hostname = NAME

config.vm.provider "virtualbox" do |v|
v.name = NAME
v.gui = true
v.customize ["modifyvm", :id, "--memory", "2048", "--cpus", "2"]
end

config.vm.provision "shell", inline: <<-SHELL
sudo apt-get update
sudo apt-get -y upgrade

# enable building of the virtual box guest addons
# hint from https://forums.virtualbox.org/viewtopic.php?p=508680&sid=fe86fb0f6c03c7443f1fba9a5c29a861#p508680
# sudo apt install -y build-essential dkms

sudo apt-get install -y git

# sudo apt-get install -y task-cinnamon-desktop

# install IntelliJ Community Edition - source: https://snapcraft.io/install/intellij-idea-community/debian
sudo rm /etc/apt/preferences.d/nosnap.pref # source: https://stackoverflow.com/a/77235743/873282
sudo apt-get install -y snapd
sudo snap install snapd
sudo snap install intellij-idea-community --classic
SHELL

config.vm.provision "shell", privileged: false, inline: <<-SHELL
# Install "Just Perfection GNOME Shell Extension"
cd /tmp
wget https://extensions.gnome.org/extension-data/just-perfection-desktopjust-perfection.v26.shell-extension.zip -O shell-extension.zip
gnome-extensions install --force shell-extension.zip

# Install JDK, clone JabRef's source code, and do an initial build
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install java 21.0.4-tem < /dev/null

cd ~
git clone --recurse-submodules https://github.com/JabRef/jabref.git
cd jabref
sdk use java 21.0.4-tem
./gradlew jar
SHELL

config.vm.provision "shell", inline: "sudo reboot"

config.ssh.forward_x11 = true
end
32 changes: 18 additions & 14 deletions scripts/vms/fedora/Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

NAME = "jabref-fedora-39"

Vagrant.configure("2") do |config|

config.vm.box = "fedora/39-cloud-base"

config.vm.network :forwarded_port, guest: 80, host: 8080, auto_correct: true
config.vm.network :forwarded_port, guest: 9000, host: 9000, auto_correct: true
config.vm.network :forwarded_port, guest: 5000, host: 5000, auto_correct: true
config.vm.define NAME
config.vm.hostname = NAME

config.vm.provider "virtualbox" do |v|
v.name = "jabref-fedora"
v.name = NAME
v.gui = true
v.customize ["modifyvm", :id, "--memory", "4096", "--cpus", "2"]
end

config.vm.provision "shell", inline: "sudo dnf update -y"
config.vm.provision "shell", inline: "sudo dnf install -y @kde-desktop-environment"
config.vm.provision "shell", inline: <<-SHELL
sudo dnf update -y
sudo dnf install -y @kde-desktop-environment

# Following X11 packages are NOT required even the clipboard functionality seems to ask for (cf. https://github.com/JabRef/jabref/issues/11464)
# config.vm.provision "shell", inline: "sudo dnf install -y kwin-x11 plasma-workspace-x11"
# Following X11 packages are NOT required even the clipboard functionality seems to ask for (cf. https://github.com/JabRef/jabref/issues/11464)
# sudo dnf install -y kwin-x11 plasma-workspace-x11

# We need exactly the java version required by JabRef. Auto download does not work on Fedora.
config.vm.provision "shell", inline: "sudo dnf install -y git java-21-openjdk-devel.x86_64"
# We need exactly the java version required by JabRef. Auto download does not work on Fedora.
sudo dnf install -y git java-21-openjdk-devel.x86_64

config.vm.provision "shell", inline: "sudo systemctl set-default graphical.target"
sudo systemctl set-default graphical.target
SHELL

config.vm.provision "shell", inline: "git clone --recurse-submodules https://github.com/JabRef/jabref.git", privileged: false
config.vm.provision "shell", inline: "cd jabref && ./gradlew jar || true", privileged: false
config.vm.provision "shell", privileged:false, inline: <<-SHELL
git clone --recurse-submodules https://github.com/JabRef/jabref.git
cd jabref && ./gradlew jar || true
SHELL

# config.vm.provision "shell", inline: "sudo systemctl enable sddm"
config.vm.provision "shell", inline: "sudo reboot"

config.ssh.forward_x11 = true
Expand Down
10 changes: 5 additions & 5 deletions scripts/vms/linux-mint-cinnamon/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Linux Mint Cinnamon VM

[Linux Mint](https://linuxmint.com/) with JabRef snap and libreoffice-connection pre-installed.
[Linux Mint](https://linuxmint.com/) with JabRef sources.

Uses <https://app.vagrantup.com/archman/boxes/linuxmint/versions/22>.
Uses <https://portal.cloud.hashicorp.com/vagrant/discover/aaronvonawesome/linux-mint-21-cinnamon>.

Start JabRef by following steps:

- 1. Open termminal
- 2. `cd jabref`
- 3. `./gradlew run`
1. Open termminal
2. `cd jabref`
3. `./gradlew run`

## Alternatives

Expand Down
9 changes: 7 additions & 2 deletions scripts/vms/linux-mint-cinnamon/Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

NAME = "jabref-linux-mint-cinnamon"

Vagrant.configure("2") do |config|

# https://portal.cloud.hashicorp.com/vagrant/discover/aaronvonawesome/linux-mint-21-cinnamon
config.vm.box = "aaronvonawesome/linux-mint-21-cinnamon"
# config.vm.box = "archman/linuxmint" # v22

config.vm.network :forwarded_port, guest: 80, host: 8080, auto_correct: true
config.vm.define NAME
config.vm.hostname = NAME

config.vm.provider "virtualbox" do |v|
v.name = "jabref-linux-mint-cinnamon"
v.name = NAME
v.gui = true
v.customize ["modifyvm", :id, "--memory", "2048", "--cpus", "2"]
end
Expand Down Expand Up @@ -40,5 +43,7 @@ Vagrant.configure("2") do |config|
./gradlew jar
SHELL

config.vm.provision "shell", inline: "sudo reboot"

config.ssh.forward_x11 = true
end
11 changes: 6 additions & 5 deletions scripts/vms/ubuntu/Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

NAME = "jabref-ubuntu-24.04"

Vagrant.configure("2") do |config|

# config.vm.box = "ubuntu/trusty64"
Expand All @@ -12,18 +14,17 @@ Vagrant.configure("2") do |config|
# Here, the ubuntu-desktop works without usses
config.vm.box = "caspermeijn/ubuntu-desktop-24.04"

config.vm.network :forwarded_port, guest: 80, host: 8080, auto_correct: true
config.vm.network :forwarded_port, guest: 9000, host: 9000, auto_correct: true
config.vm.network :forwarded_port, guest: 5000, host: 5000, auto_correct: true

# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "C:/TEMP/JabRef", "/tmp/jabref"

config.vm.define NAME
config.vm.hostname = NAME

config.vm.provider "virtualbox" do |v|
v.name = "jabref-ubuntu"
v.name = NAME
v.gui = true
v.customize ["modifyvm", :id, "--memory", "2048", "--cpus", "2"]
end
Expand Down
7 changes: 3 additions & 4 deletions scripts/vms/windows/Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

NAME = "jabref-windows-sandbox"

Vagrant.configure("2") do |config|
config.vm.box = "gusztavvargadr/windows-10"
config.vm.box_url = "https://app.vagrantup.com/gusztavvargadr/boxes/windows-10"

config.vm.define NAME
config.vm.hostname = NAME

config.vm.provider "virtualbox" do |vb|
Expand Down Expand Up @@ -40,8 +43,4 @@ Vagrant.configure("2") do |config|
# cd jabref
# .\\gradlew jar
SHELL

# Used to set the Vagrant machine name
config.vm.define NAME do |t|
end
end