Skip to content

Commit eaa1623

Browse files
authored
chore: add arm support to vagrant (#95)
Signed-off-by: Dominik Rosiek <[email protected]>
1 parent 03d7e05 commit eaa1623

File tree

3 files changed

+38
-13
lines changed

3 files changed

+38
-13
lines changed

Vagrantfile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
# -*- mode: ruby -*-
22
# vi: set ft=ruby :
33

4-
unless Vagrant.has_plugin?("vagrant-disksize")
5-
puts "vagrant-disksize plugin unavailable\n" +
6-
"please install it via 'vagrant plugin install vagrant-disksize'"
7-
exit 1
8-
end
9-
104
Vagrant.configure('2') do |config|
115
config.vm.box = 'ubuntu/focal64'
12-
config.disksize.size = '50GB'
6+
config.vm.disk :disk, size: "50GB", primary: true
137
config.vm.box_check_update = false
148
config.vm.host_name = 'fluentd-output-sumologic'
159
# Vbox 6.1.28+ restricts host-only adapters to 192.168.56.0/21
@@ -23,6 +17,14 @@ Vagrant.configure('2') do |config|
2317
vb.name = 'fluentd-output-sumologic'
2418
end
2519

20+
config.vm.provider "qemu" do |qe, override|
21+
override.vm.box = "perk/ubuntu-2204-arm64"
22+
qe.gui = false
23+
qe.smp = 8
24+
qe.memory = 16384
25+
qe.name = 'fluentd-output-sumologic'
26+
end
27+
2628
config.vm.provision 'shell', path: 'vagrant/provision.sh'
2729

2830
config.vm.synced_folder ".", "/sumologic"

vagrant/README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,29 @@
55
Please install the following:
66

77
- [VirtualBox](https://www.virtualbox.org/)
8-
- [Vagrant](https://www.vagrantup.com/)
9-
- [vagrant-disksize](https://github.com/sprotheroe/vagrant-disksize) plugin
8+
- [Vagrant](https://developer.hashicorp.com/vagrant/downloads)
9+
10+
### General
11+
12+
1. Install `vagrant` as per <https://developer.hashicorp.com/vagrant/downloads>
13+
2. Configure a provider
14+
3. Run `vagrant up` and then `vagrant ssh`
1015

1116
### MacOS
1217

1318
```bash
1419
brew cask install virtualbox
1520
brew cask install vagrant
16-
vagrant plugin install vagrant-disksize
1721
```
1822

23+
### ARM hosts (Apple M1, and so on)
24+
25+
You'll need to use QEMU instead of VirtualBox to use Vagrant on ARM. The following instructions will assume an M1 Mac as the host:
26+
27+
1. Install QEMU: `brew install qemu`
28+
2. Install the QEMU vagrant provider: `vagrant plugin install vagrant-qemu`
29+
3. Provision the VM with the provider: `vagrant up --provider=qemu`
30+
1931
## Setting up
2032

2133
You can set up the Vagrant environment with just one command:

vagrant/provision.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
set -x
44

55
export DEBIAN_FRONTEND=noninteractive
6+
ARCH="$(dpkg --print-architecture)"
7+
68
apt-get update
79
apt-get --yes upgrade
810
apt-get --yes install apt-transport-https
@@ -12,7 +14,7 @@ echo "export EDITOR=vim" >> /home/vagrant/.bashrc
1214
# Install docker
1315
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
1416
add-apt-repository \
15-
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
17+
"deb [arch=${ARCH}] https://download.docker.com/linux/ubuntu \
1618
$(lsb_release -cs) \
1719
stable"
1820
apt-get install -y docker-ce docker-ce-cli containerd.io
@@ -22,5 +24,14 @@ usermod -aG docker vagrant
2224
apt-get install -y make
2325

2426
# install requirements for ruby
25-
snap install ruby --channel=3.3/stable --classic
26-
apt install -y gcc g++ libsnappy-dev libicu-dev zlib1g-dev cmake pkg-config libssl-dev
27+
apt install -y \
28+
gcc \
29+
g++ \
30+
libsnappy-dev \
31+
libicu-dev \
32+
zlib1g-dev \
33+
cmake \
34+
pkg-config \
35+
libssl-dev \
36+
ruby-dev \
37+
ruby-bundler

0 commit comments

Comments
 (0)