Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question
    
@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 2: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 2:38
    
@Joe Fletcher - If you don't me asking, what do you need Shared Folders in Ubuntu Server for? –  Darius Mar 24 '11 at 2: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 2:53
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 –  Sathya Mar 24 '11 at 4:25

2 Answers 2

up vote 21 down vote accepted

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
share|improve this answer
    
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). –  Joe Fletcher Mar 25 '11 at 3:42
    
Quite welcome @Joe. You can ignore those messages, it shouldn't affect you –  Sathya Mar 25 '11 at 5: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 try running: sudo apt-get install dkms build-essential linux-headers-generic then reboot. After reboot mount the share like mentioned above. –  Andres Mar 4 '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. –  Sathya Sep 25 '12 at 5:52

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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