Optional – VB Guest Additions & Shared Folders

This is optional since this does not work on all Windows machines and this is beyond my control.  Again this is optional and should this give you any problems please just move on and don’t waste time on this.

Ok, so VB is up and running but it would be nice to have full screen and other advanced functionality (like shared folders between your host and guest Ubuntu OS) so let’s install and investigate VB in more depth and first we will install the VB Guest Additions and implement Shared Folders.  Again, I recommend you read this in its entirety to understand the content, task and available resources.

*Note – for some reason I had to reinstall the Guest Additions a 2nd time 4 weeks after the first installation as I lost access to my shared folders.  If you see that you have lost full screen mode or other Guest Additions functionality (e.g. shared folders), please reinstall with these same instructions as the scripts will remove the old version and reinstall the latest version.

Settings – More Virtual Box Components/Functionality

First, let’s become more familiar with the VirtualBox environment.  This serves several purposes as it is necessary to use the correct terminology to search for answers should you have problems.  This of course also lets you help others better.  VirtualBox is wonderful for many reasons as its settings will teach you about Operating Systems (OS).  BTW – if you subscribe to any technical IS/IT RSS feeds, (e.g. ComputerWorld, InfoWeek, etc.) you will see something on virtualization at least 3 days a week as this is pervasive in industry.  Well after that long- winded introduction :)

Start VirtualBox but do not start your Ubuntu Instance yet.  Goto Settings and look at the icons across the top of the screen (you should already have done this but we need to be very familiar with the functionality).  Again note that for each icon you have basic, advanced and description options.  Explore each icon and their settings and description.

VB Guest Additions

There are many good VB Guest Additions tutorials on the Web.  For a comprehensive understanding, I recommend you read about the guest additions in the Virtual Box manual: http://www.virtualbox.org/manual/ch04.html  

Note, learning about the VB Guest Additions will also illustrate some differences between Windows and Mac with respect to device drivers therefore it is important reading for CIS students.

Other real good VB Guest Additions tutorials located here:

http://complete-concrete-concise.com/ubuntu-2/ubuntu-12-04/ubuntu-12-04-installing-virtualbox-guest-additions

http://www.dedoimedo.com/computers/virtualbox-guest-addons.html

http://digitizor.com/2009/05/26/how-to-install-virtualbox-guest-additions-for-a-linux-guest/ 

http://helpdeskgeek.com/linux-tips/install-virtualbox-guest-additions-in-ubuntu/

http://www.unixmen.com/install-guest-additions-and-run-fullscreen-mode-on-virtualbox-linux-ubuntu-fedora/ 

Again note that it is impossible to provide 100% up to the minute accurate information as this highly transitory environment changes constantly.  The best bet to find accurate information is to search using very discrete or specific search criteria using the actual version of Ubuntu – e.g. Google Ubuntu 10.04 (or now 12.04) Virtual Box Guest Additions.  You could also include the Virtual Box version number and possibly add the keyword “tutorial”.

Here we go with my VB Guest Addition instructions (i.e. what worked for me and again, … I had to redo this 4 weeks later for an unknown reason)

Open Virtual Box

Start your Ubuntu LTS OS

First identify the “Update Manager” and run it.   In Ubuntu 12.04 this is found in Dashboard (In previous versions this was found in Home => Applications).  Again download is best done on high-speed wired network but wireless is almost equivalent these days.  Restart VM if prompted and note you should update your system regularly.

***Optional Information in Absence of Update Manager***

Open the Terminal (ctrl-alt-t) or type “Terminal” in the Dashboard Home (top left panel icon) search box and again you may want to lock it to the left hand panel launcher (use a right click on the Terminal icon in the left dashboard panel once it has opened ) as we will use it a lot

Perform the following commands in your terminal to achieve the same functionality for critical components as Update Manager 
(research the sudo and apt-get commands as well)
>sudo apt-get update
>sudo apt-get upgrade
>sudo apt-get install dkms

Now go up to your VB guest OS main window (Windows right above guest OS, Mac at top of screen)

Open Devices and choose “Install Guest Additions”

Accept Autorun if offered this option and then choose “Run” and authenticate.

When complete, eject the VBoxAdditionsxxx.iso using a right click and “Eject” (in LTS 12.04, the VBoxAdditionsxxx.iso appears in the left hand panel launcher and and you may have to scroll down to see it.  A right click gives the option of “Eject, Note the system mounted this .iso image in media as a CDROM but more on this in a few weeks).

That should be it and upon rebooting you should have a resizable window, full screen view and better graphics, unity and better resource utility across platforms.

Now if this failed – as mine did :)…. we have no other resort than to do it manually as presented below.

*** Manual VBox Additions Installation – Last Resort if Above Did Not Work***

First see tutorials above and choose/try every different method they introduce as necessary.  I did mine manually as follows:

>sudo apt-get update
>sudo apt-get upgrade
>sudo apt-get install dkms

1. Open Firefox and search for and download:VBoxGuestAdditions.iso

2. ISO will appear on desk top – Double click it to mount and then open mounted device (i.e. .iso)

3. Copy VBoxLinuxAdditions-x86.run to Home folder (Right click and copy to)

4. Open Terminal and navigate to home folder and enter the following:

sudo chmod +x VBoxLinuxAdditions-x86.run
sudo ./VBoxLinuxAdditions-x86.run

Optional – Shared Folders (shared between your Host OS and your Guest VB Ubuntu OS)

First a really good tutorial that appears to be bulletproof and note I recommend you make the shared folders both auto-mount and permanent: https://help.ubuntu.com/community/VirtualBox/SharedFolders/

Now my instructions or what worked for me:

To set up shared folders in Virtual Box to access your host Windows or Mac:

VB Setup

1. goto VB Settings and choose Shared Folders.
2. You will see a very tiny little folder with a plus sign (+) to the right of machine folders – click or open it.
3. From drop down “Folder Path Menu” choose “Other”.
4. You should now see your system so choose Documents (or whatever folder on your host you want to share) and name the folder vshare (Note you can choose your own name but these directions will use vshare and if you do change it to something else, note Linux does not allow spaces so it will add underscores if your chosen name or directory has spaces)
5. Also select Auto-mount (and make permanent if presented) so this file system is always available whenever your guest Ubuntu OS is open.

Ubuntu Setup 

1. Now in your Ubuntu instance, open a terminal
2. Create a Vmnt directory and verify using the following commands and note that I am establishing/adhering to the convention that user directories begin with a Capital Letter.
$mkdir Vmnt
$ls
3. Now mount the shared folder as follows (and you may have to do this every time you start Ubuntu and desire shared folders):
$sudo mount -t vboxsf vshare ~/Vmnt
4.   Let’s change the ownership of the Vmnt directory as follows (and you may have to do this every time you start Ubuntu and desire shared folders):
$ sudo chown -R jameslooby Vmnt
#Note you will replace jameslooby with your username

5. You may now save files on your host machine.  If you open up your file manager (Home folder icon near top of left side panel) and open the Vmnt directory you should see your host mapped file system.  You can easily copy and paste to this folder or if you have LibreOffice open, choose “Save As” and then open your user space (your username) and you will see the Vmnt folder so here is another way to transfer files between your host and guest OS.  Above you see that you may have to mount the shared folder every time you start Ubuntu – later on we will learn about scripting and editing the startup or login files/scripts.

Troubleshooting

Now the second time I did this (out of necessity due to lost functionality) I had to reboot after creating the Vmnt directory and prior to mountin the vboxsf vshare ~/Vmnt so should you experience difficulties you should try this fix.

Leave a Reply