Posts

Customizing the Amount Of RAM in Our Vagrant VMs

The Vagrant box that we pick will default to some amount of RAM. During our development, we’ll run into situations where we need to increase that amount. To do that we’re going to introduce a new section that’s specific to VirtualBox. We can then set the amount of RAM (in Megabytes) using the memory configuration setting.

Vagrant.configure("2") do |config|
  config.vm.box = "generic/ubuntu2004"

  config.vm.provider "virtualbox" do |vb|
    # Customize the amount of memory on the VM:
    vb.memory = "4096"
  end
end

The fun part about this setting is that because we’re configuring resources for a VM and not a physical device we can easily give it memory amounts that would be hard to get into a physical device. For example, we could give our VM 3GB of RAM.

Vagrant.configure("2") do |config|
  config.vm.box = "generic/ubuntu2004"

  config.vm.provider "virtualbox" do |vb|
    # Customize the amount of memory on the VM:
    vb.memory = "3072"
  end
end

Now if reload our VM and ssh into it we can check and see we now have 3 GB of RAM.

$ free -mh
              total        used        free      shared  buff/cache   available
Mem:          2.9Gi       452Mi       2.2Gi       3.0Mi       328Mi       2.3Gi
Swap:         1.9Gi          0B       1.9Gi

If you have questions related to vagrant or the PHP ecosystem in general you would like us to answer in future videos please ask them in the comments below.

Link Post and Podcast Roundup: April 2021 Edition

April’s links.

Read More

Better Know an Acronym: What is LAMP/MAMP/WAMP?

One of the hard parts about learning how to develop software is the minefield of acronyms that exists in the industry. The goal of this series of articles is to shine a light on an acronym so the next time another developer uses it in conversation you can follow along without missing a beat.

In this article, we’re going to be discussing the acronym LAMP. We’re picking this acronym because we’ve used it a couple of times in other articles and in doing so we have to use other acronyms which we’ll define in future articles. :-)

Read More

Creating a PHP 8 Development Environment Using Vagrant and Ubuntu 20.04

We’ve spent a lot of time discussing how to use Vagrant to create our development environment so now it’s time to bring everything we’ve learned together so we can finally develop some code.

Read More

Link Post and Podcast Roundup: March 2021 Edition

March’s links.

Read More

Syncing Files to Our Vagrant Development Environment

In the past, if we want to have files that were accessible by the VM but could also be edited in an editor on the host we would have to clone the project into our VM, set up a shared directory, and then map the share in our host computer. Thankfully Vagrant allows us to easily tap into a feature know as synced folders that make this process so much easier.

Read More

Remotely Accessing Our Vagrant Development Environment (Linux/Ubuntu)

Because the underlying technology Vagrant uses to create our development environment is the VM we can use the Secure Shell (or SSH) to administer our Unix based VMs. In this article, we’ll discuss how to use the built-in SSH tools of Vagrant.

Read More

Configuring Our Vagrant Development Environment's Network

Vagrant allows us several networking options for our development environments. In this article we’ll discuss making changes to our Vagrantfile to configure the networking.

Read More

How to Reset/Delete A Vagrant Development Environment

Now that we’ve learned how to manage the power state of our development environment we can discuss how we delete and reset our development environments using Vagrant commands.

Read More

Link Post and Podcast Roundup: February 2021 Edition

February’s links.

Read More
RSS

Join Our Mailing List!

View previous campaigns.

Top Posts

  1. Working With Soft Deletes in Laravel (By Example)
  2. Fixing CMake was unable to find a build program corresponding to "Unix Makefiles"
  3. Upgrading to Laravel 8.x
  4. Get The Count of the Number of Users in an AD Group
  5. Multiple Vagrant VMs in One Vagrantfile
  6. Fixing the "this is larger than GitHub's recommended maximum file size of 50.00 MB" error
  7. Changing the Directory Vagrant Stores the VMs In
  8. Accepting Android SDK Licenses From The OSX Command Line
  9. Fixing the 'Target class [config] does not exist' Error
  10. Using Rectangle to Manage MacOS Windows

subscribe via RSS

All content copyright This Programming Thing 2012 - 2021
Blogging about PHP, MySQL, Zend Framework, MySQL, Server Administration and Programming in general