Camel/Inap: add missing sub-trees
[metze/wireshark/wip.git] / doc / README.vagrant
1 1. Introduction
2
3 Vagrant is a virtual machine management program that makes it trivial to build
4 and configure reproducible virtual machines. Wireshark's source code includes
5 a Vagrantfile which can be used to set up a complete Ubuntu development
6 environment in a virtual machine, including all necessary compilers, dependent
7 libraries, and tools like valgrind.
8
9 Using vagrant can greatly simplify the creation of a Linux build environment
10 for new developers, at the cost of running your builds in a virtual machine,
11 thus with reduced performance.
12
13 2. Installation
14
15 The Vagrantfile included in Wireshark's source directory is configured to use
16 VirtualBox as the backing virtual machine technology provider. You must first
17 install VirtualBox from https://www.virtualbox.org/.
18
19 Now install vagrant itself from https://www.vagrantup.com/.
20
21 Please note that vagrant is a CLI command and should typically be installed in
22 your host system's $PATH. To better understand what vagrant is doing you may
23 want to review vagrant's `Getting Started` web pages.
24
25 3. Setup
26
27 By default vagrant looks for the file name Vagrantfile in the current
28 directory. Wireshark's Vagrantfile is located in the root of the Wireshark
29 source folder.
30
31 Once both VirtualBox and vagrant are installed, setting up an Ubuntu Wireshark
32 development VM is as simple as running `vagrant up` followed by
33 `vagrant provision`.
34
35 The first time that the `vagrant up` command is executed vagrant will initiate
36 the download of a specific Ubuntu VM image (what they call a box) from
37 HashiCorp's Atlas box catalog. Once the box is downloaded an Unbuntu VM will
38 be instantiated and powered-on.
39
40 Use the command `vagrant status` to determine the state of the VM.
41
42 The command `vagrant provision` will run any provisioning tasks defined in the
43 Vagrantfile. Wireshark's Vagrantfile is configured to run two bash based
44 provisioning scripts, vagrant_provision.sh and vagrant_build.sh. These
45 provisoning scripts are executed on the Ubuntu VM system and not on the host
46 system.
47
48 The vagrant_provision.sh script initiates several apt-get tasks to get the
49 Ubuntu VM reasonably up to date. The vagrant_build.sh script sets up a cmake
50 build environment which includes creating a ~/build folder initialized for an
51 out-of-tree cmake build and then triggering a build.
52
53 4. Usage
54
55 Running `vagrant ssh` from the wireshark source directory will log you into
56 Ubuntu VM as the userid vagrant.
57
58 The Ubuntu VM's build folder is located in ~/build. The Ubuntu VM's source
59 folder is actually the source folder from the host system mounted as /vagrant.
60 Any changes made in the VM's /vagrant folder are reflected in the host system's
61 Wireshark source folder and visa-versa.
62
63 Once logged into the VM issue the command `cd ~/build` followed by `make` to
64 trigger a new wireshark build based on whatever is in your host system's source
65 tree (the Ubuntu VM's /vagrant folder).
66
67 The various Wireshark applications can be run from the ~/build folder of the
68 Ubuntu VM with commands such as `./run/wireshark`, `./run/tshark`, etc.
69
70 To run the Wireshark GUI you will typically need an X server. If you are using
71 macOS ({Mac} OS X) as the host system then you would likely use XQuartz as
72 your X server. XQuartz can be downloaded from https://www.xquartz.org/.
73
74 The Ubuntu VM can be shutdown or suspended from the host system with the
75 commands `vagrant halt` and `vagrant suspend` repectively. In either case the
76 Ubuntu VM can be brought back up with the command `vagrant up`.