-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.html
187 lines (175 loc) · 14.1 KB
/
build.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Build the VM from source — An Open Virtual Machine for Cross-Platform Weather Radar Science</title>
<link rel="stylesheet" href="_static/agogo.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Share data between guest and host" href="sharedir.html" />
<link rel="prev" title="Downloads" href="downloads.html" />
</head><body>
<div class="header-wrapper" role="banner">
<div class="header">
<div class="headertitle"><a
href="index.html">An Open Virtual Machine for Cross-Platform Weather Radar Science</a></div>
<div class="rel" role="navigation" aria-label="related navigation">
<a href="downloads.html" title="Downloads"
accesskey="P">previous</a> |
<a href="sharedir.html" title="Share data between guest and host"
accesskey="N">next</a>
</div>
</div>
</div>
<div class="content-wrapper">
<div class="content">
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="build-the-vm-from-source">
<h1>Build the VM from source<a class="headerlink" href="#build-the-vm-from-source" title="Permalink to this headline">¶</a></h1>
<p>Building VM has been tested on Ubuntu, Mac OS X, and Windows 7 hosts,
running various vagrant and VirtualBox versions. Other host should
be supported as well. The most recent setup was using vagrant 1.9.6 and VirtualBox 5.1.</p>
<p>Recently, the guest OS (i.e. the OS on the VM) was changed from Ubuntu 12.04 (trusty) to Debian 9 (Stretch).</p>
<div class="section" id="requirements">
<h2>Requirements<a class="headerlink" href="#requirements" title="Permalink to this headline">¶</a></h2>
<p>To build and run this VM you need to install
<a class="reference external" href="https://www.virtualbox.org/">VirtualBox</a> and <a class="reference external" href="http://www.vagrantup.com/">vagrant</a>.</p>
<p>Download the source <a class="reference external" href="https://github.com/openradar/oss_weather_radar_vm/archive/master.zip">here</a>.</p>
</div>
<div class="section" id="building">
<h2>Building<a class="headerlink" href="#building" title="Permalink to this headline">¶</a></h2>
<p>After unpacking the source, create the VM using the command <code class="docutils literal notranslate"><span class="pre">vagrant</span> <span class="pre">up</span></code>.</p>
<p>Note that the base box and other software is
downloaded when the VM is created which may take a
significant amount of time depending on connection speed.
The base box and software packages are cached locally so that
subsequent uses of <code class="docutils literal notranslate"><span class="pre">vagrant</span> <span class="pre">up</span></code> should complete much quicker
(typically ~10 minutes).</p>
<p>Afterwards, the VM can be accessed from the host machine using the command
<cite>vagrant ssh</cite>. Launching VirtualBox will show the VM running.</p>
<p>An IPython/jupyter notebook server can be run from the VM which is
accessible from the host machine. Use the command <code class="docutils literal notranslate"><span class="pre">vagrant</span> <span class="pre">ssh</span></code>
to ssh into the running VM. For login, use <code class="docutils literal notranslate"><span class="pre">vagrant</span></code> with password <code class="docutils literal notranslate"><span class="pre">vagrant</span></code>.</p>
<p>The VM can be suspeded using <code class="docutils literal notranslate"><span class="pre">vagrant</span> <span class="pre">suspend</span></code> or stopped using
<code class="docutils literal notranslate"><span class="pre">vagrant</span> <span class="pre">halt</span></code>. The VM can also be paused from the VirtualBox GUI.</p>
<p>To stop and delete the VM use <code class="docutils literal notranslate"><span class="pre">vagrant</span> <span class="pre">destroy</span></code>.</p>
</div>
<div class="section" id="export-the-vm-as-an-applicance">
<h2>Export the VM as an applicance<a class="headerlink" href="#export-the-vm-as-an-applicance" title="Permalink to this headline">¶</a></h2>
<p>Once stopped, the VM can be exported as an ova image (“appliance”) via VirtualBox.
This file (2-3 GB in size) can be shared with other users in order to
run the VM via VirtualBox without installing vagrant.
The default username and password for this VM is <code class="docutils literal notranslate"><span class="pre">vagrant</span></code> and <code class="docutils literal notranslate"><span class="pre">vagrant</span></code>.</p>
<p>In order to create the image, you need to follow these steps.</p>
<p><strong>64-bit image</strong></p>
<p><code class="docutils literal notranslate"><span class="pre">$</span> <span class="pre">vagrant</span> <span class="pre">up</span></code></p>
<p><code class="docutils literal notranslate"><span class="pre">$</span> <span class="pre">vagrant</span> <span class="pre">halt</span></code></p>
<p>Use the VirtualBox manager to remove the shared folders (<code class="docutils literal notranslate"><span class="pre">Settings</span> <span class="pre">-></span> <span class="pre">Shared</span> <span class="pre">Folders</span></code>).
Set the guest OS explicitely to <code class="docutils literal notranslate"><span class="pre">Debian</span> <span class="pre">(64-bit)</span></code> via <code class="docutils literal notranslate"><span class="pre">Settings</span> <span class="pre">-></span> <span class="pre">General</span> <span class="pre">-></span> <span class="pre">Version</span></code>.
Then export the 64-bit image via <code class="docutils literal notranslate"><span class="pre">File</span> <span class="pre">-></span> <span class="pre">Export</span> <span class="pre">Appliance</span></code>.
Writing the ova file may take a minute or two. Then optionally remove the VM either via</p>
<p><code class="docutils literal notranslate"><span class="pre">$</span> <span class="pre">vagrant</span> <span class="pre">destroy</span></code></p>
<p>or via the VirtualBox GUI.</p>
<p><strong>32-bit image</strong></p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">We do no longer support 32-bit environments!</p>
</div>
<p>You still might get it to work, though, by finding a suitable 32-bit Vagrant box for Debian 9 (e.g. <a class="reference external" href="https://app.vagrantup.com/koalephant/boxes/debian9-i386">https://app.vagrantup.com/koalephant/boxes/debian9-i386</a>), and edit the <code class="docutils literal notranslate"><span class="pre">Vagrantfile</span></code>
accordingly:</p>
<p>Edit <code class="docutils literal notranslate"><span class="pre">Vagrantfile</span></code>: comment out lines 18-20, uncomment 24-35 and edit <code class="docutils literal notranslate"><span class="pre">config.vm.box</span></code>. Then</p>
<p><code class="docutils literal notranslate"><span class="pre">$</span> <span class="pre">vagrant</span> <span class="pre">up</span></code></p>
<p><code class="docutils literal notranslate"><span class="pre">$</span> <span class="pre">vagrant</span> <span class="pre">halt</span></code></p>
<p>Use the VirtualBox manager to remove the shared folders (<code class="docutils literal notranslate"><span class="pre">Settings</span> <span class="pre">-></span> <span class="pre">Shared</span> <span class="pre">Folders</span></code>).
Set the guest OS explicitely to <code class="docutils literal notranslate"><span class="pre">Debian</span> <span class="pre">(32-bit)</span></code> via <code class="docutils literal notranslate"><span class="pre">Settings</span> <span class="pre">-></span> <span class="pre">General</span> <span class="pre">-></span> <span class="pre">Version</span></code>.
Then export the 32-bit image via <code class="docutils literal notranslate"><span class="pre">File</span> <span class="pre">-></span> <span class="pre">Export</span> <span class="pre">Appliance</span></code>.
Writing the ova file may take a minute or two. Then optionally remove the VM either via</p>
<p><code class="docutils literal notranslate"><span class="pre">$</span> <span class="pre">vagrant</span> <span class="pre">destroy</span></code></p>
</div>
<div class="section" id="reducing-the-size-of-the-vm-appliance">
<h2>Reducing the size of the VM appliance<a class="headerlink" href="#reducing-the-size-of-the-vm-appliance" title="Permalink to this headline">¶</a></h2>
<p>Before exporting the VM appliance, you might want to try reducing the size of the VM by releasing memory that is not used.</p>
<ul class="simple">
<li>in the VM terminal, unlock the <code class="docutils literal notranslate"><span class="pre">root</span></code> account via <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">passwd</span> <span class="pre">root</span></code></li>
<li>enter and verify <code class="docutils literal notranslate"><span class="pre">root</span></code> password (preferably leave it with <code class="docutils literal notranslate"><span class="pre">vagrant</span></code>)</li>
<li>in the VM terminal, do <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">apt-get</span> <span class="pre">install</span> <span class="pre">zerofree</span></code></li>
<li>restart the VM via VirtualBox GUI</li>
<li>Immediately press and hold <code class="docutils literal notranslate"><span class="pre">Esc</span></code> until you see the <code class="docutils literal notranslate"><span class="pre">GNU</span> <span class="pre">GRUB</span></code> menu. If you see the log in terminal, you were too late in pressing <code class="docutils literal notranslate"><span class="pre">Esc</span></code></li>
<li>Choose <code class="docutils literal notranslate"><span class="pre">Advanced</span> <span class="pre">options</span> <span class="pre">for</span> <span class="pre">Debian/GNU</span> <span class="pre">Linux</span></code></li>
<li>Choose <code class="docutils literal notranslate"><span class="pre">...</span> <span class="pre">(recovery</span> <span class="pre">mode)</span></code></li>
<li>authenticate using your <code class="docutils literal notranslate"><span class="pre">root</span></code> password</li>
<li><code class="docutils literal notranslate"><span class="pre">service</span> <span class="pre">rsyslog</span> <span class="pre">stop</span></code></li>
<li><code class="docutils literal notranslate"><span class="pre">killall</span> <span class="pre">dhclient</span></code></li>
<li><code class="docutils literal notranslate"><span class="pre">mount</span> <span class="pre">-r</span> <span class="pre">-o</span> <span class="pre">remount</span> <span class="pre">/dev/sda1</span></code></li>
<li><code class="docutils literal notranslate"><span class="pre">zerofree</span> <span class="pre">-v</span> <span class="pre">/dev/sda1</span></code></li>
<li><code class="docutils literal notranslate"><span class="pre">exit</span></code> from recovery mode and shut down the VM</li>
<li>export appliance as shown above</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sidebar">
<h3>Table Of Contents</h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="background.html">Background</a></li>
<li class="toctree-l1"><a class="reference internal" href="features.html">Features</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quick start</a></li>
<li class="toctree-l1"><a class="reference internal" href="downloads.html">Downloads</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Build the VM from source</a></li>
<li class="toctree-l1"><a class="reference internal" href="sharedir.html">Share data between guest and host</a></li>
<li class="toctree-l1"><a class="reference internal" href="courses.html">Courses</a></li>
<li class="toctree-l1"><a class="reference internal" href="community.html">Community</a></li>
<li class="toctree-l1"><a class="reference internal" href="team.html">Development Team</a></li>
<li class="toctree-l1"><a class="reference internal" href="knownissues.html">Known Issues</a></li>
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
</ul>
<div role="search">
<h3 style="margin-top: 1.5em;">Search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="clearer"></div>
</div>
</div>
<div class="footer-wrapper">
<div class="footer">
<div class="left">
<div role="navigation" aria-label="related navigaton">
<a href="downloads.html" title="Downloads"
>previous</a> |
<a href="sharedir.html" title="Share data between guest and host"
>next</a>
</div>
<div role="note" aria-label="source link">
<br/>
<a href="_sources/build.rst.txt"
rel="nofollow">Show Source</a>
</div>
</div>
<div class="right">
<div class="footer" role="contentinfo">
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.4.
</div>
</div>
<div class="clearer"></div>
</div>
</div>
</body>
</html>