Can't install Guest Additions using VirtualBox, Ubuntu guest OS, Win7 host OS

55,382

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:
55,382

Related videos on Youtube

Joe Fletcher
Author by

Joe Fletcher

Updated on September 17, 2022

Comments

  • Joe Fletcher
    Joe Fletcher almost 2 years

    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

    • Darius
      Darius over 13 years
      @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
      Darius over 13 years
      @Joe Fletcher - If you don't me asking, what do you need Shared Folders in Ubuntu Server for?
    • Patches
      Patches over 13 years
      @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?
    • 100rabh
      100rabh over 13 years
      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?
    • Joe Fletcher
      Joe Fletcher over 13 years
      @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
      Joe Fletcher over 13 years
      @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?
    • 100rabh
      100rabh over 13 years
      @Joe yes just type in mount. Take a screenshot ( Alt+ PrintScreen), open Paint & click on Edit -> Paste to get a screenshot
    • Joe Fletcher
      Joe Fletcher over 13 years
      Here's a screenshot: link
    • 100rabh
      100rabh over 13 years
      @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
    • kmonsoor
      kmonsoor over 11 years
      @JoeFletcher i also had so much trouble for ubuntu on win7.
    • kmonsoor
      kmonsoor over 11 years
      @JoeFletcher i also had so much trouble for ubuntu on win7. being pissed off, i started using OpenSUSE. now i am happy ... happy
  • Joe Fletcher
    Joe Fletcher over 13 years
    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).
  • 100rabh
    100rabh over 13 years
    Quite welcome @Joe. You can ignore those messages, it shouldn't affect you
  • Andres
    Andres over 12 years
    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.
  • Eric J.
    Eric J. almost 12 years
    Funny that there is no mention of how to mount /dev/sr0 in the VirtualBox docs. Or did I miss something?
  • 100rabh
    100rabh almost 12 years
    @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.
  • iconoclast
    iconoclast almost 11 years
    In my experience, 60% of the time it fails every time.