Can't install Guest Additions using VirtualBox, Ubuntu guest OS, Win7 host OS
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 inProgram Files\Oracle\VirtualBox
folder
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
- Run the Guest additions installer by tying
./VBoxLinuxAdditions.run
Related videos on Youtube
Joe Fletcher
Updated on September 17, 2022Comments
-
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:
sudo aptitude update
sudo aptitude safe-upgrade
sudo apt-get install dkms
- Devices > Install Guest Additions... (nothing apparently happens, but I hear that's ok)
- 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
- 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
andsudo sh ./VBoxLinuxAdditions.run
I getsh: Can't open ./VBoxLinuxAdditions.run
I try
bash ./VBoxLinuxAdditions.run
andsudo 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 directoryIt 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-
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 over 13 years@Joe Fletcher - If you don't me asking, what do you need Shared Folders in Ubuntu Server for?
-
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 andVBoxLinuxAdditions-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 over 13 yearsSeems 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 ofmount
? -
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 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 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 over 13 yearsHere's a screenshot: link
-
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 over 11 years@JoeFletcher i also had so much trouble for ubuntu on win7.
-
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 over 13 yearsYou'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 over 13 yearsQuite welcome @Joe. You can ignore those messages, it shouldn't affect you
-
Andres over 12 yearsFor 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. almost 12 yearsFunny that there is no mention of how to mount /dev/sr0 in the VirtualBox docs. Or did I miss something?
-
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 almost 11 yearsIn my experience, 60% of the time it fails every time.