blob: dd259034015f43cd304f80608824c1faab7783e3 [file] [log] [blame] [view]
awlane58a83f62025-05-23 09:44:33 -05001# Mini-NDN in [VirtualBox](https://www.virtualbox.org/) using [vagrant](https://www.vagrantup.com/)
dulalsaurab8c8e6332021-05-21 20:37:03 +00002
3### [RECOMMENDED] Mini-NDN Vagrant Box
4
awlane58a83f62025-05-23 09:44:33 -05005We provide a Vagrant box with Mini-NDN pre-installed. The box can be found
6[here](https://portal.cloud.hashicorp.com/vagrant/discover/netlab-memphis-minindn).
7For suggested Mini-NDN resource allocation, here's an example [`Vagrantfile`](Vagrantfile) using VirtualBox:
dulalsaurab8c8e6332021-05-21 20:37:03 +00008```ruby
dulalsaurab8c8e6332021-05-21 20:37:03 +00009Vagrant.configure("2") do |config|
awlane58a83f62025-05-23 09:44:33 -050010 config.vm.box = "netlab-memphis-minindn/minindn-0.7.0"
dulalsaurab8c8e6332021-05-21 20:37:03 +000011 config.vm.provider "virtualbox" do |vb|
12 vb.memory = "4096"
13 vb.cpus = "4"
14 vb.name = "mini-ndn-box"
15 end
16end
17```
18----
19
awlane58a83f62025-05-23 09:44:33 -050020For those on ARM64 MacOS devices, you can instead use our provided VMWare image.
21You will need the [Vagrant VMWare Utility](https://developer.hashicorp.com/vagrant/docs/providers/vmware/installation)
22installed. You can then initialize the Vagrant box using `vagrant up --provider vmware_desktop`
23
24This provider is not as well supported and may encounter minor issues.
25
26```ruby
27Vagrant.configure("2") do |config|
28 config.vm.box = "netlab-memphis-minindn/minindn-0.7.0"
29 config.vm.provider "vmware_desktop" do |vb|
30 vb.memory = "4096"
31 vb.cpus = "4"
32 end
33end
34```
35----
36
dulalsaurab8c8e6332021-05-21 20:37:03 +000037### [NOT RECOMMENDED] Building from scratch with `vagrant` and VirtualBox containing Mini-NDN
38
39* Download and install VirtualBox and Vagrant
40 * https://www.vagrantup.com/downloads
41 * https://www.virtualbox.org/wiki/Downloads
42* To create and start fresh virtual machine:
43 * Create a file called "Vagrantfile" with this basic setup:
44 ```ruby
dulalsaurab8c8e6332021-05-21 20:37:03 +000045 Vagrant.configure("2") do |config|
awlane58a83f62025-05-23 09:44:33 -050046 config.vm.box = "bento/ubuntu-22.04"
dulalsaurab8c8e6332021-05-21 20:37:03 +000047 config.disksize.size = '40GB'
48 config.vm.provider "virtualbox" do |vb|
49 vb.memory = 4096
50 vb.cpus = 4
51 vb.name = "mini-ndn-box"
52 end
53 end
54 ```
55 * Open your terminal or command line in the directory that has Vagrantfile
56 * Start the virtual machine with,
57 `$ vagrant up`
58 * (If required) The username/password for the vm are both `vagrant`.
59
60* To install Mini-NDN, use the following commands:
61 ```bash
62 git clone https://github.com/named-data/mini-ndn.git
63 cd mini-ndn
awlane58a83f62025-05-23 09:44:33 -050064 ./install.sh
dulalsaurab8c8e6332021-05-21 20:37:03 +000065 ```
66* To test mini-ndn:
67 * while still in the `mini-ndn` directory, enter
68 ```bash
69 sudo python examples/mnndn.py
70 ```
71 * If it worked, You will see the Mini-NDN CLI. Enter `exit` to close the CLI.
72
awlane58a83f62025-05-23 09:44:33 -050073(Recommended steps for distribution)
dulalsaurab8c8e6332021-05-21 20:37:03 +000074* To clean and export vm as Vagrant Box:
75 * while in vm, enter these to clean:
76 ```bash
77 cd
78 sudo apt-get clean
79 sudo dd if=/dev/zero of=/EMPTY bs=1M
80 sudo rm -f /EMPTY
81 cat /dev/null > ~/.bash_history && history -c && exit
82 ```
83 * Close the vm window and open a terminal in the same directory as the `Vagrantfile`.
84 * In the terminal, type this command where `vb_name` is the name of the vm defined in `Vagrantfile`, and `box_name` any name for the output `.box` file
85 ```bash
86 vagrant package --base vb_name --output box_name.box
awlane58a83f62025-05-23 09:44:33 -050087 ```