-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Hey, @Irrenium hope you are doing great here is a simple vagrant file to get you started with vagrant.
Make sure to save the code below to a file named Vagrantfile
# Spine up an Ubuntu 20.04 Box
# Script to update the box and write a hello message to user home dir
SCRIPT = <<EOF
#!/usr/bin/env bash
sudo apt-get update
sudo apt-get -y upgrade
echo "Hello from Vagrant" >> /home/vagrant/sample.txt
EOF
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/focal64"
# pass script to the shell provisioner as inline script
config.vm.provision :shell, :inline => SCRIPT, :privileged => false
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
vb.name = "ubuntu-20.04"
end
endAfter creating the file you can run (assuming you already installed vagrant) if you did not, please check this link
$ vagrant upAfter you get your prompt back, you can run this command to access the VM.
$ vagrant sshI have included a welcome message in your home dir, you can check it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels