tweaks some more
[feisty_meow.git] / production / sites / cakelampvm.com / docs / manual / cakelampvm_guide_v002.html
1 <!DOCTYPE html>
2 <html>
3   <head>
4     <meta content="text/html; charset=windows-1252" http-equiv="content-type">
5     <title>Cake LAMP VM Documentation</title>
6   </head>
7   <body>
8     <h1 style="text-align: center;">The cakelampvm VM:<br>
9       Configuration and Usage</h1>
10     <h2 style=" text-align: center;">By Chris Koeritz</h2>
11     <h3 style="   text-align: center;"> Vintage: cakelampvm v002 &nbsp;&nbsp;
12       Updated: 2017-11-16</h3>
13     <p>The cakelampvm project provides a virtualbox VM that acts as an "internet
14       in a bottle".&nbsp; The virtual machine provides DNS services (<a title="dns server"
15         href="http://www.bind9.net/">bind9</a>), a Web server (<a title="patchy"
16         href="https://httpd.apache.org/">Apache2</a>), a full <a title="ubuntu means compassion and humanity"
17         href="https://www.ubuntu.com/">Ubuntu</a> <a title="it's pronounced leenoox"
18         href="https://www.linuxfoundation.org/">Linux</a> desktop environment,
19       the <a title="flux is change" href="http://fluxbox.org/">Fluxbox</a> <a
20         title="a better windows" href="https://www.x.org/">X window manager</a>,
21       and a suite of tools called the <a title="feisty meow® concerns ltd. website"
22         href="https://feistymeow.org/">Feisty Meow® codebase</a>
23       <meta http-equiv="content-type" content="text/html; charset=utf-8">
24       .&nbsp; Together, these services provide you with a very flexible and
25       powerful testbed for web development, especially suited for <a title="it's cake"
26         href="https://cakephp.org/">CakePHP</a>.</p>
27     <p>todo: arrange gritty details to back.</p>
28     <p>TOC GOES HERE.</p>
29     <h6> </h6>
30     <h2><span style="text-decoration: underline;">G</span>uest VM Configuration</h2>
31     <ul>
32       <li>hostname: <a title="the vm's website, when configured properly" href="https://cakelampvm.com/">cakelampvm.com</a></li>
33       <li>local IP address: 10.28.42.20</li>
34       <li>services: DNS (bind9), apache2, fluxbox X windowing system, <a title="not just in the garden"
35           href="https://www.gnome.org/">gnome display manager</a></li>
36       <li>main user: developer (password distributed separately)</li>
37       <li>mysql root password: (password distributed separately)</li>
38     </ul>
39     <h2>Powering up with the Feisty Meow® scripts</h2>
40     <p>[First, let me drop the registered trademark symbol from here on
41       in.&nbsp; I hope its presence above has been sufficiently clear for legal
42       purposes, but now it will just get in the way.&nbsp; Also, capitalization
43       really bores me, and it's the feisty meow codebase anyhow, so that's how
44       it will be written henceforth.]</p>
45     <p>The feisty meow scripts are a cohesive bash scripting environment for
46       getting a variety of tasks done.&nbsp; The scripts recently incorporated
47       the 'avbash' collection from Saco Designs, which provides tools for
48       bringing up CakePHP web sites and managing the collection of repositories
49       for those sites.&nbsp; Each website is considered an "application", and
50       the application name itself (e.g. "winterportlibrary") can often provide
51       all the details for "powering up" the site.&nbsp; The feisty meow team has
52       added additional scripts for managing DNS domains and Apache websites that
53       provide the capability to "stand up" an entire website around an
54       application, with accompanying domain.</p>
55     <p>The scripts for now are documented separately within the Feisty Meow
56       codebase.&nbsp; The <a title="quickstart" href="https://feistymeow.org/feisty_meow/readme.txt">Feisty
57         Meow readme</a> file provides some valuable information on configuring
58       the codebase.&nbsp; If you have the cakelampvm, then this has already been
59       done for you on the vm in the developer account.&nbsp; The script
60       documentation is available in the UHHHHHH page of something..</p>
61     <h2>How to set up virtualbox for your host PC</h2>
62     <ol>
63       <li>Download and install virtualbox:
64         https://www.virtualbox.org/wiki/Downloads</li>
65       <li>Install the extension pack for virtualbox: This provides USB drivers
66         and other features.&nbsp; This is installed on virtualbox itself, not on
67         the guests.</li>
68       <ol>
69         <li>Download the extension pack at
70           https://www.virtualbox.org/wiki/Downloads</li>
71         <li>Stop any running virtualbox vms.</li>
72         <li>Close virtualbox control panel.</li>
73         <li>Double-click on the downloaded extensions package (in a file
74           explorer) and virtualbox should install it.</li>
75       </ol>
76       <li>Run the virtualbox control panel.</li>
77       <li>Download the cakelampvm guest vm package and unzip it.&nbsp; Store the
78         unzipped version in some appropriate place where you want the virtual
79         machine to reside on your host's hard drive.</li>
80       <li>Add the guest VM to your list of VMs.&nbsp; From the virtualbox menus,
81         choose the "Machine" menu and select "Add".&nbsp; Point the selector
82         dialog at the cakelampvm folder you created above and open the
83         cakelampvm.vbox file.</li>
84       <li>Now the cakelampvm should show up in the list of virtual
85         machines.&nbsp; Before starting it, perform the following network
86         configuration sections.</li>
87     </ol>
88     <h3>Configure the Host-Only network on virtualbox</h3>
89     <p>Configuring host-only networking for the VM makes the VM completely local
90       to your machine.&nbsp; The cakelampvm will not be accessible on the
91       internet or from the LAN, and can only be accessed by your host PC.</p>
92     <ol>
93       <li> Go to virtual box "Preferences" (global preferences, not for a
94         specific vm).</li>
95       <li> Click on the "Network" tab.</li>
96       <li> Choose the "Host-only Networks" tab from within "Network".</li>
97       <li> Click the plus icon to add a new host-only network, or if there is
98         already a Host-only network, then edit it.</li>
99       <li>Set the "Adapter" parameters:<br>
100         IPv4 Address: 10.28.42.1<br>
101         IPv4 Network Mask: 255.255.255.0<br>
102         IPv6 Address: (leave blank)<br>
103         IPv6 Prefix Length: 0<br>
104         Virtualbox will fill in the other details like so:<br>
105         <p><img alt="host only network adapter" src="images/host_only_network_adapter.png"></p>
106       </li>
107       <li>Set the "DHCP Server Settings" to disabled, e.g.<br>
108         <img alt="host only dhcp" src="images/host_only_adapter_dhcp_server.png"><br>
109         This is disabled because we will be using statically assigned addresses
110         for convenience and stability.</li>
111     </ol>
112     <p>Additional information on host-only (and other) network adapter types is
113       at: https://www.virtualbox.org/manual/ch06.html#network_nat_service<br>
114     </p>
115     <h3>Configure the Nat Network on virtualbox</h3>
116     <ol>
117       <li> Go to virtual box "Preferences" (global preferences, not for a
118         specific vm).</li>
119       <li> Click on the "Network" tab.</li>
120       <li> Choose the "Nat Networks" tab from within "Network".</li>
121       <li> Click the plus icon to add a new host-only network.</li>
122       <li>Set the "NAT Network Details" parameters:<br>
123         Network Name: NatNetwork<br>
124         Network CIDR: 10.0.2.0/24<br>
125         Supports DHCP: checked<br>
126         Supports IPv6: optionally checked<br>
127         These are my settings, with IPv6 left disabled:<br>
128         <img alt="nat net config" src="images/nat_network_config.png"></li>
129     </ol>
130     <h2>Start up the VM</h2>
131     <p>Using the virtualbox interface, you should now be able to start your
132       virtual machine.&nbsp; Virtualbox will complain if it detects any
133       remaining configuration problems in the VM, but it should start
134       normally.&nbsp; The Linux boot sequence will show many lines of text,
135       before bringing up a black console window with a login dialog.</p>
136     <p>You can log in directly on the VM console with the developer account, but
137       it is generally more useful to connect to the cakelampvm over ssh.&nbsp;
138       If the networking has been established properly, you should be able to do
139       this with:</p>
140     <pre>ssh developer@cakelampvm.com&nbsp; (or equivalent with your ssh client)</pre>
141     <p>And then provide the password to log in.</p>
142     <p>A feature called "X forwarding" is enabled, so if you start graphical
143       applications on the VM, you can display them from an appropriately
144       configured host.&nbsp; (If you're running Linux as the host for the VM,
145       you can definitely run remote windows.&nbsp; Windows may not support
146       that.)</p>
147     <p>#### check this!!!</p>
148     <h2>Using the guest VM's DNS services</h2>
149     <p>The cakelampvm has been set up to provide a DNS server which will answer
150       name requests for all of the sites that the VM hosts.</p>
151     <p>To use the cakelampvm DNS, modify your host operating system network
152       configuration by adding or changing the DNS server to use the guest VM's
153       DNS service.&nbsp; This is available at the local address
154       10.28.42.20.&nbsp; The DNS server can be tested with nslookup, dig and
155       other tools.</p>
156     <p>Note that the cakelampvm DNS should be listed first, if one intends to
157       override any DNS names that actually exist out on the internet.</p>
158     <p>If the DNS server is properly set up, then these ping commands should get
159       answering responses:</p>
160     <pre>ping cakelampvm.com</pre>
161     <pre>ping defaultcake.cakelampvm.com</pre>
162     <pre>ping mapsdemo.cakelampvm.com</pre>
163     <h3>Setting up DNS on Windows</h3>
164     <p>The ipconfig tool will provide helpful information about your current
165       networking and DNS configuration:</p>
166     <pre>ipconfig --all</pre>
167     <p>The DNS configuration on Windows is somewhat byzantine.&nbsp; The pipe
168       characters ('|') below are used to separate the menus or tabs or dialogs
169       to traverse.&nbsp; Follow this path to get to the DNS config:</p>
170     <pre>Control Panel | Network &amp; Sharing | click WiFI or Ethernet link near top right | click Adapter Settings on left | click on specific network device to modify | select Properties</pre>
171     <p><br>
172     </p>
173     <p><br>
174     </p>
175     <p><br>
176     </p>
177     <h2>Editing files on the guest VM from the host</h2>
178     <p>On the host computer, look for the guest vm as a networked computer
179       called cakelampvm.&nbsp; This should provide some network shares using
180       Microsoft SMB protocol, and they can be attached to using the "developer"
181       user and its password.</p>
182     <p>On windows, one may want to mount this network location as a drive letter
183       for easier access.</p>
184     <p>Currently, the root of all web servers is exposed as "www".&nbsp; Editing
185       the files in those folders requires ownership by the developer user.&nbsp;
186       Currently the defaultcake server is owned by developer.</p>
187     <p>One should be able to create a new directory in the www folder owned by
188       the developer user over the network also, which can be used for creating
189       new projects.&nbsp; However, there is a config issue in the current vm
190       (v001) about this; to fix, run this command on the guest vm as the
191       developer user:</p>
192     <pre>sudo chmod g+w /var/www</pre>
193     <p>Afterwards, the www folder should allow the developer user to create new
194       folders at will.</p>
195     <h2>Accessing files on the host PC from the guest VM</h2>
196     <p>If you want to share a folder from the host to the guest, perhaps for
197       driver updates or other conveniences, then make the share with these
198       steps:</p>
199     <ol>
200       <li>Create a folder on the host that is to be shared.</li>
201       <li>Right-click on the vm in virtualbox manager and choose "Settings".</li>
202       <li>In the "Shared Folders" tab of the settings, go to "Machine Folders".</li>
203       <li>Click the folder plus icon to create a new share.</li>
204       <li>Fill in the "Folder Path" on the host PC to the folder that will be
205         shared, and give it a name for the guest.&nbsp; We assume the folder
206         name will be "myshare".</li>
207       <li>On the guest vm, run the following commands to mount the share:<br>
208         <pre>mkdir ~/shared&nbsp;&nbsp;&nbsp; # for the guest's version of the shared folder</pre>
209         <pre>sudo mount -t vboxsf myshare ~/shared&nbsp;&nbsp;&nbsp; # mount the vm's share name onto the folder on the vm.</pre>
210       </li>
211     </ol>
212     <h2>Adding a new website and domain on the guest VM</h2>
213     <p>To add a new website, you will need to pick one of the DNS options below
214       (A or B) depending on how you want to name the site.&nbsp; After the DNS
215       is updated, then follow the section after for creating a new apache conf
216       file.</p>
217     <p>Assuming one has created a new folder in "www" called "greatsite", then
218       the new web site can be brought online on the vm with one of the following
219       options.</p>
220     <h3>DNS Option A: Using a sub-domain in the cakelampvm.com domain</h3>
221     Connect to the cakelampvm via ssh as the developer user, e.g.: ssh
222     developer@cakelampvm.com
223     <p>Execute the following command to edit the DNS file for the cakelampvm
224       domain:</p>
225     <pre>sudo vi /etc/bind/cakelampvm.com.conf</pre>
226     <p>Add a stanza for the new site at the end of this file:</p>
227     <pre>greatsite.cakelampvm.com&nbsp;&nbsp;&nbsp; IN A&nbsp;&nbsp;&nbsp; 10.28.42.20<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; IN HINFO "linux server" "ubuntu"</pre>
228     <p>Restart the DNS server: sudo service bind9 restart</p>
229     <p>Afterwards, pinging greatsite.cakelampvm.com should work from either the
230       guest or the host.</p>
231     <h3>DNS Option B: Using an entirely new domain for the site</h3>
232     <p>Similar procedure to above, but we will create a new file for the new
233       domain and add it to the bind directory.&nbsp; For this example, we will
234       create a file called /etc/bind/greatsite.tv.conf for our new domain
235       greatsite.tv with these contents:</p>
236     <pre>$TTL 1W<br>@&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN SOA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fred.cakelampvm.com. (<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2017100801&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; serial<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2H&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; refresh<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8M&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; retry<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 14D&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; expiry<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6H )&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; minimum<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN NS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ns.cakelampvm.com.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN MX&nbsp;&nbsp; 10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mail.cakelampvm.com.<br><br># main domain for machine.<br>greatsite.tv.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 10.28.42.20<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN HINFO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "linux server" "ubuntu"</pre>
237     The gnarly prefix stuff above the "greatsite.tv." listing establishes
238     configuration info for the new domain.&nbsp; This file relies on the
239     existing cakelampvm.com infrastructure in DNS, such as the "ns" host, which
240     is the domain's name server.
241     <p>Now that the config file is in place, edit "named.conf.local" to add the
242       new file by adding this bit of configuration at the end:</p>
243     <pre>zone "greatsite.tv" in {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file "/etc/bind/greatsite.tv.conf";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type master;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; allow-query { any; };<br>};</pre>
244     <p>Restart the DNS server: sudo service bind9 restart</p>
245     <p>Afterwards, pinging greatsite.tv should work from either the guest or the
246       host.</p>
247     <h3>Create a new apache configuration file and load it</h3>
248     <p>Start with the following template file for the new website, and modify it
249       for the appropriate host name:</p>
250     <pre>&lt;VirtualHost *:80&gt;<br>&nbsp;&nbsp;&nbsp; ServerName greatsite.cakelampvm.com<br>&nbsp;&nbsp;&nbsp; ServerAlias greatsite.cakelampvm.com *.greatsite.cakelampvm.com<br>&nbsp;&nbsp;&nbsp; DocumentRoot /var/www/greatsite<br>&nbsp;&nbsp;&nbsp; ErrorLog ${APACHE_LOG_DIR}/greatsite.cakelampvm.com-error.log<br>&nbsp;&nbsp;&nbsp; CustomLog ${APACHE_LOG_DIR}/greatsite.cakelampvm.com-access.log combined<br>&nbsp;&nbsp;&nbsp; Alias /statistics "/var/www/webwork.repository/webwork/maps_demo/webroot/statistics"<br>&nbsp;&nbsp;&nbsp; Include /etc/apache2/conf-library/basic-options.conf<br>&nbsp;&nbsp;&nbsp; Include /etc/apache2/conf-library/rewrite-enabling.conf<br>&lt;/VirtualHost&gt;</pre>
251     <p>The above example is pre-modified for DNS Option A above, the
252       greatsite.cakelampvm.com name.&nbsp; Switching all of those to
253       "greatsite.tv" instead would support DNS option B.</p>
254     <p>Copy that file into /etc/apache/available-sites under an appropriate
255       name, which here we will call "greatsite.conf".</p>
256     <p>Tell apache to use the new file:</p>
257     <pre>a2ensite greatsite.conf</pre>
258     <p>Finally, restart apache to get it to begin serving the site:</p>
259     <pre>sudo service apache2 restart</pre>
260     <h3>Test the new web site</h3>
261     <p>Given the configuration above, your host PC should now be able to access
262       the new website.</p>
263     <p>To test this, first try pinging the hostname, e.g.: ping
264       greatsite.cakelampvm.com or ping greatsite.tv</p>
265     <p>Then, if there are responses to the ping, it means the DNS is
266       working.&nbsp; If there are no responses, check the instructions in the
267       above DNS option section.</p>
268     <p>Once the DNS is working, one can try browsing to the site at:
269       http://greatsite.cakelampvm.com or http://greatsite.tv (depending on the
270       DNS option chosen).</p>
271     <p>If the site is not showing up properly, try examining the apache logs for
272       error messages that can be corrected.&nbsp; The log files are stored in
273       /var/log/apache2 and are generally named after the website.</p>
274     <h2>Configuring the guest VM</h2>
275     <p>The guest VM should already be set up appropriately.&nbsp; These steps
276       are provided for reference and updates.</p>
277     <h3>Set up virtualbox guest additions for the VM</h3>
278     <p>** note for v001 of cakelampvm: the below steps are still needed on the
279       shipped image.</p>
280     <p>This procedure is needed if the guest provides an older or incompatible
281       version of the guest additions (which have already been installed on the
282       guest vm).&nbsp; It may also be necessary when a new version of the guest
283       additions becomes available.</p>
284     <ol>
285       <li>To install the guest additions, open the guest VM and have its window
286         in focus.</li>
287       <li>Choose the "Devices" menu and select "Insert Guest Additions CD
288         Image".&nbsp; This will mount the CD's ISO image on the VM.</li>
289       <li>On the guest VM, it may be necessary to mount the CD image that's now
290         available:<br>
291         sudo mount /dev/sr0 /media/cdrom</li>
292       <li>Since the VM currently has no windowing system installed, one must
293         start the Guest Additions install manually:<br>
294         cd /media/cdrom<br>
295         sudo sh VBoxLinuxAdditions.run</li>
296       <li>This should install the guest additions.</li>
297     </ol>
298     <h3>Set up network adapters on guest VM</h3>
299     <p>The network interfaces should already be configured on the guest within
300       the virtualbox configuration.&nbsp; This is available by clicking on the
301       VM in the virtualbox manager and selecting "Settings".&nbsp; These are the
302       configuration settings used:</p>
303     Adapter 1:<br>
304     &nbsp; Attached to: Host-only Adapter<br>
305     &nbsp; Name: vboxnet0&nbsp; <br>
306     <p>Adapter 2:<br>
307       &nbsp; Attached to: Nat Network<br>
308       &nbsp; Name: NatNetwork</p>
309     <p>On the guest VM itself, the network settings are specified in a file
310       called /etc/network/interfaces.&nbsp; Here are the current contents of
311       that file:</p>
312     <pre>source /etc/network/interfaces.d/*<br><br>auto lo<br>iface lo inet loopback<br><br>auto enp0s3<br>iface enp0s3 inet static<br>&nbsp; address 10.28.42.20<br>&nbsp; netmask 255.255.255.0<br>&nbsp; network 10.28.42.0<br>&nbsp; broadcast 10.28.42.255<br>&nbsp; dns-domain cakelampvm.com<br>&nbsp; dns-search cakelampvm.com<br>&nbsp; dns-nameservers 127.0.0.1 8.8.8.8</pre>
313     <pre>auto enp0s8</pre>
314     <pre>iface enp0s8 inet dhcp</pre>
315     <p> </p>
316     <h2>Handy Techniques</h2>
317     <h3>Get the network address on the guest vm</h3>
318     <p>Run this command: ifconfig</p>
319     <p>In the results, look for "inet addr".&nbsp; There may be more than one,
320       if there are multiple network interfaces.</p>
321     <h3>How to cleanly reboot or shut down the guest VM</h3>
322     <p>When you've got the DNS and everything integrated, these commands will
323       manage the vm's state:</p>
324     <p>First, log into the guest VM: ssh developer@cakelampvm.com</p>
325     <p>Then, reboot the guest VM: sudo reboot</p>
326     <p>Or, halt the guest VM: sudo shutdown -h now</p>
327     <p>Using these commands is better than just cycling the power from the
328       virtualbox control panel.</p>
329     <h2>Notes on building the Cake Lamp VM</h2>
330     <p>This is all work that should already have been done.&nbsp; It is
331       mentioned here just as breadcrumbs for a future vm builder.</p>
332     <ul>
333       <li>Downloaded and installed virtualbox for host computer (where the vm
334         image will be built).</li>
335       <li>Downloaded ubuntu server 16.04 iso.
336         (https://www.ubuntu.com/download/server)</li>
337       <li>Created a new vm in virtualbox, telling it to start from the ubuntu
338         server iso.</li>
339       <li>Installed LAMP stack on guest VM.&nbsp; Some help here:
340         http://howtoubuntu.org/how-to-install-lamp-on-ubuntu</li>
341       <li>Configured CAKE on the guest VM.&nbsp; Useful link:
342         https://askubuntu.com/questions/628938/how-to-install-cakephp-in-ubuntu-14-04</li>
343       <li>Configured the two network adapters as needed (one for host-only
344         network and one for nat network).&nbsp; Here's some info about
345         virtualbox networking with two adapters similar to our setup:
346 https://askubuntu.com/questions/293816/in-virtualbox-how-do-i-set-up-host-only-virtual-machines-that-can-access-the-in<br>
347       </li>
348       <li>Installed and configured Samba service for the guest VM.&nbsp; The
349         main config file lives in "/etc/samba/smb.conf".&nbsp; Some pointers
350         here:
351 https://help.ubuntu.com/community/How%20to%20Create%20a%20Network%20Share%20Via%20Samba%20Via%20CLI%20%28Command-line%20interface/Linux%20Terminal%29%20-%20Uncomplicated%2C%20Simple%20and%20Brief%20Way%21</li>
352     </ul>
353     <p><br>
354     </p>
355   </body>
356 </html>