Skip to content

Instantly share code, notes, and snippets.

@terassyi

terassyi/Vagrantfile

Last active Oct 21, 2020
Embed
What would you like to do?
Vagrant configuration of using xdp
#!/bin/bash
# install golang
wget https://golang.org/dl/go1.15.3.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.15.3.linux-amd64.tar.gz
rm -rf go1.15.3.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.profile
exec $SHELL -l
# go get github.com/iovisor/gobpf
#!/bin/bash
sudo apt update -y
sudo apt install -y bison build-essential cmake flex git libedit-dev \
libllvm7 llvm-7-dev libclang-7-dev python zlib1g-dev libelf-dev \
python3-distutils clang
git clone https://github.com/iovisor/bcc.git
mkdir bcc/build; cd bcc/build
cmake ..
make
sudo make install
cmake -DPYTHON_CMD=python3 .. # build python3 binding
pushd src/python/
make
sudo make install
popd
['vagrant-reload'].each do |plugin|
unless Vagrant.has_plugin?(plugin)
raise "Vagrant plugin #{plugin} is not installed!"
end
end
Vagrant.configure('2') do |config|
config.vm.box = "generic/ubuntu2004" # Ubuntu
config.vm.network "private_network", ip: "192.168.50.4"
# fix issues with slow dns https://www.virtualbox.org/ticket/13002
config.vm.provider :libvirt do |libvirt|
libvirt.connect_via_ssh = false
libvirt.memory = 1024
libvirt.cpus = 2
libvirt.nic_model_type = "e1000"
end
config.vm.synced_folder "./", "/home/vagrant/work"
config.vm.provision :shell, :privileged => true, :path => "setup.sh"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.