When a FarmData2 Development Environment is run in GitHub Codespaces you will use your browser or a VNC client to connect to the Linux-based desktop.
If you are already familiar with Codespaces, running the FarmData2 Development Environment will be a different experience than what you are used to. Codespaces is used to run the containers that provide the Linux desktop based development environment used by FarmData2.
If you run into problems during the install visit the dedicated install channel on the FarmData2 Zulip chat. Use the search feature to see of others have had and solved the problem you are experiencing. If you do not find a solution, post a summary of your problem and the community will help.
Creating a new FarmData2 Development Environment in Codespaces will take about 10 minutes. When you restart an existing development environment it will be much faster.
Use the following steps to create a new FarmData2 Development Environment in Codespaces:
-
Log in to GitHub.
-
Create a (classic) Personal Access Token (PAT) in GitHub with the
repo,workflow,read:organdcodespacescopes selected. Set an expiration date that is appropriate for the work you plan to do. Be sure to copy and paste your token somewhere safe. You'll need it later and you cannot retrieve again after you leave the creation page. -
Visit the Codespace settings page. Scroll down and adjust the "Default Idle Timeout" setting. This is the amount of time the codespace will continue running if you are not interacting with the development environment. 15 minutes is a good balance that ensures the development environment is not shutdown too soon, but also does not waste your free usage.
-
Fork the upstream FarmData2 repository in GitHub.
-
Visit your fork of FarmDat2 in GitHub.
-
Click the "Codespaces" tab and then click the green button labeled "Create codespace on development."
-
The browser will display a small dialog box in the lower right corner indicating that the GitHub codespace is being built.
-
After about 5 minutes the browser window will change a couple of times and then display a page indicating that the FarmData2 Development Environment is loading.
-
After another 5-10 minutes the browser window will display a page giving information about connecting to the FarmData2 Development Environment.
-
Connect to the FarmData2 Development Environment in one of the following ways:
- Open in your Browser: This is the fastest and easiest way to connect, but has the limitation that you will not be able to copy and paste information directly between the FarmData2 Development Environment and your local machine.
- Click the link provided on the "The FarmData2 Development Environment" page in your browser under the "Open in your Browser" heading.
- The FarmData2 Development Environment will open in a new browser tab.
- Open on your Machine with VNC: If you will want to copy and paste information between the FarmData2 Development Environment and your local machine frequently, this is the best way to connect.
- Confirm that the following dependencies are installed on your machine:
- The
ghcommand line interface - The Tiger VNC Viewer
- For Windows, download and run the
vncviewer64.1.13.0.exefile. - For Mac, download and open the
TigerVNC.1.13.0.dmgfile and then copy the "TigerVNC Viewer" to your Applications folder. - Note: Newer versions of the Tiger VNC Viewer might work, but have not been tested.
- For Windows, download and run the
- The
- Follow the directions provided on the "The FarmData2 Development Environment" page in your browser under the "Open on your Machine with VNC" heading.
- Confirm that the following dependencies are installed on your machine:
- Open in your Browser: This is the fastest and easiest way to connect, but has the limitation that you will not be able to copy and paste information directly between the FarmData2 Development Environment and your local machine.
-
Follow the directions to Setup the FarmData2 Development Environment.
-
See the Working in the FarmData2 Development Environment document for more information about working in the FarmData2 Developer Environment in a browser or a VNC client.
In practice you can just close the development environment by closing its browser tab or VNC window. The development environment containers running on GitHib Codespaces will automatically stop after the idle timeout that you set earlier.
If you are close to, or have already, exhausted your free Codespaces time you might want to explicitly stop the FarmData2 codespace to avoid incurring charges until the idle timeout expires.
To explicitly stop the FarmData2 Development Environment in GitHub Codespaces:
- Log in to GitHub.
- Go to your Codespaces page.
- Scroll down to the entry your FarmData2 codespace.

- Click the meatballs menu (⋯) to the right side of the word "Active."
- Choose "Stop codespace" from the menu.
- Note: If your Codespaces page was open when you started the FarmData2 codespace you might need to reload the page to see the "Active" indicator and the "Stop codespaces" option.
The FarmData2 Development Environment will restart much faster after you have created the GitHub Codespace.
To restart the Development Environment:
- Log in to GitHub.
- Go to your Codespaces page.
- Scroll down to the entry your FarmData2 codespace.

- Click the meatballs menu (⋯) to the right side of the word "Active."
- Choose "Open in Browser" from the menu.
- Note: As a shortcut, you can also click the codespace name, for example "shinny waffle," that is displayed under the repository name.
