User:Mainframe98/Vagrant on Windows

This guide attempts to list all the required steps to install MediaWiki-Vagrant on a windows machine.

Pre installation steps

edit
  1. Check if you meet the requirements:
    • Installed version of Windows is 64 bit
    • Hyper-V is disabled - Required to use VirtualBox, Hyper-V support might be unstable
    • Hardware Virtualization Technology (VT-x or AMD-V) in the BIOS is enabled and the computer supports Hardware Virtualization
  2. Download the software required

Installation

edit
  1. Install Vagrant and if downloaded Git and VirtualBox
    • If you want to use ssh from the windows command line, install Git using the Use Git and optional Unix tools from the Windows Command Prompt installation option when installing Git. This is not required, as you may use another ssh client like PuTTY instead.[1] Please do note that not using this installation option causes Vagrant to display an error about a missing ssh client. This message may be ignored.
  2. Clone https://gerrit.wikimedia.org/r/mediawiki/vagrant by using
    git clone --recursive https://gerrit.wikimedia.org/r/mediawiki/vagrant
    
    in your home directory/(My) Documents
    • SSH:
      git clone --recursive ssh://<USERNAME>@gerrit.wikimedia.org:29418/mediawiki/vagrant.git
      
    • Instead of using git clone, you can also just extract the zip file.
  3. Run setup.bat which is located in the newly cloned folder
    • You can also run setup.sh if you use a shell like Git Bash.
  4. Run vagrant hiera mediawiki::branch REL1_43, to specify the version (MediaWiki 1.43.0), omit statement entirely to use the master branch (1.45)
  5. Run Vagrant up

Connecting through ssh (when not using vagrant ssh)

edit

This example uses PuTTY.

  • Write down the ssh information about the vagrant virtual machine retrieved from running vagrant ssh-config
    • Example output:
Host default
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile C:/HashiCorp/Vagrant/mediawiki-vagrant/.vagrant/machines/default/virtualbox/private_key
IdentitiesOnly yes
LogLevel FATAL
ForwardX11 yes
  • Generate a private key file that can be read by PuTTY using PuTTY gen (Found on the same page as the PuTTY download)
    • Open PuTTY gen and load the private key file (IdentityFile, in the example above)
    • Export it by choosing "Save private key", and store it somewhere save.
  • Add the private key file by navigating in PuTTY to Connection, SSH, Auth. Click "Browse..." to load the generated file.

Errors

edit

Relevant information from running vagrant up, Cloning mediawiki/core fails, and other packages that use mediawiki as dependency fail as a result too.

==> default: Notice: /Stage[main]/Mediawiki/Git::Clone[mediawiki/core]/Exec[git_clone_mediawiki/core]/returns: Cloning into '/vagrant/mediawiki'...
==> default: Notice: /Stage[main]/Mediawiki/Git::Clone[mediawiki/core]/Exec[git_clone_mediawiki/core]/returns: error: RPC failed; result=56, HTTP code = 200
==> default: Notice: /Stage[main]/Mediawiki/Git::Clone[mediawiki/core]/Exec[git_clone_mediawiki/core]/returns: fatal: The remote end hung up unexpectedly
==> default: Notice: /Stage[main]/Mediawiki/Git::Clone[mediawiki/core]/Exec[git_clone_mediawiki/core]/returns: fatal: early EOF
==> default: Notice: /Stage[main]/Mediawiki/Git::Clone[mediawiki/core]/Exec[git_clone_mediawiki/core]/returns: fatal: index-pack failed
==> default: Error: /usr/bin/git clone --recurse-submodules  --branch 'REL1_27' https://gerrit.wikimedia.org/r/p/mediawiki/core.git /vagrant/mediawiki returned 128 instead of one of [0]
==> default: Error: /Stage[main]/Mediawiki/Git::Clone[mediawiki/core]/Exec[git_clone_mediawiki/core]/returns: change from notrun to 0 failed: /usr/bin/git clone --recurse-submodules  --branch 'REL1_27' https://gerrit.wikimedia.org/r/p/mediawiki/core.git /vagrant/mediawiki returned 128 instead of one of [0]
==> default: Notice: /Stage[main]/Mediawiki/Php::Composer::Install[/vagrant/mediawiki]/Exec[composer-install--vagrant-mediawiki]: Dependency Exec[git_clone_mediawiki/core] has failures: true

References

edit