Skip to content

Commit

Permalink
Update vagrant/install.sh, vagrant/README.md and vagrant/Vagrantfile …
Browse files Browse the repository at this point in the history
…to add support for nextcloud current release. Update readme to make it easier to set up your local dev environment. (#2707)

Signed-off-by: Sami Nieminen <[email protected]>
  • Loading branch information
celeroncool authored Dec 4, 2024
1 parent 0c34400 commit 2aeaa93
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 13 deletions.
32 changes: 30 additions & 2 deletions vagrant/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,37 @@
# Nextcloud VM with vagrant
This subrepo contains all the Vagrant config to get an Ubuntu 20.04 VM with the latest version of Nextcloud installed.
This subrepo contains all the Vagrant config to get an Ubuntu 24.04 VM with the latest version of Nextcloud installed.

**Please note that this is __not__ the preferred way to install Nextcloud. It's also untested in the current state.**

# Setup

## Host setup
Running this cloud image requires you to use libvirt.
Tested working on stock Ubuntu 22.04 LTS

1. Install `qemu-kvm`, `libvirt-daemon-system`, `bridge-utils`, `libvirt-dev` and `libvirt-clients` packages-

Then install the vagrant libvirt plugin: `vagrant plugin install vagrant-libvirt`

Then we need to make sure nested virtualization is initialized, as Nextcloud VM uses QEMU to run apps etc:

Check that nested virtualization is enabled:
Intel systems: `cat /sys/module/kvm_intel/parameters/nested`
AMD systems: `/sys/module/kvm_amd/parameters/nested`

Must return Y or 1.

Following must be done after each reboot:
**Intel setup**
sudo modprobe -r kvm_intel
sudo modprobe kvm_intel nested=1

**AMD setup**
sudo modprobe -r kvm_amd
sudo modprobe kvm_amd nested=1


## VM Setup
`vagrant up` will install everything

Go to [https://localhost:8080/](https://localhost:8080/) and access Nextcloud with credentials `ncadmin / nextcloud`
Expand All @@ -18,4 +46,4 @@ See https://raw.githubusercontent.com/nextcloud/vm/main/lib.sh for default value

# Special thanks to
@gjgd for providing https://github.com/gjgd/vagrant-nextcloud which this is based upon

@celeroncool for updating it to 24.04 :)
15 changes: 8 additions & 7 deletions vagrant/Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/focal64"
config.vm.network "forwarded_port", guest: 443, host: 8080
config.vagrant.plugins = "vagrant-libvirt"
config.vm.box = "cloud-image/ubuntu-24.04"
config.vm.network "forwarded_port", guest: 443, host: 8081
config.vm.provision "shell", path: "install.sh"
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
end
config.vm.provider "vmware_desktop" do |v|
v.vmx["memsize"] = "2048"
config.vm.provider "libvirt" do |libvirt|
libvirt.memory = 4096
libvirt.cpus = 4
libvirt.nested = true
libvirt.cpu_mode = "host-model"
end
end
6 changes: 2 additions & 4 deletions vagrant/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

true
SCRIPT_NAME="Install NcVM with Vagrant"
# shellcheck source=lib.sh
source /var/scripts/fetch_lib.sh

check_command git clone https://github.com/nextcloud/vm.git
git clone https://github.com/nextcloud/vm.git

cd vm || exit && print_text_in_color "$IRed" "Could not cd into the 'vm' folder."
cd vm

sudo bash nextcloud_install_production.sh --provisioning

0 comments on commit 2aeaa93

Please sign in to comment.