15

I'm new to VirtualBox and Linux. I've set up VirtualBox 4.0.4 on Windows 7. Successfully created a virtual machine running Ubuntu server 10.10 64 bit. I'm trying to set up Shared Folders. Prerequisite is Guest Additions. I've followed the Manual, as much as I understand it, and have Googled the heck out of trying to get past this. Here's what I've done:

  1. sudo aptitude update
    sudo aptitude safe-upgrade
    sudo apt-get install dkms
  2. Devices > Install Guest Additions... (nothing apparently happens, but I hear that's ok)
  3. Devices > CD/DVD Devices > [peek at the dropdown: bottom line has Remove disc from virtual drive, so I think that means the ISO is in the virtual CD-ROM drive
  4. Change to directory where your CD-ROM drive is mounted and execute as root, so I: cd .., cd .., cd media, cd cdrom. (am I even in the right place?!)

I try sh ./VBoxLinuxAdditions.run and sudo sh ./VBoxLinuxAdditions.run I get

sh: Can't open ./VBoxLinuxAdditions.run

I try bash ./VBoxLinuxAdditions.run and sudo bash ./VBoxLinuxAdditions.run I get:

bash ./VBoxLinuxAdditions.run no such file or directory

I try chmod +x VBoxLinuxAdditions.run and get no such file or directory

It seems I'm in the wrong directory, the right files aren't where I need them, wrong permissions, or wrong commands. I'm totally lost since every troubleshooting point I've seen on Google either hasn't worked for me when it did for others, or I just don't understand the instructions. Thanks in advance for any help.


This is what mount shows

enter image description here

Sathyajith Bhat
  • 61,504
  • 38
  • 179
  • 264
Joe Fletcher
  • 641
  • 2
  • 7
  • 19
  • @Joe Fletcher - Are you sure you have installed Server? Server is terminal interface only. If you're new to Linux I would suggest "regular" Linux flavour – Darius Mar 24 '11 at 02:02
  • Yes, Server. I've been using the terminal. I'm developing websites. I'm not super new to Linux, but I only a few commands and such. – Joe Fletcher Mar 24 '11 at 02:38
  • @Joe Fletcher - If you don't me asking, what do you need Shared Folders in Ubuntu Server for? – Darius Mar 24 '11 at 02:52
  • @Joe: My version of the VirtualBox Linux Additions has two different `.run` files for the architecture of your Linux VM: `VBoxLinuxAdditions-x86.run` for 32-bit and `VBoxLinuxAdditions-amd64.run` for 64-bit. (You most likely have 32-bit.) You're missing the `-x86` or `-amd64` in your examples. Could that be it? – Patches Mar 24 '11 at 02:53
  • Seems like either the guest additions ISO hasn't been mounted or you're running `VBoxLinuxAdditions.sh` from the wrong place. Can you paste the results of `mount`? – Sathyajith Bhat Mar 24 '11 at 04:08
  • @Patches so, I went to /media/cdrom/ and tried both: sudo sh ./VBoxLinuxAdditions-amd64.run sudo sh ./VBoxLinuxAdditions-x86.run both tries I get "Can't Open ...." @Darius: It's so I can access thoses sites thru Win7 as well as Linux – Joe Fletcher Mar 24 '11 at 04:10
  • @Sathya, should I just type "mount" in the /media/cdrom/ directory? (I did this and a lot of stuff came onto the screen) Also, how do I copy and paste from the Linux/VirtualBox terminal? – Joe Fletcher Mar 24 '11 at 04:13
  • @Joe yes just type in mount. Take a screenshot ( Alt+ PrintScreen), open Paint & click on Edit -> Paste to get a screenshot – Sathyajith Bhat Mar 24 '11 at 04:20
  • Here's a screenshot: [link](http://tinypic.com/r/n35eac/7) – Joe Fletcher Mar 24 '11 at 04:21
  • 1
    @Joe indeed, the ISO isn't mounted. I've just reached work so I can't check on this right now. Once I get back home ( still 8+ hours to go!) I'll take a look – Sathyajith Bhat Mar 24 '11 at 04:25
  • @JoeFletcher i also had so much trouble for ubuntu on win7. – kmonsoor Jan 26 '13 at 11:52
  • @JoeFletcher i also had so much trouble for ubuntu on win7. being pissed off, i started using OpenSUSE. now i am happy ... happy – kmonsoor Jan 26 '13 at 11:52

3 Answers3

32

As I mentioned in the comments, seems the ISO is not mounted. Here's what you can do

  • Ensure that the guest additions ISO is available to the host. You can do this by clicking on Devices menu -> CD/DVD devices and point to the GuestAdditions ISO file. The Guest additions is available in Program Files\Oracle\VirtualBox folder

enter image description here

  • With that mounted, type in the below

    cd /media
    mkdir vbox
    sudo mount /dev/sr0 vbox/
    cd vbox/
    
  • Now, the guest installation ISO is mounted as /media/vbox

enter image description here

  • Run the Guest additions installer by tying ./VBoxLinuxAdditions.run
Sathyajith Bhat
  • 61,504
  • 38
  • 179
  • 264
  • You're a genius! Worked like a charm. I ran all commands with sudo and re-started, and it seemed to work. I got 2 error messages, but not sure if those matter ([link](http://tinypic.com/r/o5nrkg/7)). – Joe Fletcher Mar 25 '11 at 03:42
  • Quite welcome @Joe. You can ignore those messages, it shouldn't affect you – Sathyajith Bhat Mar 25 '11 at 05:45
  • For those of you who are still having problems it might be you're missing the following packages: dkms, build-essential, and linux-headers-generic. [read more](https://forums.virtualbox.org/viewtopic.php?t=15679) try running: `sudo apt-get install dkms build-essential linux-headers-generic` then reboot. After reboot mount the share like mentioned above. – Andres Mar 04 '12 at 20:44
  • Funny that there is no mention of how to mount /dev/sr0 in the VirtualBox docs. Or did I miss something? – Eric J. Sep 24 '12 at 22:21
  • @EricJ. it's not _always_ necessary to mount - typically clicking on "Install guest additions" will mount the guest additions ISO - sometimes, this can fail however. – Sathyajith Bhat Sep 25 '12 at 05:52
  • 1
    In my experience, 60% of the time it fails every time. – iconoclast Aug 13 '13 at 23:08
-1

I tried all this. Here is what worked for me. I am on 2011 Mackbook 10.13 Parrotsec Debian. I had to be in Parrot Terminal and run the commands on this site https://www.codegrepper.com/code-examples/shell/how+to+install+vbox+guest+additions+ubuntu worked like a charm now I am up and running to finish setting up machine-geese it's only been like a month of trial and error to get the machine setup just to run NCL gymnasium.

Pipper P
  • 1
  • 1
  • Welcome to Super User. Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change. – DavidPostill May 22 '22 at 07:20
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/1125507) – Toto May 22 '22 at 08:57
-1

If worse comes to worse, you can always install the desktop and use the GUI to install it...

sudo apt-get install ubuntu-desktop

and restart.

Joshkunz
  • 566
  • 1
  • 4
  • 11