Skip to content

Latest commit

 

History

History
83 lines (60 loc) · 4.01 KB

Multipass.md

File metadata and controls

83 lines (60 loc) · 4.01 KB

Multipass Guide

Creating a development environment in Multipass

Multipass is an alternative to Vagrant+Virtual Box. Like Vagrant, it uses virtualization providers.

Multipass creates an Ubuntu-based virtual machine. VM creation is automated with VM image and software provision.

Multipass is suggested for workstations that run macOS on Apple silicon processors, because Vagrant support for this architecture is poor at the time of this writing (Nov.2023)

This method has been tested successfully on a Mac with M1 processor.

Multipass is also available for Windows and Linux.

I. Development environment description

  • Operating system: Ubuntu Bionic (18.04)
  • Database: MySQL 5.x
  • Nodejs: 16.x (Used to install handlebars for template processing)
  • Java: 11 Openjdk
  • Python: 3.7.5 (with virtualenv)
  • Apache Tomcat: 8.x
  • Nginx: Latest available for the given ubuntu version

Virtual Machine specs

  • CPUs: 2
  • RAM: 3G
  • Disk: 20GB

The VM will take the above from your normal OS resources, for its own use. These specs can be changed in the fcw-multipass.sh script.

II. Installation of Multipass and FCW files on macOS

  1. Suggest having all tools pre-installed (git, brew, command line tools, etc.)
  2. Install Multipass and run the app.
  3. Turn off VPN or other virtualized network layers before creating your VM. Note: Multipass can trip on known network issues (e.g., when using a VPN). Please find the troubleshooting guide here: https://multipass.run/docs/troubleshoot-networking#heading--troubleshoot-networking-on-macos
  4. Create a working FCW folder that will hold all FCW files. Go to that folder in the Terminal app.
  5. Clone the repository git clone https://github.com/Lexxie9952/fcw.org-server.git . SEE NOTE BELOW or, for gitlab (git clone [email protected]:fcw2/freeciv-web.git .)

Note: In Nov.2023, the dev branch has the current state of the freeciv-web.org server. Note 2: Look in README for updated/current notes on the git clone step.

III. Virtual environment setup

  1. Change to the directory of your source code.
  2. Execute the script fcw-multipass.sh
  3. Execute multipass list and make note of the IP address of the fcw VM.

You should now have a virtual machine instance of freeciv-web with the software mentioned on the Development environment description.

IV. Start and use Freeciv-web application

  1. Open a terminal to multipass VM: multipass shell fcw
  2. ~/multipass-entrypoint.sh start to boot/prepare FCW for use.
  3. Open http://<ip address>/ on your browser, using the IP address from III.3.

You should see the FCW home page served by the local server running inside your fcw multipass VM.

Common multipass commands to interact with the VM from outside of the VM.

  • multipass shell fcw Open an "ssh" terminal into the multipass VM.
  • multipass stop fcw Stop the multipass VM
  • multipass start fcw Start the multipass VM
  • multipass info fcw Get information about the VM (including it's ip address it is needed in order to connect to the application via a web browser)
  • multipass list List all multipass VM instances and their ip addresses.
  • multipass delete instance Delete the VM with the name instance
  • multipass purge Destroy and clean up all deleted instances.

Other commands from inside the VM:

  • To destroy the VM:./fcw-multipass.sh destroy
  • Stop FCW ~/multipass-entrypoint.sh stop

Advanced

To externally access internal directories in the VM from within macOS, you can copy between them and work on a clone:

  1. Example. Make a copy of an internal dir into your main OS directory tree: multipass transfer -r -p fcw:/var/lib/tomcat8/webapps ~/FCW/tomcat_webapps
  2. After making edits, copy dir back into the VM instance: multipass transfer -r -p ~/FCW/tomcat_webapps fcw:/var/lib/tomcat8/webapps