From 1d9659d5187010781652efd4a45c31d103f7c6e0 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Mon, 16 Sep 2024 00:31:57 +0200 Subject: [PATCH] Add Windows 11 VM --- scripts/vms/README.md | 3 +- scripts/vms/{windows => windows10}/README.md | 2 +- .../vms/{windows => windows10}/Vagrantfile | 2 +- scripts/vms/windows11/README.md | 49 +++++++++++++++++++ scripts/vms/windows11/Vagrantfile | 46 +++++++++++++++++ 5 files changed, 99 insertions(+), 3 deletions(-) rename scripts/vms/{windows => windows10}/README.md (99%) rename scripts/vms/{windows => windows10}/Vagrantfile (97%) create mode 100644 scripts/vms/windows11/README.md create mode 100644 scripts/vms/windows11/Vagrantfile diff --git a/scripts/vms/README.md b/scripts/vms/README.md index 5809913510d..a25e8b9d665 100644 --- a/scripts/vms/README.md +++ b/scripts/vms/README.md @@ -55,7 +55,8 @@ Then, everything is removed. | [`fedora`](fedora/) | source | -- | -- | -- | | [`Linux Mint (Cinnamon)`](linux-mint-cinnamon/) | source | Firefox | yes | -- | | [`ubuntu`](ubuntu/) | snap | Firefox | yes | -- | -| [`windows`](windows/) | source | Edge | -- | -- | +| [`windows 10`](windows10/) | source | Edge | -- | -- | +| [`windows 11`](windows11/) | source | Edge | -- | -- | ## Troubleshooting diff --git a/scripts/vms/windows/README.md b/scripts/vms/windows10/README.md similarity index 99% rename from scripts/vms/windows/README.md rename to scripts/vms/windows10/README.md index e0948951dd9..a9efe6fa563 100644 --- a/scripts/vms/windows/README.md +++ b/scripts/vms/windows10/README.md @@ -1,4 +1,4 @@ -# Windows VM +# Windows 10 VM A Windows-based VM to test JabRef. As user, you need to ensure to have the proper Windows license to use this VM. diff --git a/scripts/vms/windows/Vagrantfile b/scripts/vms/windows10/Vagrantfile similarity index 97% rename from scripts/vms/windows/Vagrantfile rename to scripts/vms/windows10/Vagrantfile index 21331b914af..8ccefd513a0 100644 --- a/scripts/vms/windows/Vagrantfile +++ b/scripts/vms/windows10/Vagrantfile @@ -1,7 +1,7 @@ # -*- mode: ruby -*- # vi: set ft=ruby : -NAME = "jabref-windows-sandbox" +NAME = "jabref-windows-10-sandbox" Vagrant.configure("2") do |config| config.vm.box = "gusztavvargadr/windows-10" diff --git a/scripts/vms/windows11/README.md b/scripts/vms/windows11/README.md new file mode 100644 index 00000000000..0a8e1f9a51f --- /dev/null +++ b/scripts/vms/windows11/README.md @@ -0,0 +1,49 @@ +# Windows 11 VM + +A Windows-based VM to test JabRef. +As user, you need to ensure to have the proper Windows license to use this VM. + +In case you have many CPU cores, you can adapt `vb.cpus` in `Vagrantfile` to a higher number. + +One has to install the [JabRef Browser Extension](https://addons.mozilla.org/en-US/firefox/addon/jabref/) manually. + +## Troubleshooting + +### "Waiting for machine to reboot..." + +In case Vagrant reports "Waiting for machine to reboot..." and nothing happens, one has to "power off" the machine, execute `vagrant destory`, and then run `vagrant up` again. + +### `fatal: early EOF` + +```console +jabref-windows-sandbox: Cloning into 'jabref'... +jabref-windows-sandbox: error: RPC failed; curl 92 HTTP/2 stream 5 was not closed cleanly: CANCEL (err 8) +jabref-windows-sandbox: error: 6846 bytes of body are still expected +jabref-windows-sandbox: fetch-pack: unexpected disconnect while reading sideband packet +jabref-windows-sandbox: fatal: early EOF +jabref-windows-sandbox: fatal: fetch-pack: invalid index-pack output +``` + +The `git clone` command did not work. + +Login, open `cmd` and then execute following commands: + +```cmd +git clone --recurse-submodules https://github.com/JabRef/jabref.git +cd jabref +gradlew run +``` + +## Background + +`Vagrantfile` is based on [SeisoLLC/windows-sandbox](https://github.com/SeisoLLC/windows-sandbox/tree/main). + +The most use image seems to be the [Windows 10 image by `gusztavvargadr`](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/windows-10). +List of all images at . + +[Chocolatey](https://chocolatey.org/) is used instead of [winget-cli](https://learn.microsoft.com/en-us/windows/package-manager/), because Chocolatey installation does not hit GitHub's rate limits during unattended installation. + +## Atlernatives + +- Atlernative Vagrant images: . +- [Windows Sandbox](https://learn.microsoft.com/en-us/windows/security/application-security/application-isolation/windows-sandbox/windows-sandbox-overview) diff --git a/scripts/vms/windows11/Vagrantfile b/scripts/vms/windows11/Vagrantfile new file mode 100644 index 00000000000..0d9cdf27c81 --- /dev/null +++ b/scripts/vms/windows11/Vagrantfile @@ -0,0 +1,46 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +NAME = "jabref-windows-11-sandbox" + +Vagrant.configure("2") do |config| + # config.vm.box = "Caden/windows-11-pro-jp-22h2-22621.1992" + config.vm.box = "stromweld/windows-11" + + config.vm.define NAME + config.vm.hostname = NAME + + config.vm.provider "virtualbox" do |vb| + vb.name = NAME + + vb.memory = 6000 + vb.cpus = 2 + + vb.customize ['modifyvm', :id, '--clipboard-mode', 'bidirectional'] + vb.gui = true + end + + config.vm.provision "shell", privileged: "true", powershell_elevated_interactive: "true", inline: <<-SHELL + # Install chocolatey + Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) + choco feature enable -n=allowGlobalConfirmation + + choco install libericajdk + choco install git.install -y --params "/GitAndUnixToolsOnPath /WindowsTerminal /WindowsTerminalProfile" + + # Required by AI functionaltiy + choco choco install vcredist140 + + # choco install firefox + # choco install libreoffice-fresh + SHELL + + config.vm.provision "shell", reboot: true + + config.vm.provision "shell", privileged: "false", inline: <<-SHELL + cd \\users\\vagrant + git clone --depth=1 --recurse-submodules https://github.com/JabRef/jabref.git + # cd jabref + # .\\gradlew jar + SHELL +end