13

In Ubuntu, Linux Mint and Korora, all I had to do was to load the image into the CD drive and it recognized it and asked if I wanted to run it. Everything worked seamlessly.

In elementary OS, when I load the CD image there is no prompt. I try running the .sh files, nothing.

What am I doing wrong and how do I fix it?

12

The VirtualBox extensions CD comes with an installation script VBoxLinuxAdditions.run that requires a terminal. There is a wrapper script autorun.sh that tries to open a terminal emulator and run VBoxLinuxAdditions.run inside it. It tries konsole, gnome-terminal and xterm (as of VirtualBox 4.3.28), but none of them are installed by default, so it gives up. The other distributions you tried probably have at least xterm or gnome-terminal, whereas elementary OS only has Pantheon Terminal (pantheon-terminal) in the default installation.

If you open the CD in Files, highlight autorun.sh and select “Run” in the menu, the errors complaining about the inability to run a terminal are written to the log file .xsession-errors in your home directory (along with a lot of other crap).

To install the VirtualBox extensions, first select “Install Guest Additions CD image” in the “Devices” menu of VirtualBox. Then open Pantheton Terminal and type the command

sudo /media/gilles/VBOXADDITIONS_4.3.28_100309/VBoxLinuxAdditions.run

Adjust the username and the VirtualBox version as suitable. You can save typing by using the shell's completion feature: press Tab after typing the beginning of a file or directory name to automatically insert the rest, if what you typed isn't ambiguous. For example, if you're the only user on your computer, you can type

sudo /meTab/Tab/VTab/VTabLTabEnter

If you no other removable media is currently inserted, you can even save the first V. And conversely if you have another removable media whose label begins with V you'll have to type more characters until that part is disambiguated. Similarly, if other users have currently-mounted removable media, you'll need to type enough of your username after the second / to be unambiguous.

  • Thanks for the reply. I tried all your suggestions including installing xterm. I would get as far as it asking for my password and I would get command unknown. after getting frustrated I shut everything down to cool off(me not comp). after a while I fired up and tried again, I doubleclicked on autorun.sh and low and behold everything installed.Thank You – Jazz58 Jul 31 '15 at 4:45
5

To install Guest Additions:(elementary OS as guest)

1.Close(shutdown) the elementay OS (guest)

2.Identify the location of VBoxGuestAdditions.iso .

(In Ubuntu /usr/share/virtualbox/VBoxGuestAdditions.iso)

3.Go to VirtualBox --> Settings --> Storage --> select Adds Optical Drive (green + with disk image) --> Add the location of .iso file.

Imgur

4.Now start the elementary OS guest and open File System , the you will see similar to the following image,

Imgur

5.Now open terminal and run

cd /media/[user_name]/VBOXADDITIONS_5.0.0_101573
ls

Here there will be VBoxLinuxAdditions.run. Now in terminal,

sudo ./VBoxLinuxAdditions.run

After installation restart the elementary OS guest.

3

After installing elementry OS, Once you’re rebooted and logged back in, go to the “Devices” menu on your virtual machine’s window and select “Insert Guest Additions CD image.”

Before installing them, install the dkms package:

sudo apt-get install dkms

Now you’ll want to mount the Guest Additions image. The easiest way is to open up Files from Slingshot application launcher and select it under “Devices” at the side.

Then open a terminal and cd (change the directory) to where the image is mounted, for example:

cd /media/VBOXADDITIONS_4.3.12_93733$ sudo ./VBoxLinuxAdditions.run

Now reboot.

1

Create a file with the following contents called install-vbox.sh in your home directory and run it by typing* bash ~/install-vbox.sh. It will download the .iso file of the current VirtualBox release (5.0.0) to your Downloads directory, check that the download is valid, mount the image and run the VirtualBox installer. And automatically restart your system afterwards.

#!/bin/bash
cd ~/Downloads/
if [ ! -f ./vbox-guest.iso ]; then
  wget -O ./vbox-guest.iso "http://download.virtualbox.org/virtualbox/5.0.0/VBoxGuestAdditions_5.0.0.iso"
fi
echo "8d9f1d600ff65d1230b9b4e386f2ad48 vbox-guest.iso" > ./vbox-guest.iso.md5
if [ ! "$(md5sum -c ~/Downloads/vbox-guest.iso.md5)" ]; then 
  echo "Failed to verify iso file"
  exit 1
fi
sudo mkdir /media/vbox-guest
sudo mount -o loop ./vbox-guest.iso /media/vbox-guest
cd /media/vbox-guest
if [ "$(sudo sh ./VBoxLinuxAdditions.run)" ]; then
  sleep 5
  sudo umount /media/vbox-guest
  sudo rmdir /media/vbox-guest
fi
echo "You may need to restart your system for the changes to take effect, run 'shutdown -r now'"

If the download got corrupted and the script is stopping with "Failed to verify iso file" then delete ~/Downloads/vbox-guest.iso and run the script again.

If it worked you can delete ~/Downloads/vbox-guest.iso, ~/Downloads/vbox-guest.iso.md5 and the script itself afterwards.


*: Alternatively you can make the script executable first from inside Files or by running chmod +x ~/install-vbox.sh. Then simply run the script from Files or by typing ~/install-vbox.sh in Terminal. But there is really no need as you won't be running it more than once.

  • You do not need to restart your system, and putting a forced restart in a script is obnoxious, it can lead to major data loss. – Gilles Jul 31 '15 at 18:04
  • Why do you recommend downloading the guest tools for version 5.0.0 rather than for whatever version (older or newer) the system is running in? – Gilles Jul 31 '15 at 18:05
  • You do need a reboot. That's why I put a warning in the script and a 15s delay before reboot. If you are very ignorant there is the danger of losing unsafed documents. And I am recommending the most current version, which right now is 5.0.0 – quassy Jul 31 '15 at 19:33

protected by Ravan Dec 30 '15 at 11:12

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.